The font rendering class, see IFont. More...

#include "murl_util_font.h"

Inheritance diagram for Murl::Util::Font:

Public Member Functions

 Font (const Resource::IFont *resourceFont, Real size)
 Constructor taking a font resource and size. More...
 
 ~Font () override
 The destructor.
 
Bool SetSize (Real size) override
 Implementation of IFont::SetSize(). More...
 
Real GetSize () const override
 Implementation of IFont::GetSize(). 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 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 void SetResourceFont (const Resource::IFont *resourceFont)
 Set the font resource. More...
 
virtual const Resource::IFontGetResourceFont () const
 Get the font resource. More...
 

Detailed Description

The font rendering class, see IFont.

Constructor & Destructor Documentation

◆ Font()

Murl::Util::Font::Font ( const Resource::IFont resourceFont,
Real  size 
)

Constructor taking a font resource and size.

Parameters
resourceFontThe font resource.
sizeThe size of the font.

Member Function Documentation

◆ SetSize()

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

Implementation of IFont::SetSize().

Parameters
sizeThe font size.
Returns
true if successful.

Implements Murl::IFont.

◆ GetSize()

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

Implementation of IFont::GetSize().

Returns
The font size.

Implements Murl::IFont.

◆ SetSpacing()

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

Implementation of IFont::SetSpacing().

Parameters
spacingThe character spacing value.
Returns
true if successful.

Implements Murl::IFont.

◆ GetSpacing()

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

Implementation of IFont::GetSpacing().

Returns
The character spacing value.

Implements Murl::IFont.

◆ SetLeading()

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

Implementation of IFont::SetLeading().

Parameters
leadingThe leading value.
Returns
true if successful.

Implements Murl::IFont.

◆ GetLeading()

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

Implementation of IFont::GetLeading().

Returns
The font leading value.

Implements Murl::IFont.

◆ SetEmbolding()

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

Implementation of IFont::SetEmbolding().

Parameters
strengthThe embolding strength value.
Returns
true if successful.

Implements Murl::IFont.

◆ GetEmbolding()

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

Implementation of IFont::GetEmbolding().

Returns
The embolding strength value.

Implements Murl::IFont.

◆ SetBlur()

Bool Murl::Util::Font::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::Font::GetBlur ( ) const
overridevirtual

Implementation of IFont::GetBlur().

Returns
The blur strength value.

Implements Murl::IFont.

◆ SetSpaceWidthFactor()

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

Implementation of IFont::SetSpaceWidthFactor().

Parameters
factorThe space width factor.
Returns
true if successful.

Implements Murl::IFont.

◆ GetSpaceWidthFactor()

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

Implementation of IFont::GetSpaceWidthFactor().

Returns
The space width factor.

Implements Murl::IFont.

◆ SetDigitWidthFactor()

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

Implementation of IFont::SetDigitWidthFactor().

Parameters
factorThe digit width factor.
Returns
true if successful.

Implements Murl::IFont.

◆ GetDigitWidthFactor()

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

Implementation of IFont::GetDigitWidthFactor().

Returns
The digit width factor.

Implements Murl::IFont.

◆ SetSameDigitWidthEnabled()

Bool Murl::Util::Font::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::Font::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::Font::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::Font::IsLegacyEmboldingEnabled ( ) const
overridevirtual

Implementation of IFont::IsLegacyEmboldingEnabled().

Returns
true if used.

Implements Murl::IFont.

◆ RenderText()

Bool Murl::Util::Font::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::Font::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.

◆ SetResourceFont()

virtual void Murl::Util::Font::SetResourceFont ( const Resource::IFont resourceFont)
virtual

Set the font resource.

Parameters
resourceFontThe font resource.

◆ GetResourceFont()

virtual const Resource::IFont* Murl::Util::Font::GetResourceFont ( ) const
virtual

Get the font resource.

Returns
The font resource.

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


Copyright © 2011-2024 Spraylight GmbH.