mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0029117: Adding translation of Multileader entity
Scaling of width of glyphs is added om Font_FTFont class. Font "SimSan" is specified as fallback alias for font "NSimSan" (contains Chinese hieroglyphs).
This commit is contained in:
@@ -29,13 +29,14 @@ IMPLEMENT_STANDARD_RTTIEXT(Font_FTFont,Standard_Transient)
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Font_FTFont::Font_FTFont (const Handle(Font_FTLibrary)& theFTLib)
|
||||
: myFTLib (theFTLib),
|
||||
myFTFace (NULL),
|
||||
myPointSize (0U),
|
||||
myLoadFlags (FT_LOAD_NO_HINTING | FT_LOAD_TARGET_NORMAL),
|
||||
: myFTLib (theFTLib),
|
||||
myFTFace (NULL),
|
||||
myPointSize (0U),
|
||||
myWidthScaling(1.0),
|
||||
myLoadFlags (FT_LOAD_NO_HINTING | FT_LOAD_TARGET_NORMAL),
|
||||
myIsSingleLine(false),
|
||||
myKernAdvance(new FT_Vector()),
|
||||
myUChar (0U)
|
||||
myKernAdvance (new FT_Vector()),
|
||||
myUChar (0U)
|
||||
{
|
||||
if (myFTLib.IsNull())
|
||||
{
|
||||
@@ -270,9 +271,9 @@ float Font_FTFont::AdvanceX (const Standard_Utf32Char theUCharNext)
|
||||
if (FT_HAS_KERNING (myFTFace) == 0 || theUCharNext == 0
|
||||
|| FT_Get_Kerning (myFTFace, myUChar, theUCharNext, FT_KERNING_UNFITTED, myKernAdvance) != 0)
|
||||
{
|
||||
return fromFTPoints<float> (myFTFace->glyph->advance.x);
|
||||
return myWidthScaling * fromFTPoints<float> (myFTFace->glyph->advance.x);
|
||||
}
|
||||
return fromFTPoints<float> (myKernAdvance->x + myFTFace->glyph->advance.x);
|
||||
return myWidthScaling * fromFTPoints<float> (myKernAdvance->x + myFTFace->glyph->advance.x);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
Reference in New Issue
Block a user