diff options
author | Marvin Borner | 2021-07-02 22:36:33 +0200 |
---|---|---|
committer | Marvin Borner | 2021-07-02 22:41:09 +0200 |
commit | a81a011d738a0cbd36e0d4f8e17691424d6bb1a0 (patch) | |
tree | 143c71ff59f2790bf628b572a58d9f6996edd3bd /libs/libgui/psf.h | |
parent | f3e85eedc434da973267f360abdbb79cb6f24100 (diff) |
Added UTF8 rendering support
Diffstat (limited to 'libs/libgui/psf.h')
-rw-r--r-- | libs/libgui/psf.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/libs/libgui/psf.h b/libs/libgui/psf.h index 8298441..2494fe9 100644 --- a/libs/libgui/psf.h +++ b/libs/libgui/psf.h @@ -10,15 +10,10 @@ * PSF version 1 */ -#define PSF1_MAGIC_0 0x36 -#define PSF1_MAGIC_1 0x04 -#define PSF1_MODE_256 0 -#define PSF1_MODE_512 1 -#define PSF1_MODE_256_UNICODE 2 -#define PSF1_MODE_512_UNICODE 3 +#define PSF1_MAGIC 0x0436 struct psf1_header { - u8 magic[2]; + u16 magic; u8 mode; u8 char_size; }; @@ -27,22 +22,22 @@ struct psf1_header { * PSF version 2 */ -#define PSF2_MAGIC_0 0x72 -#define PSF2_MAGIC_1 0xb5 -#define PSF2_MAGIC_2 0x4a -#define PSF2_MAGIC_3 0x86 +enum psf2_flags { PSF2_UNICODE = 1 }; +#define PSF2_MAGIC 0x864ab572 struct psf2_header { - u8 magic[4]; + u32 magic; u32 version; u32 size; - u32 flags; - u32 glyph_count; + enum psf2_flags flags; + u32 char_count; u32 char_size; u32 height; u32 width; }; -struct gfx_font *psf_parse(char *data) NONNULL; +struct gfx_font *psf_parse(const char *path) NONNULL; +u32 psf_unicode(struct gfx_font *font, u32 needle); +void psf_free(struct gfx_font *font); #endif |