diff options
author | Marvin Borner | 2021-03-26 21:55:50 +0100 |
---|---|---|
committer | Marvin Borner | 2021-03-26 22:02:20 +0100 |
commit | 05498860e8f7b1e8bb27880bc7526de026694804 (patch) | |
tree | 3bddf16e9439a950a3810d45e42a5cefdbcb7663 /libs/libgui/psf.h | |
parent | a96e9c4c858d47f61b89d879aa0ce6a02bdacb38 (diff) |
Renamed libs
Cleaner and more flexible.
Diffstat (limited to 'libs/libgui/psf.h')
-rw-r--r-- | libs/libgui/psf.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libs/libgui/psf.h b/libs/libgui/psf.h new file mode 100644 index 0000000..63a3d1e --- /dev/null +++ b/libs/libgui/psf.h @@ -0,0 +1,48 @@ +// MIT License, Copyright (c) 2020 Marvin Borner +// PSF parser + +#ifndef PSF_H +#define PSF_H + +#include <def.h> + +/** + * 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 + +struct psf1_header { + u8 magic[2]; + u8 mode; + u8 char_size; +}; + +/** + * PSF version 2 + */ + +#define PSF2_MAGIC_0 0x72 +#define PSF2_MAGIC_1 0xb5 +#define PSF2_MAGIC_2 0x4a +#define PSF2_MAGIC_3 0x86 + +struct psf2_header { + u8 magic[4]; + u32 version; + u32 size; + u32 flags; + u32 glyph_count; + u32 char_size; + u32 height; + u32 width; +}; + +struct font *psf_parse(char *data); + +#endif |