mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0029122: Visualization - improve Font_BRepFont to handle one-line-fonts
Font_SystemFont - added a new property SingleStrokeFont(). Font_BRepFont::renderGlyph() has been extended to not close contours when flag SingleStrokeFont() has been set.
This commit is contained in:
@@ -33,6 +33,7 @@ Font_FTFont::Font_FTFont (const Handle(Font_FTLibrary)& theFTLib)
|
||||
myFTFace (NULL),
|
||||
myPointSize (0U),
|
||||
myLoadFlags (FT_LOAD_NO_HINTING | FT_LOAD_TARGET_NORMAL),
|
||||
myIsSingleLine(false),
|
||||
myKernAdvance(new FT_Vector()),
|
||||
myUChar (0U)
|
||||
{
|
||||
@@ -118,9 +119,12 @@ bool Font_FTFont::Init (const NCollection_String& theFontName,
|
||||
{
|
||||
Handle(Font_FontMgr) aFontMgr = Font_FontMgr::GetInstance();
|
||||
const Handle(TCollection_HAsciiString) aFontName = new TCollection_HAsciiString (theFontName.ToCString());
|
||||
Handle(Font_SystemFont) aRequestedFont = aFontMgr->FindFont (aFontName, theFontAspect, thePointSize);
|
||||
return !aRequestedFont.IsNull()
|
||||
&& Font_FTFont::Init (aRequestedFont->FontPath()->ToCString(), thePointSize, theResolution);
|
||||
if (Handle(Font_SystemFont) aRequestedFont = aFontMgr->FindFont (aFontName, theFontAspect, thePointSize))
|
||||
{
|
||||
myIsSingleLine = aRequestedFont->IsSingleStrokeFont();
|
||||
return Font_FTFont::Init (aRequestedFont->FontPath()->ToCString(), thePointSize, theResolution);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
Reference in New Issue
Block a user