Classes

struct  FontStyle
 Bits used to denote font styling. More...
 
struct  TextRepresentation
 Denotes whether or not text insertion inserts faceted text and/or outlined text. More...
 

Enumerations

enum  Quality { Low, Medium, High }
 Configures generic quality. More...
 
enum  TextAlignment : uint32_t {
  TextAlignment::TopLeft, TextAlignment::CenterLeft, TextAlignment::BottomLeft, TextAlignment::TopCenter,
  TextAlignment::Center, TextAlignment::BottomCenter, TextAlignment::TopRight, TextAlignment::CenterRight,
  TextAlignment::BottomRight
}
 

Functions

SC_API MeshKey InsertText (Model &model, TextAlignment alignment, Matrix3d const &transform, char const *utf8_text, char const *font_name, FontStyle::Bits font_style, Quality font_quality, TextRepresentation::Bits representation_bits)
 
SC_API void ReleaseFontResources ()
 
SC_API void SetFallbackFonts (std::vector< char const *> const &fallback_font_names)
 
SC_API void SetFontDirectory (char const *font_directory)
 
SC_API void Shutdown ()
 

Enumeration Type Documentation

◆ Quality

Configures generic quality.

Enumerator
Low 
Medium 
High 

◆ TextAlignment

enum SC::Store::Utils::Text::TextAlignment : uint32_t
strong
Enumerator
TopLeft 

Insertion point is the top left corner of the text string.

CenterLeft 

Insertion point is the center of the left side of the text string.

BottomLeft 

Insertion point is the bottom left corner of the text string.

TopCenter 

Insertion point is the center of the top side of the text string.

Center 

Insertion point is the vertical and horizontal center of the text string.

BottomCenter 

Insertion point is the center of the bottom side of the text string.

TopRight 

Insertion point is the top right corner of the text string.

CenterRight 

Insertion point is the center of the right side of the text string.

BottomRight 

Insertion point is the bottom right corner of the text string.

Function Documentation

◆ InsertText()

SC_API MeshKey SC::Store::Utils::Text::InsertText ( Model model,
TextAlignment  alignment,
Matrix3d const &  transform,
char const *  utf8_text,
char const *  font_name,
FontStyle::Bits  font_style,
Quality  font_quality,
TextRepresentation::Bits  representation_bits 
)

Inserts text into the stream cache as mesh geometry.

Returns
The mesh key of the generated text geometry.
Parameters
modelThe stream cache model to insert the text into.
alignmentControls the alignment of the inserted text relative to its inserted position.
transformTransforms the generated mesh points by this matrix.
utf8_textThe text to insert. Text is expected to be in UTF-8 encoding.
font_nameThe name of the font to generate the text with.
font_styleThe style of the font to generate the text with.
font_qualityThe quality of the font to generate the text with.
representation_bitsControls whether or not the text is inserted as faces and/or lines.

◆ ReleaseFontResources()

SC_API void SC::Store::Utils::Text::ReleaseFontResources ( )

Closes any open font resources used by this library. Useful for deleting any temporary font files. This is implicitly called by Shutdown().

◆ SetFallbackFonts()

SC_API void SC::Store::Utils::Text::SetFallbackFonts ( std::vector< char const *> const &  fallback_font_names)

Supplies a list of fonts to be used as fallbacks for when a character can not be found in an active font.

Parameters
fallback_font_namesA list of UTF8 encoded strings that correspond to the fallback fonts being used.

◆ SetFontDirectory()

SC_API void SC::Store::Utils::Text::SetFontDirectory ( char const *  font_directory)

Sets the font directory to search for fonts in.

Parameters
font_directoryThe file path of the search directory to set.

◆ Shutdown()

SC_API void SC::Store::Utils::Text::Shutdown ( )

This function should be called after use of this library is finished. After this function is called, functions in this library should not be called.