Murl::Util::FontCollection Class Reference

A collection of multiple fonts to render, see IFont. More...

#include "murl_util_font_collection.h"

Inheritance diagram for Murl::Util::FontCollection:

Public Member Functions

 FontCollection (Real size)
 Constructor taking a base font size. More...
 
 ~FontCollection () override
 The destructor.
 
Bool SetSize (Real size) override
 Implementation of IFont::SetSize(). More...
 
Real GetSize () const override
 Implementation of IFont::GetSize(). More...
 
Bool SetAscent (Real ascent) override
 Implementation of IFont::SetAscent(). More...
 
Real GetAscent () const override
 Implementation of IFont::GetAscent(). More...
 
Bool SetDescent (Real descent) override
 Implementation of IFont::SetDescent(). More...
 
Real GetDescent () const override
 Implementation of IFont::GetDescent(). More...
 
Bool SetSpacing (Real spacing) override
 Implementation of IFont::SetSpacing(). More...
 
Real GetSpacing () const override
 Implementation of IFont::GetSpacing(). More...
 
Bool SetLeading (Real leading) override
 Implementation of IFont::SetLeading(). More...
 
Real GetLeading () const override
 Implementation of IFont::GetLeading(). More...
 
Bool SetOffset (Real offsetX, Real offsetY) override
 Implementation of IFont::SetOffset(). More...
 
Bool SetOffsetX (Real offsetX) override
 Implementation of IFont::SetOffsetX(). More...
 
Bool SetOffsetY (Real offsetY) override
 Implementation of IFont::SetOffsetY(). More...
 
Real GetOffsetX () const override
 Implementation of IFont::GetOffsetX(). More...
 
Real GetOffsetY () const override
 Implementation of IFont::GetOffsetY(). More...
 
Bool SetRaster (Real rasterX, Real rasterY) override
 Implementation of IFont::SetRaster(). More...
 
Bool SetRasterX (Real rasterX) override
 Implementation of IFont::SetRasterX(). More...
 
Bool SetRasterY (Real rasterY) override
 Implementation of IFont::SetRasterY(). More...
 
Real GetRasterX () const override
 Implementation of IFont::GetRasterX(). More...
 
Real GetRasterY () const override
 Implementation of IFont::GetRasterY(). More...
 
Bool SetEmbolding (Real strength) override
 Implementation of IFont::SetEmbolding(). More...
 
Real GetEmbolding () const override
 Implementation of IFont::GetEmbolding(). More...
 
Bool SetBlur (Real strength) override
 Implementation of IFont::SetBlur(). More...
 
Real GetBlur () const override
 Implementation of IFont::GetBlur(). More...
 
Bool SetSpaceWidthFactor (Real factor) override
 Implementation of IFont::SetSpaceWidthFactor(). More...
 
Real GetSpaceWidthFactor () const override
 Implementation of IFont::GetSpaceWidthFactor(). More...
 
Bool SetDigitWidthFactor (Real factor) override
 Implementation of IFont::SetDigitWidthFactor(). More...
 
Real GetDigitWidthFactor () const override
 Implementation of IFont::GetDigitWidthFactor(). More...
 
Bool SetSameDigitWidthEnabled (Bool enabled) override
 Implementation of IFont::SetSameDigitWidthEnabled(). More...
 
Bool IsSameDigitWidthEnabled () const override
 Implementation of IFont::IsSameDigitWidthEnabled(). More...
 
Bool SetLegacyEmboldingEnabled (Bool enabled) override
 Implementation of IFont::SetLegacyEmboldingEnabled(). More...
 
Bool IsLegacyEmboldingEnabled () const override
 Implementation of IFont::IsLegacyEmboldingEnabled(). More...
 
Bool RenderText (const String &text, const Color &textColor, const Color &backgroundColor, Bool clearSurface, Bool enableWordWrap, Real containerPosX, Real containerPosY, Real containerSizeX, Real containerSizeY, IEnums::TextAlignmentX alignX, IEnums::TextAlignmentY alignY, IVideoSurface *surface) const override
 Implementation of IFont::RenderText(). More...
 
Bool QueryTextSize (const String &text, Bool enableWordWrap, Real containerPosX, Real containerPosY, Real containerSizeX, Real containerSizeY, Real &textSizeX, Real &textSizeY) const override
 Implementation of IFont::QueryTextSize(). More...
 
virtual Bool AddFont (const String &startTag, const String &endTag, Font *font, UInt32 startCode=0U, UInt32 endCode=0xffffffffU)
 Add a named font. More...
 
