Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes | Friends

vl::Font Class Reference

A font to be used with a Text renderable. More...

#include <Font.hpp>

Inheritance diagram for vl::Font:
vl::Object

List of all members.

Public Member Functions

 ~Font ()
 Destructor.
bool operator< (const Font &other) const
 Less-than operator.
const StringfilePath () const
 The font's file path.
void loadFont (const String &path)
 Loads a font using fileSystem()locateFile().
int size () const
 The size of the font.
void setSize (int size)
 The size of the font.
Glyphglyph (int character)
 Returns (and eventually creates) the Glyph* associated to the given character.
void setSmooth (bool smooth)
 Whether the font rendering should use linear filtering or not.
bool smooth () const
 Whether the font rendering should use linear filtering or not.
void releaseFreeTypeData ()
 Releases the FreeType's FT_Face used by a Font.
void setFontManager (FontManager *fm)
 The FontManager associated to this Font used to acquire/release FreeType resources.
const FontManagerfontManager () const
 The FontManager associated to this Font used to acquire/release FreeType resources.
FontManagerfontManager ()
 The FontManager associated to this Font used to acquire/release FreeType resources.
bool freeTypeLoadForceAutoHint () const
 Whether FT_Load_Char() should be called with FT_LOAD_FORCE_AUTOHINT (default) or FT_LOAD_DEFAULT.
void setFreeTypLoadForceAutoHint (bool enable)
 Whether FT_Load_Char() should be called with FT_LOAD_FORCE_AUTOHINT (default) or FT_LOAD_DEFAULT.

Protected Attributes

FontManagermFontManager
String mFilePath
std::map< int, ref< Glyph > > mGlyphMap
FT_Face mFT_Face
std::vector< char > mMemoryFile
int mSize
float mHeight
bool mSmooth
bool mFreeTypeLoadForceAutoHint

Friends

class CoreText
class Text
class FontManager

Detailed Description

A font to be used with a Text renderable.

Definition at line 127 of file Font.hpp.


Constructor & Destructor Documentation

vl::Font::~Font (  )

Destructor.


Member Function Documentation

bool vl::Font::operator< ( const Font other ) const [inline]

Less-than operator.

Definition at line 152 of file Font.hpp.

References filePath(), and size().

const String& vl::Font::filePath (  ) const [inline]

The font's file path.

Definition at line 161 of file Font.hpp.

Referenced by operator<(), and vl::VectorGraphics::setFont().

void vl::Font::loadFont ( const String path )

Loads a font using fileSystem()locateFile().

int vl::Font::size (  ) const [inline]

The size of the font.

Definition at line 167 of file Font.hpp.

Referenced by operator<(), and vl::VectorGraphics::setFont().

void vl::Font::setSize ( int  size )

The size of the font.

Glyph* vl::Font::glyph ( int  character )

Returns (and eventually creates) the Glyph* associated to the given character.

void vl::Font::setSmooth ( bool  smooth )

Whether the font rendering should use linear filtering or not.

bool vl::Font::smooth (  ) const [inline]

Whether the font rendering should use linear filtering or not.

Definition at line 179 of file Font.hpp.

Referenced by vl::VectorGraphics::setFont().

void vl::Font::releaseFreeTypeData (  )

Releases the FreeType's FT_Face used by a Font.

void vl::Font::setFontManager ( FontManager fm ) [inline]

The FontManager associated to this Font used to acquire/release FreeType resources.

Definition at line 185 of file Font.hpp.

const FontManager* vl::Font::fontManager (  ) const [inline]

The FontManager associated to this Font used to acquire/release FreeType resources.

Definition at line 188 of file Font.hpp.

FontManager* vl::Font::fontManager (  ) [inline]

The FontManager associated to this Font used to acquire/release FreeType resources.

Definition at line 191 of file Font.hpp.

bool vl::Font::freeTypeLoadForceAutoHint (  ) const [inline]

Whether FT_Load_Char() should be called with FT_LOAD_FORCE_AUTOHINT (default) or FT_LOAD_DEFAULT.

There isn't a "best" option for all the fonts, the results can be better or worse depending on the particular font loaded.

Definition at line 195 of file Font.hpp.

void vl::Font::setFreeTypLoadForceAutoHint ( bool  enable ) [inline]

Whether FT_Load_Char() should be called with FT_LOAD_FORCE_AUTOHINT (default) or FT_LOAD_DEFAULT.

There isn't a "best" option for all the fonts, the results can be better or worse depending on the particular font loaded.

Definition at line 199 of file Font.hpp.


Friends And Related Function Documentation

friend class CoreText [friend]

Definition at line 131 of file Font.hpp.

friend class Text [friend]

Definition at line 132 of file Font.hpp.

friend class FontManager [friend]

Definition at line 133 of file Font.hpp.


Member Data Documentation

Definition at line 202 of file Font.hpp.

Definition at line 203 of file Font.hpp.

std::map< int, ref<Glyph> > vl::Font::mGlyphMap [protected]

Definition at line 204 of file Font.hpp.

Definition at line 205 of file Font.hpp.

std::vector<char> vl::Font::mMemoryFile [protected]

Definition at line 206 of file Font.hpp.

int vl::Font::mSize [protected]

Definition at line 207 of file Font.hpp.

float vl::Font::mHeight [protected]

Definition at line 208 of file Font.hpp.

bool vl::Font::mSmooth [protected]

Definition at line 209 of file Font.hpp.

Definition at line 210 of file Font.hpp.


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:10.
Permission is granted to use this page to write and publish articles regarding Visualization Library.