1
0
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:
kgv
2017-09-19 16:53:39 +03:00
committed by bugmaster
parent 1a6726dabb
commit e4f0cc46a0
8 changed files with 254 additions and 199 deletions

View File

@@ -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;
}
// =======================================================================