virtual Bool AddColor (const String &startTag, const String &endTag, const Color &textColor, const Color &backgroundColor)
 Add a named color. More...
 
virtual Bool AddAppearance (const String &startTag, const String &endTag, const Array< Layer * > &layers)
 Add a named appearance. More...
 
virtual Bool AddPlaceholder (const String &startTag, const String &endTag, Real sizeX, Real sizeY, Real scale)
 Add a named placeholder. More...
 
virtual Bool SetTagStart (const String &character, const String &escapeSequence)
 Set the tag start character & escape sequence. More...
 
virtual Bool SetTagEnd (const String &character, const String &escapeSequence)
 Set the tag end character & escape sequence. More...
 

Detailed Description

A collection of multiple fonts to render, see IFont.

Constructor & Destructor Documentation

◆ FontCollection()

Murl::Util::FontCollection::FontCollection ( Real  size)

Constructor taking a base font size.

Parameters
sizeThe base size of the font collection.

Member Function Documentation

◆ SetSize()

Bool Murl::Util::FontCollection::SetSize ( Real  size)
overridevirtual

Implementation of IFont::SetSize().

Parameters
sizeThe font size.
Returns
true if successful.

Implements Murl::IFont.

◆ GetSize()

Real Murl::Util::FontCollection::GetSize ( ) const
overridevirtual

Implementation of IFont::GetSize().

Returns
The font size.

Implements Murl::IFont.

◆ SetAscent()

Bool Murl::Util::FontCollection::SetAscent ( Real  ascent)
overridevirtual

Implementation of IFont::SetAscent().

Parameters
ascentThe font ascent.
Returns
true if successful.

Implements Murl::IFont.

◆ GetAscent()

Real Murl::Util::FontCollection::GetAscent ( ) const
overridevirtual

Implementation of IFont::GetAscent().

Returns
The font ascent.

Implements Murl::IFont.

◆ SetDescent()

Bool Murl::Util::FontCollection::SetDescent ( Real  descent)
overridevirtual

Implementation of IFont::SetDescent().

Parameters
descentThe font descent.
Returns
true if successful.

Implements Murl::IFont.

◆ GetDescent()

Real Murl::Util::FontCollection::GetDescent ( ) const
overridevirtual

Implementation of IFont::GetDescent().

Returns
The font descent.

Implements Murl::IFont.

◆ SetSpacing()

Bool Murl::Util::FontCollection::SetSpacing ( Real  spacing)
overridevirtual

Implementation of IFont::SetSpacing().

Parameters
spacingThe character spacing value.
Returns
true if successful.

Implements Murl::IFont.

◆ GetSpacing()

Real Murl::Util::FontCollection::GetSpacing ( ) const
overridevirtual

Implementation of IFont::GetSpacing().

Returns
The character spacing value.

Implements Murl::IFont.

◆ SetLeading()

Bool Murl::Util::FontCollection::SetLeading ( Real  leading)
overridevirtual

Implementation of IFont::SetLeading().

Parameters
leadingThe leading value.
Returns
true if successful.

Implements Murl::IFont.

◆ GetLeading()

Real Murl::Util::FontCollection::GetLeading ( ) const
overridevirtual

Implementation of IFont::GetLeading().

Returns
The font leading value.

Implements Murl::IFont.

◆ SetOffset()

Bool Murl::Util::FontCollection::SetOffset ( Real  offsetX,
Real  offsetY 
)
overridevirtual

Implementation of IFont::SetOffset().

Parameters
offsetXThe horizontal offset.
offsetYThe vertical offset.
Returns
true if successful.

Implements Murl::IFont.

◆ SetOffsetX()

Bool Murl::Util::FontCollection::SetOffsetX ( Real  offsetX)
overridevirtual

Implementation of IFont::SetOffsetX().

Parameters
offsetXThe horizontal offset.
Returns
true if successful.

Implements Murl::IFont.

◆ SetOffsetY()

Bool Murl::Util::FontCollection::SetOffsetY ( Real  offsetY)
overridevirtual

Implementation of IFont::SetOffsetY().

Parameters
offsetYThe vertical offset.
Returns
true if successful.

Implements Murl::IFont.

◆ GetOffsetX()

Real Murl::Util::FontCollection::GetOffsetX ( ) const
overridevirtual

Implementation of IFont::GetOffsetX().

Returns
The horizontal offset.

Implements Murl::IFont.

◆ GetOffsetY()

Real Murl::Util::FontCollection::GetOffsetY ( ) const
overridevirtual

Implementation of IFont::GetOffsetY().

Returns
The vertical offset.

