View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0030970 | Community | OCCT:Visualization | public | 2019-09-17 09:50 | 2020-10-07 11:01 |
Reporter | Vico Liang | Assigned To | Vico Liang | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | not fixable | ||
Summary | 0030970: Visualization - Font Name don't support Unicode (such as Chinese) | ||||
Description | void Font_FontMgr::GetAvailableFontsNames(TColStd_SequenceOfHAsciiString& theFontsNames) const; The font names from above method is not readable for Unicode font name such as Chinese. | ||||
Tags | No tags attached. | ||||
Test case number | |||||
|
Please provide some steps to reproduce / test data / output.pload VISUALIZATION #vfont -add pathToSomeFont.ttf vfont |
|
印章繁体方篆.ttf (2,504,748 bytes) |
|
uploaded a font file 印章繁体方篆.ttf |
|
This is not an OCCT bug, but FreeType limitation. FreeType documentation states, that it relies solely on fopen() for being portable, without any wfopen() alternatives on Windows in any way (via dedicated API or via fallback for UTF-8 names). For instance, FreeImage duplicates all file-related APIs with wchar_t variants for handling WinAPI UNICODE issue (FreeImage_GetFileTypeU+FreeImage_GetFileType, FreeImage_LoadU+FreeImage_Load, etc.), FFmpeg follows "utf-8 everywhere" conception, similar to OCCT, so that it expects file names given in UTF-8 and calls wfopen() implicitly on Windows. FreeType is currently different. Alternatives: - Rename font file. Obviously, can be done only if font comes with application. - Using short DOS names as fallback. Side effect: this obsolete file system feature can be disabled on modern Windows systems. - Pre-loading entire file in memory and using FT_New_Memory_Face() instead of FT_New_Face(). Side effect: entire file has to be loaded into memory. - Using FT_Open_Face() instead of FT_New_Face() with custom stream wrapper. Side effect: extra dirty mess-up and complication of OCCT code base. I would say, pushing FreeType project in more Windows-friendly direction would be perfect solution rather than messing up in OCCT, as long, as this is not a blocking issue. FreeType patch, which would handle UTF-8 filenames on Windows, has chances to be integrated - at least it should not contradict to project's philosophy. |
|
It's not the font file name problem, it works well to load the font file with method CheckFont: Handle(Font_SystemFont) Font_FontMgr::CheckFont (const Standard_CString theFontPath) const. The problem is that the name of the font returned from CheckFont is not readable with character "??????". The test system is android. the file path is utf8 character. |
|
> The problem is that the name of the font returned from CheckFont > is not readable with character "??????". This is another problem, but still relevant to FreeType library - the name is returned from FT_Face::family_name. |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-09-17 09:50 | Vico Liang | New Issue | |
2019-09-17 09:50 | Vico Liang | Assigned To | => msv |
2019-09-17 10:12 | Vico Liang | Assigned To | msv => kgv |
2019-09-17 10:12 | Vico Liang | Category | OCCT:Modeling Data => OCCT:Visualization |
2019-09-17 10:51 | kgv | Note Added: 0087189 | |
2019-09-17 10:51 | kgv | Assigned To | kgv => Vico Liang |
2019-09-17 10:51 | kgv | Status | new => feedback |
2019-09-17 12:57 | Vico Liang | File Added: 印章繁体方篆.ttf | |
2019-09-17 12:58 | Vico Liang | Note Added: 0087197 | |
2019-09-17 12:58 | Vico Liang | Assigned To | Vico Liang => kgv |
2019-09-17 12:59 | Vico Liang | Status | feedback => assigned |
2019-09-17 15:20 | kgv | Note Added: 0087203 | |
2019-09-17 15:20 | kgv | Target Version | 7.4.0 => Unscheduled |
2019-09-17 15:21 | kgv | Summary | Font Name don't support Unicode (such as Chinese) => Visualization - Font Name don't support Unicode (such as Chinese) |
2019-09-17 15:21 | kgv | Note Edited: 0087203 | |
2019-09-17 15:22 | kgv | Note Edited: 0087203 | |
2019-09-17 15:23 | kgv | Note Edited: 0087203 | |
2019-09-17 15:24 | kgv | Note Edited: 0087203 | |
2019-09-17 15:25 | kgv | Relationship added | child of 0023457 |
2019-09-17 17:22 | Vico Liang | Note Added: 0087210 | |
2019-09-17 17:26 | Vico Liang | Note Edited: 0087210 | |
2019-09-17 17:43 | kgv | Note Added: 0087211 | |
2019-09-18 10:21 | kgv | Assigned To | kgv => Vico Liang |
2019-09-18 10:21 | kgv | Status | assigned => feedback |
2019-09-18 10:21 | kgv | Resolution | open => not fixable |
2020-10-07 11:01 |
|
Status | feedback => closed |
2020-10-07 11:01 |
|
Target Version | Unscheduled => |