Ignore:
Timestamp:
2020-09-25T14:31:27Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
16357ec
Parents:
120031a5
git-author:
Jiri Svoboda <jiri@…> (2020-09-24 18:30:07)
git-committer:
Jiri Svoboda <jiri@…> (2020-09-25 14:31:27)
Message:

Cannot just write structures to TPF file

This would compromise portability of TPF files. What was I thinking?
Endianness and type widths must be fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gfxfont/private/tpf_file.h

    r120031a5 r453f203b  
    3838#define _GFX_PRIVATE_TPF_FILE_H
    3939
     40#include <stdint.h>
     41
    4042enum {
    4143        /** Typeface RIFF format ID */
     
    6365};
    6466
     67/** TPF font properties */
     68typedef struct {
     69        uint16_t size;
     70        uint16_t flags;
     71} tpf_font_props_t;
     72
     73/** TPF font metrics */
     74typedef struct {
     75        uint16_t ascent;
     76        uint16_t descent;
     77        uint16_t leading;
     78} tpf_font_metrics_t;
     79
     80/** TPF glyph metrics */
     81typedef struct {
     82        uint16_t advance;
     83} tpf_glyph_metrics_t;
     84
     85/** TPF glyph rectangle/origin */
     86typedef struct {
     87        /** Rectangle p0.x */
     88        uint32_t p0x;
     89        /** Rectangle p0.y */
     90        uint32_t p0y;
     91        /** Rectangle p1.x */
     92        uint32_t p1x;
     93        /** Rectangle p1.y */
     94        uint32_t p1y;
     95        /** Origin X */
     96        uint32_t orig_x;
     97        /** Origin Y */
     98        uint32_t orig_y;
     99} tpf_glyph_ror_t;
     100
     101/** TPF font bitmap header */
     102typedef struct {
     103        /** Width in pixels */
     104        uint32_t width;
     105        /** Height in pixels */
     106        uint32_t height;
     107        /** Format (0) */
     108        uint16_t fmt;
     109        /** Depth (bits/pixel) */
     110        uint16_t depth;
     111} tpf_font_bmp_hdr_t;
     112
    65113#endif
    66114
Note: See TracChangeset for help on using the changeset viewer.