View Issue Details

IDProjectCategoryView StatusLast Update
0023415Open CASCADEOCCT:Foundation Classespublic2013-11-06 16:13
ReporteraplAssigned Todbv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version6.6.0Fixed in Version6.6.0 
Summary0023415: OSD_FontMgr can't idenify aspect for fonts with names dependant on system locale.
DescriptionOn Windows, to identify font aspect, OSD_FontMgr searches for "Italic", "Bold" substrings in font names defined in registry. However, there is a workaround implemented on the level of OpenGl_FontMgr to identify aspect for fonts which have names dependent on system locale. For such fonts, the aspect substrings can be "Italiqui", "Grass" and so on... The workaround requires freetype library that loads the font and returns the font's actual aspect.

It seems to be doubt implementing such workarounds everywhere to get actual aspect, because it's a duty of OSD_FontMgr to identify aspect correctly.
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0023466 closeddbv Open CASCADE Move OSD_FontMgr class outside TKernel 
related to 0023209 closeddbv Community Potentially unmatched XOpenDisplay() and XCloseDisplay() calls in some OCCT packages 
related to 0023049 closedbugmaster Open CASCADE Optimize packaging and dependencies of visualization libraries 

Activities

dbv

2012-10-15 17:23

developer   ~0021775

Last edited: 2012-10-15 17:24

Added function DetectFontsAspects to Font_FontMgr class. This function uses workaround from OpenGl_FontMgr with FreeType for detecting font aspect.

Fix has been pushed to the git branch CR23415 (branch was based on CR23466_1)

Dear Kirill,
Please review.

dbv

2012-10-18 18:50

developer   ~0021843

Fixed Unix part of Font_FontMgr::InitFontDataBase() method. Font name and font style now detected through the FreeType.

Fix has been pushed to the branch CR23415.

Please review.

kgv

2012-10-19 15:27

developer   ~0021854

Dear dbv, please consider the following remarks in sense of Font_FontMgr clean up.

> DEFINE_MAP( StringMap, NCollection_List, TCollection_AsciiString );
please eliminate usage of this ancient unreadable macro definition.

>const Standard_Integer font_service_conf_size = 3;
>static Standard_Character font_service_conf[font_service_conf_size][64] = { >{"/etc/X11/fs/config"},
>{"/usr/X11R6/lib/X11/fs/config"},
>{"/usr/X11/lib/X11/fs/config"}};
This will be more readable to use NULL-termination syntax instead of predefined number of elements in array like this:
>static const char* THE_ARRAY[] =
>{
> "Hello",
> "/usr/lib/fonts",
> "C:\\fonts placed here\\and",
> NULL
>};
>
>for (int anIter = 0;; ++anIter)
>{
> const char* anItem = THE_ARRAY[anIter];
> if (anItem == NULL)
> {
> break;
> }
>}

>OSD_Environment env("windir");
This is more reliable to use GetWindowsDirectory() instead

>if( RegEnumValue( fonts_hkey, id, buf_name, &size_name, NULL,
> &type, buf_data, &size_data) == ERROR_NO_MORE_ITEMS ) {
> break;
>}
>Handle(TCollection_HAsciiString) file_path = new TCollection_HAsciiString( (Standard_Character*)buf_data );
According to MSDN if the data has the REG_SZ, REG_MULTI_SZ or REG_EXPAND_SZ type, the string may not have been stored with the proper null-terminating characters. This is suggested to explicitly NULL-terminate string to ensure TCollection_HAsciiString doesn't create broken string.