Implements Murl::IFont.

◆ SetRaster()

Bool Murl::Util::FontCollection::SetRaster ( Real  rasterX,
Real  rasterY 
)
overridevirtual

Implementation of IFont::SetRaster().

Parameters
rasterXThe horizontal raster value.
rasterYThe vertical raster value.
Returns
true if successful.

Implements Murl::IFont.

◆ SetRasterX()

Bool Murl::Util::FontCollection::SetRasterX ( Real  rasterX)
overridevirtual

Implementation of IFont::SetRasterX().

Parameters
rasterXThe horizontal raster value.
Returns
true if successful.

Implements Murl::IFont.

◆ SetRasterY()

Bool Murl::Util::FontCollection::SetRasterY ( Real  rasterY)
overridevirtual

Implementation of IFont::SetRasterY().

Parameters
rasterYThe vertical raster value.
Returns
true if successful.

Implements Murl::IFont.

◆ GetRasterX()

Real Murl::Util::FontCollection::GetRasterX ( ) const
overridevirtual

Implementation of IFont::GetRasterX().

Returns
The horizontal raster value.

Implements Murl::IFont.

◆ GetRasterY()

Real Murl::Util::FontCollection::GetRasterY ( ) const
overridevirtual

Implementation of IFont::GetRasterY().

Returns
The vertical raster value.

Implements Murl::IFont.

◆ SetEmbolding()

Bool Murl::Util::FontCollection::SetEmbolding ( Real  strength)
overridevirtual

Implementation of IFont::SetEmbolding().

Parameters
strengthThe embolding strength value.
Returns
true if successful.

Implements Murl::IFont.

◆ GetEmbolding()

Real Murl::Util::FontCollection::GetEmbolding ( ) const
overridevirtual

Implementation of IFont::GetEmbolding().

Returns
The embolding strength value.

Implements Murl::IFont.

◆ SetBlur()

Bool Murl::Util::FontCollection::SetBlur ( Real  strength)
overridevirtual

Implementation of IFont::SetBlur().

Parameters
strengthThe positive blur strength value.
Returns
true if successful.

Implements Murl::IFont.

◆ GetBlur()

Real Murl::Util::FontCollection::GetBlur ( ) const
overridevirtual

Implementation of IFont::GetBlur().

Returns
The blur strength value.

Implements Murl::IFont.

◆ SetSpaceWidthFactor()

Bool Murl::Util::FontCollection::SetSpaceWidthFactor ( Real  factor)
overridevirtual

Implementation of IFont::SetSpaceWidthFactor().

Parameters
factorThe space width factor.
Returns
true if successful.

Implements Murl::IFont.

◆ GetSpaceWidthFactor()

Real Murl::Util::FontCollection::GetSpaceWidthFactor ( ) const
overridevirtual

Implementation of IFont::GetSpaceWidthFactor().

Returns
The space width factor.

Implements Murl::IFont.

◆ SetDigitWidthFactor()

Bool Murl::Util::FontCollection::SetDigitWidthFactor ( Real  factor)
overridevirtual

Implementation of IFont::SetDigitWidthFactor().

Parameters
factorThe digit width factor.
Returns
true if successful.

Implements Murl::IFont.

◆ GetDigitWidthFactor()

Real Murl::Util::FontCollection::GetDigitWidthFactor ( ) const
overridevirtual

Implementation of IFont::GetDigitWidthFactor().

Returns
The digit width factor.

Implements Murl::IFont.

◆ SetSameDigitWidthEnabled()

Bool Murl::Util::FontCollection::SetSameDigitWidthEnabled ( Bool  enabled)
overridevirtual

Implementation of IFont::SetSameDigitWidthEnabled().

Parameters
enabledIf true, all digits use the same horizontal advance value.
Returns
true if successful.

Implements Murl::IFont.

◆ IsSameDigitWidthEnabled()

Bool Murl::Util::FontCollection::IsSameDigitWidthEnabled ( ) const
overridevirtual

Implementation of IFont::IsSameDigitWidthEnabled().

Returns
true if all digits use the same horizontal advance value.

Implements Murl::IFont.

◆ SetLegacyEmboldingEnabled()

Bool Murl::Util::FontCollection::SetLegacyEmboldingEnabled ( Bool  enabled)
overridevirtual

Implementation of IFont::SetLegacyEmboldingEnabled().

Parameters
enabledIf true, legacy embolding is used.
Returns
true if successful.

Implements Murl::IFont.

◆ IsLegacyEmboldingEnabled()

Bool Murl::Util::FontCollection::IsLegacyEmboldingEnabled ( ) const
overridevirtual

Implementation of IFont::IsLegacyEmboldingEnabled().

Returns
true if used.

Implements Murl::IFont.

◆ RenderText()

Bool Murl::Util::FontCollection::RenderText ( const String text,
const Color textColor,
const Color backgroundColor,
Bool  clearSurface,
Bool  enableWordWrap,
Real  containerPosX,
Real  containerPosY,
Real  containerSizeX,
Real  containerSizeY,
IEnums::TextAlignmentX  alignX,
IEnums::TextAlignmentY  alignY,
IVideoSurface surface 
) const
overridevirtual

Implementation of IFont::RenderText().

Parameters
textThe text to render.
textColorThe text color to render.
backgroundColorThe text background color to render.
clearSurfaceIf true, the output surface is cleared before rendering.
enableWordWrapIf true, word wrapping is enabled.
containerPosXThe horizontal text position in the video stream.
containerPosYThe vertical text position in the video stream.
containerSizeXThe horizontal size of the text rectangle, or 0 if the video stream's X size should be used
containerSizeYThe vertical size of the text rectangle, or 0 if the video stream's Y size should be used
alignXThe horizontal text alignment.
alignYThe vertical text alignment.
surfaceThe destination video surface.
Returns
true if successful.

Implements Murl::IFont.

◆ QueryTextSize()

Bool Murl::Util::FontCollection::QueryTextSize ( const String text,
Bool  enableWordWrap,
Real  containerPosX,
Real  containerPosY,
Real  containerSizeX,
Real  containerSizeY,
Real textSizeX,
Real textSizeY 
) const
overridevirtual

Implementation of IFont::QueryTextSize().

Parameters
textThe text to query.
enableWordWrapIf true, word wrapping is enabled.
containerPosXThe horizontal text position in the video stream.
containerPosYThe vertical text position in the video stream.
containerSizeXThe horizontal size of the text rectangle, or 0 if the video stream's X size should be used
containerSizeYThe vertical size of the text rectangle, or 0 if the video stream's Y size should be used
textSizeXThe text width return value.
textSizeYThe text height return value.
Returns
true if successful.

Implements Murl::IFont.

◆ AddFont()

virtual Bool Murl::Util::FontCollection::AddFont ( const String startTag,
const String endTag,
Font font,
UInt32  startCode = 0U,
UInt32  endCode = 0xffffffffU 
)
virtual

Add a named font.

The font collection takes ownership of the given font object.

Parameters
startTagThe start tag to identify the font.
endTagThe end tag to identify the font.
fontThe font to add.
Returns
true if successful.

◆ AddColor()

virtual Bool Murl::Util::FontCollection::AddColor ( const String startTag,
const String endTag,
const Color textColor,
const Color backgroundColor 
)
virtual

Add a named color.

Parameters
startTagThe start tag to identify the font.
endTagThe end tag to identify the font.
textColorThe foreground color to add.
backgroundColorThe background color to add.
Returns
true if successful.

◆ AddAppearance()

virtual Bool Murl::Util::FontCollection::AddAppearance ( const String startTag,
const String endTag,
const Array< Layer * > &  layers 
)
virtual

Add a named appearance.

Parameters
startTagThe start tag to identify the font.
endTagThe end tag to identify the font.
layersAn array of layers to be used for the appearance.
Returns
true if successful.

◆ AddPlaceholder()

virtual Bool Murl::Util::FontCollection::AddPlaceholder ( const String startTag,
const String endTag,
Real  sizeX,
Real  sizeY,
Real  scale 
)
virtual

Add a named placeholder.

Parameters
startTagThe start tag to identify the font.
endTagThe end tag to identify the font.
sizeXThe horizontal size.
sizeYThe vertical size.
scaleThe additional scale factor
Returns
true if successful.

◆ SetTagStart()

virtual Bool Murl::Util::FontCollection::SetTagStart ( const String character,
const String escapeSequence 
)
virtual

Set the tag start character & escape sequence.

Parameters
characterAn UTF8 sequence for a single tag start character.
escapeSequenceThe escape sequence for that character.
Returns
true if successful.

◆ SetTagEnd()

virtual Bool Murl::Util::FontCollection::SetTagEnd ( const String character,
const String escapeSequence 
)
virtual

Set the tag end character & escape sequence.

Parameters
characterAn UTF8 sequence for a single tag end character.
escapeSequenceThe escape sequence for that character.
Returns
true if successful.

The documentation for this class was generated from the following file:
  • murl_util_font_collection.h


Copyright © 2011-2025 Spraylight GmbH.