1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030782: Visualization, Font_FTFont - use predefined fallback fonts for extended Unicode subsets

Font_FTFont now uses fallback fonts for characters from unsupported Unicode subsets,
managed by Font_FTFont::ToUseUnicodeSubsetFallback()
and Font_FontMgr::ToUseUnicodeSubsetFallback() option, enabled by default.
The fallback list includes common font families for Chinese, Korean and Japanese languages.

Font_FTFont::RenderGlyph() now supports FT_PIXEL_MODE_MONO input format used by some CJK fonts.
OpenGl_Font::createTexture() now limits single texture size to circa 4096 glyphs.

test/testgrid now expects test scripts being in UTF-8 encoding in sync with "DRAWEXE -f script.tcl".

AIS::InitFaceLength() - fixed usage of uninitialized result.
This commit is contained in:
kgv
2019-06-16 13:09:49 +03:00
committed by bugmaster
parent 1bb67d3844
commit 912761ea17
14 changed files with 458 additions and 101 deletions

View File

@@ -5598,6 +5598,18 @@ static int VFont (Draw_Interpretor& theDI,
}
aMgr->SetTraceAliases (toEnable);
}
else if (anArgCase == "-unicodefallback"
|| anArgCase == "-fallback"
|| anArgCase == "-touseunicodesubsetfallback")
{
bool toEnable = true;
if (anArgIter + 1 < theArgNb
&& ViewerTest::ParseOnOff (theArgVec[anArgIter + 1], toEnable))
{
++anArgIter;
}
Font_FontMgr::ToUseUnicodeSubsetFallback() = toEnable;
}
else
{
std::cerr << "Warning! Unknown argument '" << anArg << "'\n";
@@ -6541,7 +6553,8 @@ void ViewerTest::ObjectCommands(Draw_Interpretor& theCommands)
__FILE__, TextToBRep, group);
theCommands.Add ("vfont",
"vfont [-add pathToFont [fontName] [regular,bold,italic,boldItalic=undefined] [singleStroke]]"
"\n\t\t: [-strict {any|aliases|strict}] [-find fontName [regular,bold,italic,boldItalic=undefined]] [-verbose {on|off}]",
"\n\t\t: [-strict {any|aliases|strict}] [-find fontName [regular,bold,italic,boldItalic=undefined]] [-verbose {on|off}]"
"\n\t\t: [-unicodeFallback {on|off}]",
__FILE__, VFont, group);
theCommands.Add ("vvertexmode",