HikoGUI
A low latency retained GUI
|
When the application is started a global FontBook is instanced. During the FontBook's instantiation it will fast-parse each TrueType font in the operating system's font folder.
During the fast-parse the name
, OS/2
and optionally other tables are read and then the font files are closed and memory is freed. This fast-parse is designed to be very fast to reduce impact on application startup time.
The following information gleamed during the fast-parse:
name
Preferred Font family name; code-16 if available, otherwise code-1name
Preferred Font subfamily name: code-17 if available, otherwise code-2OS/2
Font weightOS/2
Regular/ItalicOS/2
Serif/Sans-serifOS/2
Variable/MonospaceOS/2
Regular/CondensedOS/2
Unicode ranges (as backup the cmap
table may be parsed)OS/2
The height of x
and H
(as back the glyf
table may be parsed)Each font family is assigned a FamilyID. Each font is assigned a FontID.
There is a list of fallback font families for well known fonts, in case certain font families are not available on the system.
Each font will be assigned a list of fallback fonts for missing glyph lookup. Priority is given for fonts that start with the same font family name. For example "Arial Arabic" will be prioritized when the current font is "Arial"
A FontVariant consists of a FontWeight+serif-flag. This allows a user to select a font family to draw a text with and emphasize fragments of the text using italic and bold.
There are a total of maximum 20 FontVariants for each FontFamilyID.
Selecting a font to render a text is done in several steps:
Features:
The text-widget is used by almost every widget to draw text. This same widget is also has full capabilities for text editing.
Features: