|
That Terminal
A terminal emulator designed for video making purposes.
|
Contains low-level functions for parsing font files. Used by ReadFontsList and FontPlan. More...
#include <filesystem>#include <vector>#include <map>#include <unordered_map>

Go to the source code of this file.
Classes | |
| struct | GlyphList |
Functions | |
| std::multimap< std::size_t, char32_t > | Read_PSFgzEncoding (std::string_view filename) |
| std::vector< char32_t > | BDFtranslateToUnicode (int index, std::string_view reg, std::string_view enc) |
| GlyphList | Read_PSFgz (std::string_view filename, unsigned width, unsigned height, std::string_view guess_encoding) |
| GlyphList | Read_BDF (std::string_view filename, unsigned width, unsigned height, std::string_view guess_encoding) |
| GlyphList | Read_Inc (std::string_view filename, unsigned width, unsigned height, std::string_view guess_encoding) |
| GlyphList | Read_ASM (std::string_view filename, unsigned width, unsigned height, std::string_view guess_encoding) |
| GlyphList | Read_Font (std::filesystem::path filename, unsigned width, unsigned height, bool find=false, std::string_view guess_encoding="") |
| std::string | ReadGZ (std::string_view filename) |
Contains low-level functions for parsing font files. Used by ReadFontsList and FontPlan.
| std::vector<char32_t> BDFtranslateToUnicode | ( | int | index, |
| std::string_view | reg, | ||
| std::string_view | enc | ||
| ) |
Attempts to convert a character index into unicode using the given encoding.
| index | Character index to convert |
| reg | First part of encoding name (registry) |
| enc | Second part of encoding name (encoding) |
If both reg and enc are supplied, they are joined with a dash. The following encodings are supported by built-in code: iso10646-1 and iso-8859-1: Index is returned verbatim jisx0201.1976-0: Conversion is done using built-in code
For any other encoding, a conversion table file is searched in share/encodings/. If the file is found, and the table contains information about this index, that table is used for the translation.
Additionally, indexes 00-1F and 7F are converted as in CP437; indexes 81-9F follow the CP/M plus character set with a shift. The result is an array that contains multiple choices for the encoding.
| GlyphList Read_ASM | ( | std::string_view | filename, |
| unsigned | width, | ||
| unsigned | height, | ||
| std::string_view | guess_encoding | ||
| ) |
Reads an .asm format font file.
| GlyphList Read_BDF | ( | std::string_view | filename, |
| unsigned | width, | ||
| unsigned | height, | ||
| std::string_view | guess_encoding | ||
| ) |
Reads a BDF format font file.
| GlyphList Read_Font | ( | std::filesystem::path | filename, |
| unsigned | width, | ||
| unsigned | height, | ||
| bool | find = false, |
||
| std::string_view | guess_encoding = "" |
||
| ) |
Locates a font file by the given name (
| filename | File to read |
| width | Width of glyphs in the font |
| height | Height of glyphs in the font |
| find | If true, uses FindShareFile to locate the file. If false, just reads the given path. |
| guess_encoding | Guessed encoding for the font. |
| GlyphList Read_Inc | ( | std::string_view | filename, |
| unsigned | width, | ||
| unsigned | height, | ||
| std::string_view | guess_encoding | ||
| ) |
Reads an .inc format font file.
| GlyphList Read_PSFgz | ( | std::string_view | filename, |
| unsigned | width, | ||
| unsigned | height, | ||
| std::string_view | guess_encoding | ||
| ) |
Reads a PDF.gz format font file.
| std::multimap<std::size_t, char32_t> Read_PSFgzEncoding | ( | std::string_view | filename | ) |
Reads a character encoding table from a PSF.GZ file.
| std::string ReadGZ | ( | std::string_view | filename | ) |
Reads a GZIP-compressed or deflated file and decompresses it using TinyDeflate.