>if( ( ( file_path->Search(".ttf") > 0 ) || ( file_path->Search(".TTF") > 0 ) ||
Please replace this painful code with retrieving file extension once and comparing it with supported list.
Notice that extension for compressed ".pcf.gz" fonts should be parsed correctly on Linux.

Font_FontMgr.cxx, 156-157
>#endif //WNT
>
>#ifndef WNT
Please replace with #else

dbv

2012-10-23 12:43

developer   ~0021896

Remarks have been fixed. Added recursive default font directories scanning.

Please review.

kgv

2012-10-24 12:39

developer   ~0021921

Patch is reviewed and remarks applied.
Please perform testing.

mkv

2012-10-30 15:02

tester   ~0022011

Dear BugMaster,
Branch CR23415 (and products from GIT master) was compiled on Linux and Windows platforms and tested.

Regression:
Not detected

Improvements (new behaviour)

chl 901 A5 A8 A9
chl 913 J5
chl 928 Q8 R4
chl 934 H0 R9 V3
chl 936 T5 W4 Z8
chl 941 A1 A2 A3 B1 B2 B3 B4 B5 B6

vpr - all test cases

Testing case:
Not needed

See results in /QADisk/occttests/results/KAS/dev/CR23415-master-products_26102012
See reference results in /QADisk/occttests/results/KAS/dev/CR-2012-10-12-IR-2012-10-12-products
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification

kgv

2012-10-30 18:47

developer   ~0022023

Issues with mapping to well-known fonts families should be corrected.

dbv

2012-11-16 15:04

developer   ~0022281

Fixed adding fonts folders recursively from configuration files.
Moved fonts aliases map from OpenGl_Display_1 to Font_FontMgr.
Moved fonts name definition from Graphic3d_NameOfFont.hxx to Font_NameOfFont.hxx.
Added new methods to Font_FontMgr: GetAvailableFontsNames, GetFont and FindFont.
Modified Font_SystemFont creation from XLFD. Added method IsEqual to Font_SystemFont.
Modified methods OpenGl_Display::FindFont, OpenGl_FontMgr::request_font in accordance to the new functionality of the Font_FontMgr.
OpenGl_FontMgr now stores only generated fonts instead of duplication of available fonts list.
Removed method OpenGl_FontMgr::requestFontList. Its function now performs Font_FontMgr::GetAvailableFontsNames.

Fixes have been pushed to the git branch CR23415_1

Please review.

san

2012-11-20 21:03

developer   ~0022320

Branch CR23415_1 reviewed with the following remarks:

src/Font/Font_FontMgr.cdl - after having a look at this class' implementation, which is not at all trivial, an immediate conclusion is that it lacks documentation describing the algorithm of its work on different platforms (Windows, Linux, Apple). This is essential because this class is supposed to be a part of public API.

src/Graphic3d/Graphic3d_AspectText3d.cdl - the meaning of OpenGl_FontName token repeated several times in CDL documentation is not clear, e.g.:
or Font described in OpenGl_FontName(example Font_NOF_ASCII_MONO)




dbv

2012-11-21 16:24

developer   ~0022333

Remarks fix has been pushed to the git branch CR23415_1

Please review.

san

2012-11-28 12:24

developer   ~0022399

Branch CR23415_1 reviewed without remarks, ready for testing.

mkv

2012-11-29 17:15

tester   ~0022455

Dear BugMaster,
Branch CR23415_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested.

Regression:
chl 928 P4

New behaviour:
chl 936 Z8

Testing case:
Not needed

See results in /QADisk/occttests/results/KAS/dev/CR23415-1-master-products_28102012
See reference results in /QADisk/occttests/results/KAS/dev/CR-2012-10-12-IR-2012-10-12-products
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification

dbv

2012-11-30 16:04

developer   ~0022489

Regression fix pushed to the git branch CR23415_1

Please review.

kgv

2012-12-02 17:19

developer   ~0022498

Please test updated patch.

mkv

2012-12-04 19:15

tester   ~0022550

Dear BugMaster,
Branch CR23415_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested.

Regressions:
Not detected

Improvements:
Not detected

Testing cases:
Not needed

Related Changesets

occt: master aff395a3

2012-12-07 09:42:37

dbv

Details Diff
0023415: OSD_FontMgr can't idenify aspect for fonts with names dependant on system locale.

Added function DetectFontsAspects to Font_FontMgr class. This function uses workaround from OpenGl_FontMgr with FreeType for detecting font aspect.
Removed font name parsing from Font_FontMgr::InitFontDataBase(). Now the font name and font style we get through the FreeType.
Fixed Unix part of Font_FontMgr::InitFontDataBase() method. Font name and font style now detected through the FreeType.
Remarks fix. Added recursive default font directories scanning .
Fixed adding fonts folders recursively from configuration files.
Moved fonts aliases map from OpenGl_Display_1 to Font_FontMgr.
Moved fonts name definition from Graphic3d_NameOfFont.hxx to Font_NameOfFont.hxx.
Added new methods to Font_FontMgr: GetAvailableFontsNames, GetFont and FindFont.
Modified Font_SystemFont creation from XLFD. Added method IsEqual to Font_SystemFont.
Modified methods OpenGl_Display::FindFont, OpenGl_FontMgr::request_font in accordance to the new functionality of the Font_FontMgr.
OpenGl_FontMgr now stores only generated fonts instead of duplication of available fonts list.
Removed method OpenGl_FontMgr::requestFontList. Its function now performs Font_FontMgr::GetAvailableFontsNames.
Documentation was fixed
Adjusting testing cases for current state of OCCT
Affected Issues
0023415
add - src/Font/EXTERNLIB Diff File
mod - src/Font/FILES Diff File
mod - src/Font/Font.cdl Diff File
mod - src/Font/Font_FontMgr.cdl Diff File
mod - src/Font/Font_FontMgr.cxx Diff File
mod - src/Font/Font_NListOfSystemFont.hxx Diff File
mod - src/Font/Font_SystemFont.cdl Diff File
mod - src/Font/Font_SystemFont.cxx Diff File
mod - src/Graphic3d/FILES Diff File
mod - src/Graphic3d/Graphic3d_AspectText3d.cdl Diff File
mod - src/Graphic3d/Graphic3d_AspectText3d.cxx Diff File
mod - src/MeshVS/MeshVS_TextPrsBuilder.cxx Diff File
mod - src/MeshVS/MeshVS_Tool.cxx Diff File
mod - src/OpenGl/OpenGl_Display.hxx Diff File
mod - src/OpenGl/OpenGl_Display_1.cxx Diff File
mod - src/OpenGl/OpenGl_FontMgr.cxx Diff File
mod - src/OpenGl/OpenGl_FontMgr.hxx Diff File
mod - src/OSD/EXTERNLIB Diff File
mod - src/Prs3d/Prs3d_TextAspect.cxx Diff File
mod - src/QABugs/QABugs_17.cxx Diff File
mod - src/QABugs/QABugs_MyText.cxx Diff File
mod - src/TKernel/EXTERNLIB Diff File
mod - src/TKService/EXTERNLIB Diff File
mod - src/V3d/V3d_ColorScale.cxx Diff File
mod - src/V3d/V3d_LayerMgr.cxx Diff File
mod - src/ViewerTest/ViewerTest_ObjectCommands.cxx Diff File
mod - tests/bugs/end Diff File
mod - tests/bugs/modalg/bug322 Diff File

Issue History

Date Modified Username Field Change
2012-09-03 11:39 apl New Issue
2012-09-03 11:39 apl Assigned To => bugmaster
2012-10-15 17:23 dbv Note Added: 0021775
2012-10-15 17:23 dbv Assigned To bugmaster => kgv
2012-10-15 17:23 dbv Status new => resolved
2012-10-15 17:24 dbv Relationship added related to 0023466
2012-10-15 17:24 dbv Note Edited: 0021775
2012-10-18 14:34 kgv Assigned To kgv => dbv
2012-10-18 14:34 kgv Status resolved => assigned
2012-10-18 18:50 dbv Note Added: 0021843
2012-10-18 18:50 dbv Assigned To dbv => kgv
2012-10-18 18:50 dbv Status assigned => resolved
2012-10-19 15:27 kgv Note Added: 0021854
2012-10-19 15:27 kgv Assigned To kgv => dbv
2012-10-19 15:27 kgv Status resolved => assigned
2012-10-23 10:25 kgv Relationship added related to 0023209
2012-10-23 12:43 dbv Note Added: 0021896
2012-10-23 12:43 dbv Assigned To dbv => kgv
2012-10-23 12:43 dbv Status assigned => resolved
2012-10-24 12:39 kgv Note Added: 0021921
2012-10-24 12:39 kgv Assigned To kgv => bugmaster
2012-10-24 12:39 kgv Status resolved => reviewed
2012-10-24 15:37 abv Target Version => 6.5.4
2012-10-30 15:02 mkv Note Added: 0022011
2012-10-30 15:05 mkv Test case number => Not needed
2012-10-30 15:05 mkv Status reviewed => tested
2012-10-30 18:47 kgv Note Added: 0022023
2012-10-30 18:47 kgv Assigned To bugmaster => dbv
2012-10-30 18:47 kgv Status tested => assigned
2012-11-01 11:53 kgv Target Version 6.5.4 => 6.6.0
2012-11-16 15:04 dbv Note Added: 0022281
2012-11-16 15:04 dbv Assigned To dbv => kgv
2012-11-16 15:04 dbv Status assigned => resolved
2012-11-20 14:14 kgv Assigned To kgv => san
2012-11-20 21:03 san Note Added: 0022320
2012-11-20 21:03 san Assigned To san => dbv
2012-11-20 21:03 san Status resolved => assigned
2012-11-21 16:24 dbv Note Added: 0022333
2012-11-21 16:24 dbv Assigned To dbv => san
2012-11-21 16:24 dbv Status assigned => resolved
2012-11-28 12:24 san Note Added: 0022399
2012-11-28 12:24 san Assigned To san => bugmaster
2012-11-28 12:24 san Status resolved => reviewed
2012-11-28 16:43 mkv Assigned To bugmaster => mkv
2012-11-29 17:15 mkv Note Added: 0022455
2012-11-29 17:16 mkv Assigned To mkv => dbv
2012-11-29 17:16 mkv Status reviewed => assigned
2012-11-30 16:04 dbv Note Added: 0022489
2012-11-30 16:04 dbv Assigned To dbv => kgv
2012-11-30 16:04 dbv Status assigned => resolved
2012-12-02 17:19 kgv Note Added: 0022498
2012-12-02 17:19 kgv Assigned To kgv => bugmaster
2012-12-02 17:19 kgv Status resolved => reviewed
2012-12-03 19:02 mkv Assigned To bugmaster => mkv
2012-12-04 19:15 mkv Note Added: 0022550
2012-12-04 19:16 mkv Assigned To mkv => bugmaster
2012-12-04 19:16 mkv Status reviewed => tested
2012-12-10 17:16 dbv Changeset attached => occt master aff395a3
2012-12-10 17:16 dbv Assigned To bugmaster => dbv
2012-12-10 17:16 dbv Status tested => verified
2012-12-10 17:16 dbv Resolution open => fixed
2013-04-23 13:37 aiv Status verified => closed
2013-04-29 15:21 aiv Fixed in Version => 6.6.0
2013-11-06 16:13 kgv Relationship added related to 0023049