STLL  0.0
Simple Text Layouting Library
STLL::FontFace_c Class Reference

This class represents one font, made out of one font file resource with a certain size. More...

Inheritance diagram for STLL::FontFace_c:

Classes

class  GlyphSlot_c
 

Public Member Functions

 FontFace_c (std::shared_ptr< FreeTypeLibrary_c > l, const internal::FontFileResource_c &r, uint32_t size)
 
 ~FontFace_c ()
 
FT_FaceRec_ * getFace (void) const
 Get the FreeType structure for this font. More...
 
GlyphSlot_c renderGlyph (glyphIndex_t glyphIndex, SubPixelArrangement sp)
 render a glyph of this font More...
 
bool containsGlyph (char32_t ch)
 check if a given character is available within this font More...
 
Functions to get font metrics
uint32_t getSize (void) const
 get the size of the font More...
 
const internal::FontFileResource_c & getResource (void) const
 get the font resource that was used to create this font More...
 
uint32_t getHeight (void) const
 Get the height of the font with multiplication factor of 64. More...
 
int32_t getAscender (void) const
 Get the ascender of the font with multiplication factor of 64. More...
 
int32_t getDescender (void) const
 Get the descender of the font with multiplication factor of 64. More...
 
int32_t getUnderlinePosition (void) const
 Get the underline position of the font with multiplication factor of 64. More...
 
int32_t getUnderlineThickness (void) const
 Get the underline thickness of the font with multiplication factor of 64. More...
 

Detailed Description

This class represents one font, made out of one font file resource with a certain size.

Constructor & Destructor Documentation

STLL::FontFace_c::FontFace_c ( std::shared_ptr< FreeTypeLibrary_c l,
const internal::FontFileResource_c &  r,
uint32_t  size 
)
STLL::FontFace_c::~FontFace_c ( )

Member Function Documentation

bool STLL::FontFace_c::containsGlyph ( char32_t  ch)

check if a given character is available within this font

Parameters
chthe unicode character to check
Returns
true, when the character is available within the font, false otherwise
int32_t STLL::FontFace_c::getAscender ( void  ) const

Get the ascender of the font with multiplication factor of 64.

Returns
ascender of font
int32_t STLL::FontFace_c::getDescender ( void  ) const

Get the descender of the font with multiplication factor of 64.

Returns
descender of font
FT_FaceRec_* STLL::FontFace_c::getFace ( void  ) const
inline

Get the FreeType structure for this font.

This is required for example for harfbuzz. You normally don't need this when using STLL

uint32_t STLL::FontFace_c::getHeight ( void  ) const

Get the height of the font with multiplication factor of 64.

Returns
height of font
const internal::FontFileResource_c& STLL::FontFace_c::getResource ( void  ) const
inline

get the font resource that was used to create this font

uint32_t STLL::FontFace_c::getSize ( void  ) const
inline

get the size of the font

int32_t STLL::FontFace_c::getUnderlinePosition ( void  ) const

Get the underline position of the font with multiplication factor of 64.

Returns
centre position of the underline relative to baseline
int32_t STLL::FontFace_c::getUnderlineThickness ( void  ) const

Get the underline thickness of the font with multiplication factor of 64.

Returns
thickness around the underline position
GlyphSlot_c STLL::FontFace_c::renderGlyph ( glyphIndex_t  glyphIndex,
SubPixelArrangement  sp 
)

render a glyph of this font

Parameters
glyphIndexthe index of the glyph to render (take it from the layout)
spthe requested sub-pixel arrangement to apply to the rendering
Returns
a pointer to the FreeType glyph slot record, see FreeType documentation
Note
glyphs are always rendered unhinted 8-bit FreeType bitmaps

The documentation for this class was generated from the following file: