Blend2D
2D Vector Graphics Engine
Tests whether the font data is a built-in null instance.
Tests whether the font data is empty, which is the same as !isValid()
.
Creates a BLFontData from a file specified by the given fileName
.
readFlags
argument allows to specify flags that will be passed to BLFileSystem::readFile()` to read the content of the file. It's possible to use memory mapping to get its content, which is the recommended way for reading system fonts. The best combination is to use BL_FILE_READ_MMAP_ENABLED flag combined with BL_FILE_READ_MMAP_AVOID_SMALL. This combination means to try to use memory mapping only when the size of the font is greater than a minimum value (determined by Blend2D), and would fallback to a regular open/read in case the memory mapping is not possible or failed for some other reason. Please note that not all files can be memory mapped so BL_FILE_READ_MMAP_NO_FALLBACK flag is not recommended. Creates a BLFontData from the given data
stored in BLArray<uint8_t>
The given data
would be weak copied on success so the given array can be safely destroyed after the function returns.
data
is internal and there is no API to access it after the function returns. The reason for making it internal is that multiple implementations of BLFontData may exist and some can only store data at table level, so Blend2D doesn't expose the detail about how the data is stored. Creates BLFontData
from the given data
of the given size
.
destroyFunc
can be used as a notifier that will be called when the data is no longer needed. Destroy func will be called with userData
. Type of font face that this data describes.
It doesn't matter if the content is a single font or a collection. In any case the faceType()
would always return the type of the font face that will be created by BLFontFace::createFromData().
Returns the number of faces of this font data.
If the data is not initialized the result would be always zero. If the data is initialized to a single font it would be 1, and if the data is initialized to a font collection then the return would correspond to the number of font faces within that collection.
faceCount()
to check whether the font is a collection as it's possible to have a font-collection with just a single font. Using isCollection()
is more reliable and would always return the right value. Returns font data flags.
Tests whether this font data is a font-collection.