Ultralight C API 1.4.0
|
User-defined font loader interface.
#include <Ultralight/CAPI/CAPI_FontLoader.h>
The library uses this to load a font file (eg, Arial.ttf
) for a given font description (eg, font-family: Arial;
).
Every OS has its own library of installed system fonts. The FontLoader interface is used to lookup these fonts and fetch the actual font data (raw TTF/OTF file data) for a given font description.
You can provide the library with your own font loader implementation so that you can bundle fonts with your application rather than relying on the system's installed fonts.
Classes | |
struct | ULFontLoader |
User-defined font loader interface. More... | |
Typedefs | |
typedef ULString(* | ULFontLoaderGetFallbackFont) () |
Fallback font family name. | |
typedef ULString(* | ULFontLoaderGetFallbackFontForCharacters) (ULString characters, int weight, bool italic) |
Fallback font family name that can render the specified characters. | |
typedef ULFontFile(* | ULFontLoaderLoad) (ULString family, int weight, bool italic) |
Get the actual font file data (TTF/OTF) for a given font description. | |
typedef ULString(* ULFontLoaderGetFallbackFont) () |
Fallback font family name.
Will be used if all other fonts fail to load.
typedef ULString(* ULFontLoaderGetFallbackFontForCharacters) (ULString characters, int weight, bool italic) |
Fallback font family name that can render the specified characters.
This is mainly used to support CJK (Chinese, Japanese, Korean) text display.
characters | One or more UTF-16 characters. This is almost always a single character. |
weight | Font weight. |
italic | Whether or not italic is requested. |
typedef ULFontFile(* ULFontLoaderLoad) (ULString family, int weight, bool italic) |
Get the actual font file data (TTF/OTF) for a given font description.
family | Font family name. |
weight | Font weight. |
italic | Whether or not italic is requested. |