2D Vector Graphics Engine
Font data [C++ API].
Tests whether the font-data is a built-in null instance.
Tests whether the font-data is empty (which the same as
isNone() in this case).
BLFontData from a file specified by the given
readFlagsargument 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_ENABLEDflag 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_FALLBACKflag is not recommended.
data would be weak copied on success so the given array can be safely destroyed after the function returns.
datais internal and there is no API to access it after the function returns. The reason for making it internal is that multiple implementations of
BLFontDatamay exist and some can only store data at table level, so Blend2D doesn't expose the detail about how the data is stored.
nullptr, void* destroyData =
BLFontData from the given
data of the given
destroyFunccan be used as a notifier that will be called when the data is no longer needed and
destroyDataacts as a user data passed to
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.
Returns font-data flags, see
Tests whether this font-data is a font-collection.