TrueType font plugin using stb_truetype.
Supports opening fonts of the following formats either from file or from memory location using the stb_
- TrueType fonts (
- OpenType / Type 2 fonts (
This plugin provides the
OpenTypeFont plugins, but please note that this plugin trades the simplicity and portability for various limitations, the most visible being the lack of autohinting. That causes the rendered glyphs looking blurry compared to for example FreeTypeFont and because of that the font properties and sizes don't exactly match properties of fonts opened with FreeTypeFont using the same size.
This plugin depends on the Text library and is built if
WITH_STBTRUETYPEFONT is enabled when building Magnum Plugins and depends on the Text library. To use as a dynamic plugin, load
"StbTrueTypeFont" via Corrade::
Additionally, if you're using Magnum as a CMake subproject, bundle the magnum-plugins repository and do the following:
set(WITH_STBTRUETYPEFONT ON CACHE BOOL "" FORCE) add_subdirectory(magnum-plugins EXCLUDE_FROM_ALL) # So the dynamically loaded plugin gets built implicitly add_dependencies(your-app MagnumPlugins::StbTrueTypeFont)
To use as a static plugin or as a dependency of another plugin with CMake, put FindMagnumPlugins.cmake into your
modules/ directory, request the
StbTrueTypeFont component of the
MagnumPlugins package and link to the
find_package(MagnumPlugins REQUIRED StbTrueTypeFont) # ... target_link_libraries(your-app PRIVATE MagnumPlugins::StbTrueTypeFont)
- class AbstractFont
- Base for font plugins.