![]() |
LuciadCPillar 2024.1.06
|
This class allows you to register custom fonts. More...
#include <luciad/text/Fonts.h>
Static Public Member Functions | |
static std::vector< size_t > | getSupportedFontSizes (const std::string &fontName) |
This function is used to see which font sizes are supported by a bitmap font. More... | |
static void | registerFont (const FontConfig &fontConfig) |
Registers an additional font that can be used in alongside the default ones, for example for use in a TextStyle . More... | |
static void | registerFont (const std::string &fontName, const std::string &fontPath) |
Registers an additional font that can be used in alongside the default ones, for example for use in a TextStyle . More... | |
This class allows you to register custom fonts.
By default, the following fonts are supported:
Font Name | Font |
---|---|
Arial | Liberation Sans Serif |
Arial Narrow | Liberation Sans Narrow |
Arial Black | Archivo Black |
Bitstream Vera Sans | Bistream Vera Sans |
Calibri | Open Sans |
Console | Inconsolata |
Noto Sans | Noto Sans |
Times New Roman | Liberation Serif |
For international language support, the Noto font from Google was added. As the Noto font is very extensive, only a small subset of fonts is available. List of currently supported alphabets in the Noto font:
Note that these are all vector fonts, so for these default fonts any font size can be used.
You can register additional fonts using the luciad::Fonts::registerFont
function.
|
static |
This function is used to see which font sizes are supported by a bitmap font.
Not necessary for vector fonts, also known as outline fonts, since they can scale to any size. For these fonts, and empty list is returned.
fontName | identifier of the font. |
luciad::InvalidArgumentException | when the font is not registered. |
|
static |
Registers an additional font that can be used in alongside the default ones, for example for use in a TextStyle
.
Using a font name that is already in use overwrites it, this includes the fonts available by default.
Node: registering bitmap fonts instead of vector fonts is supported, but it may have downsides:
fontConfig | the configuration of the font |
luciad::InvalidArgumentException | when one of the paths is invalid. |
|
static |
Registers an additional font that can be used in alongside the default ones, for example for use in a TextStyle
.
Using a font name that is already in use overwrites it, this includes the fonts available by default.
Node: registering bitmap fonts instead of vector fonts is supported, but it may have downsides:
fontName | identifier of the font. |
fontPath | the path to the font file. |
luciad::InvalidArgumentException | when the path is invalid. |