Closed
Bug 511361
Opened 15 years ago
Closed 15 years ago
Display correct (NLS) name of (DBCS) font
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
status1.9.2 | --- | beta1-fixed |
status1.9.1 | --- | .4-fixed |
People
(Reporter: mozilla, Assigned: mozilla)
References
Details
Attachments
(2 files, 4 obsolete files)
794 bytes,
patch
|
Details | Diff | Splinter Review | |
7.17 KB,
patch
|
Details | Diff | Splinter Review |
Quoting from bug 509317: DBCS fonts have two face names at least. One is a NLS name, the other is a default name, maybe English. But, Firefox shows only a default name regardless of LANG or a codepage. And the name of some old DBCS fonts consists of a NLS name not a UCS one. In this case, the name is replaced with spaces. ======================================================================== I'm not sure if this is a problem in Thebes or in the supporting library (specifically, the OS/2 port of FontConfig).
Comment 1•15 years ago
|
||
Hi/2. I would test FontConfig. Where can I get it ? And it would be good if there are any samples to test it.
Assignee | ||
Comment 2•15 years ago
|
||
The FontConfig version that is used in Mozilla on OS/2 is the one in this package: http://hobbes.nmsu.edu/download/pub/incoming/mzfntcfgft_20090811.zip (if moved, search for mzfntcfgft_20090811.zip on Hobbes). It doesn't contain any tests, though, only the (static) library and sources. And yes, one can already tell from %HOME%\FCCACHE.INI which is the cache file used by this FontConfig version, that only English names are listed, or the family name of the first languageID in the font. (That is what FreeType provides by default in its FT_FaceRec structure.) I now finally found the list of languageIDs together with the country name (http://www.microsoft.com/typography/otspec/name.htm#enc3). If I now find a clever way to match that to the possible LANG settings on OS/2, then I could implement local font names. Now that know what to look for I found a list of TT_MS_LANGIDs in ttnameid.h in FreeType and even a match between LANGIDs and locale names in fcfreetype.c in the original FontConfig.
Comment 3•15 years ago
|
||
(In reply to comment #2) > The FontConfig version that is used in Mozilla on OS/2 is the one in this > package: http://hobbes.nmsu.edu/download/pub/incoming/mzfntcfgft_20090811.zip > (if moved, search for mzfntcfgft_20090811.zip on Hobbes). It doesn't contain > any tests, though, only the (static) library and sources. > Ok. I'll look into this. > And yes, one can already tell from %HOME%\FCCACHE.INI which is the cache file > used by this FontConfig version, that only English names are listed, or the > family name of the first languageID in the font. (That is what FreeType > provides by default in its FT_FaceRec structure.) > > I now finally found the list of languageIDs together with the country name > (http://www.microsoft.com/typography/otspec/name.htm#enc3). If I now find a > clever way to match that to the possible LANG settings on OS/2, then I could > implement local font names. > > Now that know what to look for I found a list of TT_MS_LANGIDs in ttnameid.h in > FreeType and even a match between LANGIDs and locale names in fcfreetype.c in > the original FontConfig. You can refer to a snippet from FreeType/2 although it's based on FreeType v1.x.
Comment 4•15 years ago
|
||
Comment 5•15 years ago
|
||
I've implemented a lookup routine for a DBCS names. It works fine to create a font cache at least. But, 2009/09/08 SeaMonkey 2.0pre does not display DBCS font names at all. Any idea ?
Comment 6•15 years ago
|
||
Updated•15 years ago
|
Attachment #400360 -
Attachment mime type: application/octet-stream → text/plain
Comment 7•15 years ago
|
||
I came to know that a face name should be encoded by UTF8. Now, I can see the font lists in Korean. Unfortunately, however, I encounter the crash as soon as I select the font with a Korean name. T.T I don't know whether the problem is in FontConfig or in Mozilla.
Comment 8•15 years ago
|
||
Now encodes a family name in UTF8. But Mozilla crash as soon as I select a font consisted of Korean chars. You can reproduce this as the following with this patch. 1. Remove FCCACHE.INI 2. set LANG=ko_KR 3. restart any Mozilla build. 4. goto the font selection part 5. select any font consisted of Korean chars. 6. crash in xul module. Anyone can give me a hint to solve this crash ?
Attachment #397257 -
Attachment is obsolete: true
Attachment #400360 -
Attachment is obsolete: true
Did you link the updated mozfntcfgft to Mozilla? If you can recreate the crash with the Firefox that I uploaded to netlabs and post it I can look in xul.map and get an idea of which function is crashing.
Comment 10•15 years ago
|
||
I have no any Mozilla sources. If so, I should have been able to look into this problem further more. And your DBCS test build also crash. But it does not generate any log in popuplog.os2. I confirmed it using IPMD.
Assignee | ||
Comment 11•15 years ago
|
||
My machine is up again (for the moment). Let me try to investigate tonight with a debug build.
Comment 12•15 years ago
|
||
(in reply to comment #10) I was thinking of what Firefox wrote to stderr, usually klibc will write a short message much like one from popup.log. Anyways Peter is better prepared for debugging
Comment 13•15 years ago
|
||
(In reply to comment #12) The following is the redirection of stdout and stderr. ----- Killed by SIGSEGV pid=0x0070 ppid=0x0027 tid=0x0001 slot=0x00a2 pri=0x0200 mc=0x0001 G:\EX\FIREFOX-3.7A1PRE\FIREFOX.EXE XUL 0:00c6a5ea cs:eip=005b:12f3a5ea ss:esp=0053:0011e864 ebp=0011e9fc ds=0053 es=0053 fs=150b gs=0000 efl=00212212 eax=00000000 ebx=20421000 ecx=1bff0002 edx=00000000 edi=0011ea34 esi=20a59060 Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it. -----
Assignee | ||
Comment 14•15 years ago
|
||
When compiling the patch I get gcc -Wall -O2 -Zomf -pipe -I../include -DFT2_BUILD_LIBRARY=1 -c -o fontconfig.o fontconfig.c fontconfig.c: In function `LookupDBCSName': fontconfig.c:238: warning: passing arg 2 of `iconv' from incompatible pointer type fontconfig.c:306: warning: passing arg 2 of `iconv' from incompatible pointer type A |const| is missing. And I see that in the first instance inbuf is assigned twice. While the patch seems to work well for some important Asian font names (thanks again!), I think we should handle it more generally. At least the number of users writing Cyrillic letters is still high... We should also increase the version number to "v1.3_with_GCC" to be sure not to garble information in FCCACHE.INI for older builds. The crash problem is caused by FcFontMatch not being able to match some fonts. Apparently Mozilla asks for the font name in UTF16 while we have it now stored in UTF8. Before it was plain ASCII so we just have to use a different conversion.
Assignee | ||
Comment 15•15 years ago
|
||
This fixes the crash. I'm thinking to add a macro, like #define FC_CACHE_USES_UTF8_NAMES 1 to fontconfig.h and check for that in gfxOS2Fonts so that one cannot cannot use an old version of our FC port to compile with this new conversion.
Assignee: nobody → mozilla
Status: NEW → ASSIGNED
Comment 16•15 years ago
|
||
(In reply to comment #14) > When compiling the patch I get > > gcc -Wall -O2 -Zomf -pipe -I../include -DFT2_BUILD_LIBRARY=1 -c > -o fontconfig.o fontconfig.c > fontconfig.c: In function `LookupDBCSName': > fontconfig.c:238: warning: passing arg 2 of `iconv' from incompatible > pointer type > fontconfig.c:306: warning: passing arg 2 of `iconv' from incompatible > pointer type > > A |const| is missing. Fixed. Although I don't care about the warning caused by 'const', I agree that 'warning free code' would be better. > And I see that in the first instance inbuf is assigned > twice. > Fixed. > While the patch seems to work well for some important Asian font names (thanks > again!), I think we should handle it more generally. At least the number of > users writing Cyrillic letters is still high... If I could know the 'LANG' value and codepage of Cyrillic letters, it's not problem. > We should also increase the version number to "v1.3_with_GCC" to be sure not to > garble information in FCCACHE.INI for older builds. Ok. > > > The crash problem is caused by FcFontMatch not being able to match some fonts. > Apparently Mozilla asks for the font name in UTF16 while we have it now stored > in UTF8. Before it was plain ASCII so we just have to use a different > conversion. Good.
Comment 17•15 years ago
|
||
Attachment #400929 -
Attachment is obsolete: true
Comment 18•15 years ago
|
||
(In reply to comment #15) > Created an attachment (id=401326) [details] > fix > > This fixes the crash. > I think, 'UTF186' is a typo of 'UTF16'. ^^
Assignee | ||
Comment 19•15 years ago
|
||
Yes, thanks, I saw that typo after attaching the patch. And I also realized that even for the old FC version we should be able to use that conversion to UTF8 because the old ASCII font names are also UTF8, so they should be identical. As for Russian etc.: I was thinking we should not add languages one-by-one but instead just use much of the code from http://cgit.freedesktop.org/fontconfig/tree/src/fcfreetype.c to support all languages immediately. But your current patch should provide a good first step nonetheless. As soon as I have gotten Mercurial to work again on my OS/2 system (this weekend?) I'll push your patches, this patch here, and create a new set of nightlies with that.
Comment 20•15 years ago
|
||
Attachment #401397 -
Attachment is obsolete: true
Comment 21•15 years ago
|
||
(In reply to comment #19) > > As for Russian etc.: I was thinking we should not add languages one-by-one but > instead just use much of the code from > http://cgit.freedesktop.org/fontconfig/tree/src/fcfreetype.c to support all > languages immediately. The simplest way is to register all the name of fonts. ^^ > But your current patch should provide a good first step nonetheless. As soon as > I have gotten Mercurial to work again on my OS/2 system (this weekend?) I'll > push your patches, this patch here, and create a new set of nightlies with > that. Thanks. ^________^
Assignee | ||
Comment 22•15 years ago
|
||
Comment on attachment 401403 [details] [diff] [review] Ues UCS-2BE instead of UCS-2, and merge charset conversion routine. I pushed this patch to the Hg repo of mzfntcfgft, see http://hg.mozilla.org/users/mozilla_weilbacher.org/mzfntcfgft/rev/245c5d66d9b5
Assignee | ||
Comment 23•15 years ago
|
||
Pushed the Mozilla fix (with the typo in the comment repaired) into three repos: http://hg.mozilla.org/releases/mozilla-1.9.1/rev/01f22cda6705 http://hg.mozilla.org/releases/mozilla-1.9.2/rev/06d96971a9e5 http://hg.mozilla.org/mozilla-central/rev/ec96a6a36e84 (If this works, we can eventually also fix 1.9.0.) This should resolve the bug. I'll kick off a FF 3.5 nightly now for verification.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
status1.9.1:
--- → .4-fixed
status1.9.2:
--- → beta1-fixed
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•