Open CASCADE Technology
6.9.1
|
Wrapper over FreeType font. Notice that this class uses internal buffers for loaded glyphs and it is absolutely UNSAFE to load/read glyph from concurrent threads! More...
#include <Font_FTFont.hxx>
Data Structures | |
struct | Rect |
Auxiliary structure - rectangle definition. More... | |
Public Member Functions | |
Font_FTFont (const Handle< Font_FTLibrary > &theFTLib=NULL) | |
Create uninitialized instance. More... | |
virtual | ~Font_FTFont () |
Destructor. More... | |
bool | IsValid () const |
const Image_PixMap & | GlyphImage () const |
bool | Init (const NCollection_String &theFontPath, const unsigned int thePointSize, const unsigned int theResolution=72) |
Initialize the font. More... | |
bool | Init (const NCollection_String &theFontName, const Font_FontAspect theFontAspect, const unsigned int thePointSize, const unsigned int theResolution) |
Initialize the font. More... | |
virtual void | Release () |
Release currently loaded font. More... | |
bool | RenderGlyph (const Standard_Utf32Char theChar) |
Render specified glyph into internal buffer (bitmap). More... | |
unsigned int | GlyphMaxSizeX () const |
unsigned int | GlyphMaxSizeY () const |
float | Ascender () const |
float | Descender () const |
float | LineSpacing () const |
unsigned int | PointSize () const |
Configured point size. More... | |
float | AdvanceX (const Standard_Utf32Char theUCharNext) |
Compute advance to the next character with kerning applied when applicable. Assuming text rendered horizontally. More... | |
float | AdvanceX (const Standard_Utf32Char theUChar, const Standard_Utf32Char theUCharNext) |
Compute advance to the next character with kerning applied when applicable. Assuming text rendered horizontally. More... | |
float | AdvanceY (const Standard_Utf32Char theUCharNext) |
Compute advance to the next character with kerning applied when applicable. Assuming text rendered vertically. More... | |
float | AdvanceY (const Standard_Utf32Char theUChar, const Standard_Utf32Char theUCharNext) |
Compute advance to the next character with kerning applied when applicable. Assuming text rendered vertically. More... | |
Standard_Integer | GlyphsNumber () const |
void | GlyphRect (Font_FTFont::Rect &theRect) const |
Retrieve glyph bitmap rectangle. More... | |
Public Member Functions inherited from Standard_Transient | |
Standard_Transient () | |
Empty constructor. More... | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. More... | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. More... | |
virtual | ~Standard_Transient () |
Destructor must be virtual. More... | |
virtual void | Delete () const |
Memory deallocator for transient classes. More... | |
virtual const Handle_Standard_Type & | DynamicType () const |
Returns a type information object about this object. More... | |
Standard_Boolean | IsInstance (const Handle_Standard_Type &theType) const |
Returns a true value if this is an instance of Type. More... | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. More... | |
Standard_Boolean | IsKind (const Handle_Standard_Type &theType) const |
Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
virtual Handle_Standard_Transient | This () const |
Returns a Handle which references this object. Must never be called to objects created in stack. More... | |
Standard_Integer | GetRefCount () const |
Get the reference counter of this object. More... | |
Protected Member Functions | |
template<typename theInput_t > | |
FT_F26Dot6 | toFTPoints (const theInput_t thePointSize) const |
Convert value to 26.6 fixed-point format for FT library API. More... | |
template<typename theReturn_t , typename theFTUnits_t > | |
theReturn_t | fromFTPoints (const theFTUnits_t theFTUnits) const |
Convert value from 26.6 fixed-point format for FT library API. More... | |
bool | loadGlyph (const Standard_Utf32Char theUChar) |
Load glyph without rendering it. More... | |
Protected Attributes | |
Handle< Font_FTLibrary > | myFTLib |
handle to the FT library object More... | |
FT_Face | myFTFace |
FT face object. More... | |
NCollection_String | myFontPath |
font path More... | |
unsigned int | myPointSize |
point size set by FT_Set_Char_Size More... | |
FT_Int32 | myLoadFlags |
default load flags More... | |
Image_PixMap | myGlyphImg |
cached glyph plane More... | |
FT_Vector | myKernAdvance |
buffer variable More... | |
Standard_Utf32Char | myUChar |
currently loaded unicode character More... | |
Wrapper over FreeType font. Notice that this class uses internal buffers for loaded glyphs and it is absolutely UNSAFE to load/read glyph from concurrent threads!
Font_FTFont::Font_FTFont | ( | const Handle< Font_FTLibrary > & | theFTLib = NULL | ) |
Create uninitialized instance.
|
virtual |
Destructor.
float Font_FTFont::AdvanceX | ( | const Standard_Utf32Char | theUCharNext | ) |
Compute advance to the next character with kerning applied when applicable. Assuming text rendered horizontally.
float Font_FTFont::AdvanceX | ( | const Standard_Utf32Char | theUChar, |
const Standard_Utf32Char | theUCharNext | ||
) |
Compute advance to the next character with kerning applied when applicable. Assuming text rendered horizontally.
float Font_FTFont::AdvanceY | ( | const Standard_Utf32Char | theUCharNext | ) |
Compute advance to the next character with kerning applied when applicable. Assuming text rendered vertically.
float Font_FTFont::AdvanceY | ( | const Standard_Utf32Char | theUChar, |
const Standard_Utf32Char | theUCharNext | ||
) |
Compute advance to the next character with kerning applied when applicable. Assuming text rendered vertically.
|
inline |
|
inline |
|
inlineprotected |
Convert value from 26.6 fixed-point format for FT library API.
|
inline |
unsigned int Font_FTFont::GlyphMaxSizeX | ( | ) | const |
unsigned int Font_FTFont::GlyphMaxSizeY | ( | ) | const |
|
inline |
Retrieve glyph bitmap rectangle.
|
inline |
bool Font_FTFont::Init | ( | const NCollection_String & | theFontPath, |
const unsigned int | thePointSize, | ||
const unsigned int | theResolution = 72 |
||
) |
Initialize the font.
theFontPath | path to the font |
thePointSize | the face size in points (1/72 inch) |
theResolution | the resolution of the target device in dpi |
bool Font_FTFont::Init | ( | const NCollection_String & | theFontName, |
const Font_FontAspect | theFontAspect, | ||
const unsigned int | thePointSize, | ||
const unsigned int | theResolution | ||
) |
Initialize the font.
theFontName | the font name |
theFontAspect | the font style |
thePointSize | the face size in points (1/72 inch) |
theResolution | the resolution of the target device in dpi |
|
inline |
|
inline |
|
protected |
Load glyph without rendering it.
|
inline |
Configured point size.
|
virtual |
Release currently loaded font.
Reimplemented in Font_BRepFont.
bool Font_FTFont::RenderGlyph | ( | const Standard_Utf32Char | theChar | ) |
Render specified glyph into internal buffer (bitmap).
|
inlineprotected |
Convert value to 26.6 fixed-point format for FT library API.
|
protected |
font path
|
protected |
FT face object.
|
protected |
handle to the FT library object
|
protected |
cached glyph plane
|
protected |
buffer variable
|
protected |
default load flags
|
protected |
point size set by FT_Set_Char_Size
|
protected |
currently loaded unicode character