View Issue Details

IDProjectCategoryView StatusLast Update
0030782Open CASCADEOCCT:Visualizationpublic2020-08-31 13:01
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Target Version7.4.0Fixed in Version7.4.0 
Summary0030782: Visualization, Font_FTFont - use predefined fallback fonts for extended Unicode subsets
DescriptionCommon fonts usually cover only Western subset of Unicode symbols, while characters for Chinese, Korean, Japanese languages are provided by dedicated font families (in turn, not supporting Western languages well).

In most cases, systems/applications implicitly load fallback fonts, when requested font does not support such symbols. This looks confusing (user has been fooled about font selection), but makes symbols readable.

It is suggested implementing the similar approach within Font_FTFont for a limited subset of known font families, enabled by default.
Steps To Reproduce
pload MODELING VISUALIZATION

dtracelevel trace
vfont -verbose 1
vclear
vinit View1
vaxo
vpoint p0 0 0 0

pload MODELING VISUALIZATION
dtracelevel trace
vfont -verbose 1
vclear
vinit View1
vtop
vpoint p00  0  0 0
vpoint p01  0 10 0
vpoint p11 10 10 0
vpoint p10 10  0 0
vfit
vzoom 0.8
vdrawtext t0 "한국어 (Korean) Čeština" -pos  0  0 0 -halign left  -font korean
vdrawtext t1 "한국어 (Korean) Čeština" -pos 10  1 0 -halign right -font sans
vdrawtext t2 "简体中文 (Chinese)"    -pos  0  2 0 -halign left  -font cjk
vdrawtext t3 "简体中文 (Chinese)"    -pos 10  3 0 -halign right -font sans
vdrawtext t4 "あ (Japanese)"         -pos  0  4 0 -halign left  -font cjk
vdrawtext t5 "あ (Japanese)"         -pos 10  5 0 -halign right -font sans
TagsNo tags attached.
Test case numberNot required

Attached Files

  • fonts_KO.png (8,707 bytes)
  • fonts_OK.png (9,917 bytes)

Relationships

related to 0030439 closedbugmaster Open CASCADE Visualization - extend fonts search within Font_FontMgr::FindFont() on Linux 
parent of 0031720 closedbugmaster Community Visualization, Font_FontMgr - register one more CJK fallback font available on newer Android devices 
parent of 0031728 closedbugmaster Community Visualization, Font_FontMgr - provide function to register fallback fonts in application level 
related to 0030946 closedabv Open CASCADE Visualization - Image_AlienPixMap ignores 1-bit pixelformat when using FreeImage 
related to 0031719 closedbugmaster Community no default Chinese Unicode support 

Activities

git

2019-06-17 08:07

administrator   ~0085077

Branch CR30782 has been created by kgv.

SHA-1: c4093fcfeaf05d244abe59baab849d3b0c3cb0c8


Detailed log of new commits:

Author: kgv
Date: Sun Jun 16 13:09:49 2019 +0300

    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".

kgv

2019-06-17 08:31

developer  

fonts_KO.png (8,707 bytes)

kgv

2019-06-17 08:33

developer  

fonts_OK.png (9,917 bytes)

git

2019-06-17 08:35

administrator   ~0085079

Branch CR30782 has been updated forcibly by kgv.

SHA-1: 45a549b8519128e227a2da8e7d47f1e2b2fb71f0

kgv

2019-06-17 10:49

developer   ~0085083

Patch is ready for review.

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR30782-master-KGV

git

2019-06-17 10:52

administrator   ~0085084

Branch CR30782 has been updated forcibly by kgv.

SHA-1: 8fb843f1065a67982ca1cfa01df00117556b1116

git

2019-06-17 14:35

administrator   ~0085091

Branch CR30782 has been updated forcibly by kgv.

SHA-1: 3759d86d1e45d3b303077fea6a343b18a31a7572

git

2019-06-17 19:28

administrator   ~0085099

Branch CR30782 has been updated by kgv.

SHA-1: 9980621e365439d4a3e2eb229cfb074a98ee7b0a


Detailed log of new commits:

Author: kgv
Date: Mon Jun 17 19:28:03 2019 +0300

    AIS::InitFaceLength() - fixed usage of uninitialized result.

git

2019-06-17 22:53

administrator   ~0085103

