This tool provides basic services for rendering of vectorized text glyphs as BRep shapes. Single instance initialize single font for sequential glyphs rendering with implicit caching of already rendered glyphs. Thus position of each glyph in the text is specified by shape location.
More...
|
| Font_BRepFont () |
| Empty constructor. More...
|
|
| Font_BRepFont (const NCollection_String &theFontPath, const Standard_Real theSize) |
| Constructor with initialization. More...
|
|
| Font_BRepFont (const NCollection_String &theFontName, const Font_FontAspect theFontAspect, const Standard_Real theSize, const Font_StrictLevel theStrictLevel=Font_StrictLevel_Any) |
| Constructor with initialization. More...
|
|
virtual void | Release () override |
| Release currently loaded font. More...
|
|
bool | Init (const NCollection_String &theFontPath, const Standard_Real theSize) |
| Initialize the font. More...
|
|
bool | FindAndInit (const TCollection_AsciiString &theFontName, const Font_FontAspect theFontAspect, const Standard_Real theSize, const Font_StrictLevel theStrictLevel=Font_StrictLevel_Any) |
| Find (using Font_FontMgr) and initialize the font from the given name. Please take into account that size is specified NOT in typography points (pt.). If you need to specify size in points, value should be converted. Formula for pt. -> m conversion: aSizeMeters = 0.0254 * theSizePt / 72.0. More...
|
|
TopoDS_Shape | RenderGlyph (const Standard_Utf32Char &theChar) |
| Render single glyph as TopoDS_Shape. More...
|
|
void | SetCompositeCurveMode (const Standard_Boolean theToConcatenate) |
| Setup glyph geometry construction mode. By default algorithm creates independent TopoDS_Edge for each original curve in the glyph (line segment or Bezie curve). Algorithm might optionally create composite BSpline curve for each contour which reduces memory footprint but limits curve class to C0. Notice that altering this flag clears currently accumulated cache! More...
|
|
void | SetWidthScaling (const float theScaleFactor) |
| Setup glyph scaling along X-axis. By default glyphs are not scaled (scaling factor = 1.0) More...
|
|
Standard_Real | Ascender () const |
|
Standard_Real | Descender () const |
|
Standard_Real | LineSpacing () const |
|
Standard_Real | PointSize () const |
| Configured point size. More...
|
|
Standard_Real | AdvanceX (const Standard_Utf32Char theUCharNext) |
| Compute advance to the next character with kerning applied when applicable. Assuming text rendered horizontally. More...
|
|
Standard_Real | 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...
|
|
Standard_Real | AdvanceY (const Standard_Utf32Char theUCharNext) |
| Compute advance to the next character with kerning applied when applicable. Assuming text rendered vertically. More...
|
|
Standard_Real | 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_Real | Scale () const |
| Returns scaling factor for current font size. More...
|
|
Standard_Mutex & | Mutex () |
| Returns mutex. More...
|
|
bool | Init (const NCollection_String &theFontName, const Font_FontAspect theFontAspect, const Standard_Real theSize) |
| Find (using Font_FontMgr) and initialize the font from the given name. Alias for FindAndInit() for backward compatibility. More...
|
|
|
Standard_Boolean | renderGlyph (const Standard_Utf32Char theChar, TopoDS_Shape &theShape) |
| Render single glyph as TopoDS_Shape. This method does not lock the mutex. More...
|
|
template<typename theInput_t > |
int32_t | 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...
|
|
bool | getKerning (FT_Vector &theKern, Standard_Utf32Char theUCharCurr, Standard_Utf32Char theUCharNext) const |
| Wrapper for FT_Get_Kerning - retrieve kerning values. More...
|
|
bool | findAndInitFallback (Font_UnicodeSubset theSubset) |
| Initialize fallback font. More...
|
|
| Font_FTFont (const Handle< Font_FTLibrary > &theFTLib=Handle< Font_FTLibrary >()) |
| Create uninitialized instance. More...
|
|
virtual | ~Font_FTFont () |
| Destructor. More...
|
|
bool | IsValid () const |
|
const Image_PixMap & | GlyphImage () const |
|
bool | Init (const TCollection_AsciiString &theFontPath, const Font_FTFontParams &theParams) |
| Initialize the font from the given file path. More...
|
|
bool | Init (const Handle< NCollection_Buffer > &theData, const TCollection_AsciiString &theFileName, const Font_FTFontParams &theParams) |
| Initialize the font from the given file path or memory buffer. More...
|
|
bool | FindAndInit (const TCollection_AsciiString &theFontName, Font_FontAspect theFontAspect, const Font_FTFontParams &theParams, Font_StrictLevel theStrictLevel=Font_StrictLevel_Any) |
| Find (using Font_FontMgr) and initialize the font from the given name. More...
|
|
Standard_Boolean | ToUseUnicodeSubsetFallback () const |
| Return flag to use fallback fonts in case if used font does not include symbols from specific Unicode subset; TRUE by default. More...
|
|
void | SetUseUnicodeSubsetFallback (Standard_Boolean theToFallback) |
| Set if fallback fonts should be used in case if used font does not include symbols from specific Unicode subset. More...
|
|
bool | IsSingleStrokeFont () const |
| Return TRUE if this is single-stroke (one-line) font, FALSE by default. Such fonts define single-line glyphs instead of closed contours, so that they are rendered incorrectly by normal software. More...
|
|
void | SetSingleStrokeFont (bool theIsSingleLine) |
| Set if this font should be rendered as single-stroke (one-line). More...
|
|
bool | ToSynthesizeItalic () const |
| Return TRUE if italic style should be synthesized; FALSE by default. More...
|
|
bool | RenderGlyph (const Standard_Utf32Char theChar) |
| Render specified glyph into internal buffer (bitmap). More...
|
|
unsigned int | GlyphMaxSizeX (bool theToIncludeFallback=false) const |
|
unsigned int | GlyphMaxSizeY (bool theToIncludeFallback=false) const |
|
float | Ascender () const |
|
float | Descender () const |
|
float | LineSpacing () const |
|
unsigned int | PointSize () const |
| Configured point size. More...
|
|
void | SetWidthScaling (const float theScaleFactor) |
| Setup glyph scaling along X-axis. By default glyphs are not scaled (scaling factor = 1.0) More...
|
|
bool | HasSymbol (Standard_Utf32Char theUChar) const |
| Return TRUE if font contains specified symbol (excluding fallback list). More...
|
|
float | AdvanceX (Standard_Utf32Char theUCharNext) const |
| Compute horizontal advance to the next character with kerning applied when applicable. Assuming text rendered horizontally. More...
|
|
float | AdvanceX (Standard_Utf32Char theUChar, Standard_Utf32Char theUCharNext) |
| Compute horizontal advance to the next character with kerning applied when applicable. Assuming text rendered horizontally. More...
|
|
float | AdvanceY (Standard_Utf32Char theUCharNext) const |
| Compute vertical advance to the next character with kerning applied when applicable. Assuming text rendered vertically. More...
|
|
float | AdvanceY (Standard_Utf32Char theUChar, Standard_Utf32Char theUCharNext) |
| Compute vertical advance to the next character with kerning applied when applicable. Assuming text rendered vertically. More...
|
|
Standard_Integer | GlyphsNumber (bool theToIncludeFallback=false) const |
| Return glyphs number in this font. More...
|
|
void | GlyphRect (Font_Rect &theRect) const |
| Retrieve glyph bitmap rectangle. More...
|
|
Font_Rect | BoundingBox (const NCollection_String &theString, const Graphic3d_HorizontalTextAlignment theAlignX, const Graphic3d_VerticalTextAlignment theAlignY) |
| Computes bounding box of the given text using plain-text formatter (Font_TextFormatter). Note that bounding box takes into account the text alignment options. Its corners are relative to the text alignment anchor point, their coordinates can be negative. More...
|
|
bool | Init (const NCollection_String &theFontPath, unsigned int thePointSize, unsigned int theResolution) |
| Initialize the font. More...
|
|
bool | Init (const NCollection_String &theFontName, Font_FontAspect theFontAspect, unsigned int thePointSize, unsigned int theResolution) |
| Initialize the font. More...
|
|
Protected 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 opencascade::handle< Standard_Type > & | DynamicType () const |
| Returns a type descriptor about this object. More...
|
|
Standard_Boolean | IsInstance (const opencascade::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 opencascade::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...
|
|
Standard_Transient * | This () const |
| Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
|
|
Standard_Integer | GetRefCount () const |
| Get the reference counter of this object. More...
|
|
void | IncrementRefCounter () const |
| Increments the reference counter of this object. More...
|
|
Standard_Integer | DecrementRefCounter () const |
| Decrements the reference counter of this object; returns the decremented value. More...
|
|
This tool provides basic services for rendering of vectorized text glyphs as BRep shapes. Single instance initialize single font for sequential glyphs rendering with implicit caching of already rendered glyphs. Thus position of each glyph in the text is specified by shape location.
Please notice that this implementation uses mutex for thread-safety access, thus may lead to performance penalties in case of concurrent access. Although caching should eliminate this issue after rendering of sufficient number of glyphs.