Magnum::Text namespace

Text rendering.


Font texture creation and text layouting.

This library is built if WITH_TEXT is enabled when building Magnum. To use this library with CMake, you need to request the Text component of the Magnum package and link to the Magnum::Text target:

find_package(Magnum REQUIRED Text)

# ...
target_link_libraries(your-app Magnum::Text)

Additional plugins and utilities are built separately. See particular *Font and *FontConverter class documentation, the magnum-fontconverter utility documentation, Downloading and building, Downloading and building plugins, Usage with CMake, Plugin usage with CMake and Loading and using plugins for more information.


class AbstractFont
Base for font plugins.
class AbstractFontConverter
Base for font converter plugins.
class AbstractLayouter
Base for text layouters.
class AbstractRenderer
Base for text renderers.
class DistanceFieldGlyphCache
Glyph cache with distance field rendering.
class FreeTypeFont
FreeType font plugin.
class GlyphCache
Glyph cache.
class HarfBuzzFont
HarfBuzz font plugin.
class MagnumFont
Simple bitmap font plugin.
class MagnumFontConverter
MagnumFont converter plugin.
template<UnsignedInt dimensions>
class Renderer
Text renderer.
class StbTrueTypeFont
TrueType font plugin using stb_truetype.


enum class Alignment: UnsignedByte { LineLeft = Implementation::AlignmentLine|Implementation::AlignmentLeft, LineCenter = Implementation::AlignmentLine|Implementation::AlignmentCenter, LineRight = Implementation::AlignmentLine|Implementation::AlignmentRight, MiddleLeft = Implementation::AlignmentMiddle|Implementation::AlignmentLeft, MiddleCenter = Implementation::AlignmentMiddle|Implementation::AlignmentCenter, MiddleRight = Implementation::AlignmentMiddle|Implementation::AlignmentRight, TopLeft = Implementation::AlignmentTop|Implementation::AlignmentLeft, TopCenter = Implementation::AlignmentTop|Implementation::AlignmentCenter, TopRight = Implementation::AlignmentTop|Implementation::AlignmentRight, LineCenterIntegral = Implementation::AlignmentLine|Implementation::AlignmentCenter|Implementation::AlignmentIntegral, MiddleLeftIntegral = Implementation::AlignmentMiddle|Implementation::AlignmentLeft|Implementation::AlignmentIntegral, MiddleCenterIntegral = Implementation::AlignmentMiddle|Implementation::AlignmentCenter|Implementation::AlignmentIntegral, MiddleRightIntegral = Implementation::AlignmentMiddle|Implementation::AlignmentRight|Implementation::AlignmentIntegral }
Text rendering alignment.


using Renderer2D = Renderer<2>
Two-dimensional text renderer.
using Renderer3D = Renderer<3>
Three-dimensional text renderer.

Enum documentation

enum class Magnum::Text::Alignment: UnsignedByte

Text rendering alignment.


Text start and line is at origin


Text center and line is at origin


Text end and line is at origin


Text start and vertical middle is at origin


Text center and vertical middle is at origin


Text end and vertical middle is at origin


Text start and top is at origin


Text center and top is at origin


Text end and top is at origin


Text center and line is at origin and alignment offset is integral


Text start and vertical middle is at origin and alignment offset is integral


Text center and vertical middle is at origin and alignment offset is integral


Text end and vertical middle is at origin and alignment offset is integral

Typedef documentation

typedef Renderer<2> Magnum::Text::Renderer2D

Two-dimensional text renderer.

typedef Renderer<3> Magnum::Text::Renderer3D

Three-dimensional text renderer.