Branch CR30782 has been updated forcibly by kgv.

SHA-1: 534c822e324a2e86aaf60156576166145a53acea

osa

2019-06-18 15:55

developer   ~0085120

Reviewed without remarks

bugmaster

2019-06-19 19:41

administrator   ~0085144

Combination -
OCCT branch : CR30782
master SHA - 9980621e365439d4a3e2eb229cfb074a98ee7b0a
d67d4b811012eef8913d3c535c29654d0acf3c4c
Products branch : master SHA - c08b242c9da615bfdf83ca463321740d4cc22898
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16222.920000000222 / 16165.540000000055 [+0.35%]
Products
Total CPU difference: 10477.300000000025 / 10470.440000000042 [+0.07%]
Windows-64-VC14:
OCCT
Total CPU difference: 17643.40625 / 17617.546875 [+0.15%]
Products
Total CPU difference: 12080.15625 / 12111.125 [-0.26%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2019-06-22 16:22

administrator   ~0085221

Branch CR30782 has been deleted by inv.

SHA-1: 534c822e324a2e86aaf60156576166145a53acea

Related Changesets

occt: master 912761ea

2019-06-16 10:09:49

kgv


Committer: bugmaster Details Diff
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.
Affected Issues
0030782
mod - src/AIS/AIS.cxx Diff File
mod - src/DrawResources/TestCommands.tcl Diff File
mod - src/Font/FILES Diff File
mod - src/Font/Font_BRepFont.cxx Diff File
mod - src/Font/Font_FontMgr.cxx Diff File
mod - src/Font/Font_FontMgr.hxx Diff File
mod - src/Font/Font_FTFont.cxx Diff File
mod - src/Font/Font_FTFont.hxx Diff File
mod - src/Font/Font_NameOfFont.hxx Diff File
add - src/Font/Font_UnicodeSubset.hxx Diff File
mod - src/OpenGl/OpenGl_Font.cxx Diff File
mod - src/OpenGl/OpenGl_Font.hxx Diff File
mod - src/ViewerTest/ViewerTest_ObjectCommands.cxx Diff File
add - tests/3rdparty/fonts/C2 Diff File

Issue History

Date Modified Username Field Change
2019-06-17 08:00 kgv New Issue
2019-06-17 08:00 kgv Assigned To => kgv
2019-06-17 08:01 kgv Summary Visualization, Font_FTFont - try using predefined fallback fonts for extended Unicode subsets => Visualization, Font_FTFont - use predefined fallback fonts for extended Unicode subsets
2019-06-17 08:07 git Note Added: 0085077
2019-06-17 08:29 kgv Steps to Reproduce Updated
2019-06-17 08:31 kgv File Added: fonts_KO.png
2019-06-17 08:33 kgv File Added: fonts_OK.png
2019-06-17 08:35 git Note Added: 0085079
2019-06-17 10:49 kgv Note Added: 0085083
2019-06-17 10:49 kgv Assigned To kgv => san
2019-06-17 10:49 kgv Status new => resolved
2019-06-17 10:52 git Note Added: 0085084
2019-06-17 14:35 git Note Added: 0085091
2019-06-17 14:46 kgv Relationship added related to 0030439
2019-06-17 19:28 git Note Added: 0085099
2019-06-17 22:53 git Note Added: 0085103
2019-06-18 13:47 kgv Assigned To san => osa
2019-06-18 15:55 osa Note Added: 0085120
2019-06-18 15:55 osa Assigned To osa => bugmaster
2019-06-18 15:55 osa Status resolved => reviewed
2019-06-19 19:40 bugmaster Test case number => Not required
2019-06-19 19:41 bugmaster Note Added: 0085144
2019-06-19 19:41 bugmaster Status reviewed => tested
2019-06-22 16:18 bugmaster Changeset attached => occt master 912761ea
2019-06-22 16:18 bugmaster Status tested => verified
2019-06-22 16:18 bugmaster Resolution open => fixed
2019-06-22 16:22 git Note Added: 0085221
2019-09-05 14:12 kgv Relationship added related to 0030946
2020-08-19 19:01 kgv Relationship added related to 0031719
2020-08-21 14:14 kgv Relationship added parent of 0031720
2020-08-31 13:01 kgv Relationship added parent of 0031728