/* Copyright (C) 2021 Rain */ /* This file is part of XNIX. */ /* XNIX is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) and later version. */ /* XNIX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ /* You should have received a copy of the GNU General Public License along with XNIX. If not, see . */ #include #include #include #include #include #include #include /* * we supports PSF format in XNIX. * in linux, PSF fonts are in /usr/share/kbd/consolefonts, and they are always compressed. * */ #define PSF_MAGIC 0x864ab572 struct psf_header { __uint32_t magic; /* zero */ __uint32_t version; __uint32_t header_size; /* zero if there's no unicode table */ __uint32_t flags; /* in psf, a font calls glyph */ __uint32_t glyphs_count; /* size of a glyph */ __uint32_t glyph_size; __uint32_t height; __uint32_t width; };