Closed
Bug 33498
Opened 24 years ago
Closed 23 years ago
add transliterator to Windows version of font engine
Categories
(Core :: Layout, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla0.9.5
People
(Reporter: erik, Assigned: rbs)
References
Details
Attachments
(2 files, 1 obsolete file)
1.38 KB,
patch
|
rbs
:
review+
|
Details | Diff | Splinter Review |
8.97 KB,
patch
|
waterson
:
superreview+
|
Details | Diff | Splinter Review |
The Unix version of the font engine already calls the transliteration API that maps e.g. the euro to "EUR". We need to call this API from the Windows version of the font engine too, since even Windows doesn't always have glyphs for all Unicodes. This bug is a spin-off from bug 17962.
Reporter | ||
Updated•24 years ago
|
Comment 3•23 years ago
|
||
erik resign. reassign all his bug to ftang for now.
Assignee: erik → ftang
Status: ASSIGNED → NEW
Comment 4•23 years ago
|
||
mark all future new as assigned after move from erik to ftang
Status: NEW → ASSIGNED
Comment 5•23 years ago
|
||
shanjian- low priority bug but I think you are the right person to look at it if we really need it.
Assignee: ftang → shanjian
Status: ASSIGNED → NEW
I have been "manually" doing some transliteration for bug 79928, It would be much cleaner if SubstituteChars() could do the transliteration in the usual way (i.e., cache the properties on first use, an re-use later).
Grabbing the bug as I have a fix. Tiny little patch like people like :-) Could I get some hot r/sr, thanks. This way I can land this little gem presto and keep my other changes in sync... I was having some misgivings about manually transliterating the ZWSP (bug 79928) because that hardcoded approach doesn't scale. So I thought I will just bite the bullet and do it the proper way. The fix uses the transliterator and this brings GfxWin in parity with what is happening on other platforms. In the process, I noted that other platforms are using nsISaveAsCharset::attr_EntityBeforeCharsetConv. I think what people want is nsISaveAsCharset::attr_EntityAfterCharsetConv. The former will convert to entities _before_ doing the transliteration, thereby possibly converting some glyphs that could be transliterated. The latter will transliterate, and then the glyphs that couldn't be transliterated will be converted to their entity representation if possible or to question marks if not possible. Finally, just in case, I also made sure that the Win32 routines that expect the converted result are 0-length safe. Not sure about other platforms here.
Assignee: shanjian → rbs
Target Milestone: Future → mozilla0.9.5
Comment 10•23 years ago
|
||
Thanks roger for taking this. I read through your code and have one suggestion. You probably want to use "NS_ConvertASCIItoUCS2" to do conversion from latin1 to unicode.
Assignee | ||
Comment 11•23 years ago
|
||
Wouldn't that allocate another area? Or is there another flavor that does the conversion in a caller provided buffer?
Status: NEW → ASSIGNED
Comment 12•23 years ago
|
||
I don't realize there is another flavor. You are right, in this case we don't want to bother. r=shanjian
Attachment #50680 -
Flags: review+
Attachment #50679 -
Flags: review+
Assignee | ||
Comment 13•23 years ago
|
||
Attachment #50680 -
Attachment is obsolete: true
Attachment #50680 -
Flags: review+
Assignee | ||
Comment 14•23 years ago
|
||
Update at the wake of the font changes. Ready for r/sr.
Assignee | ||
Comment 15•23 years ago
|
||
*** Bug 79928 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 16•23 years ago
|
||
Guys, could you clear me on this one. I have well tested by simulating different error conditions to exercise the code-paths, and repeated the process with the 'A' functions.
Assignee | ||
Comment 17•23 years ago
|
||
... and stepped in the debugger to see that things were going on as expected.
Comment 18•23 years ago
|
||
Why ISO-8859-1? Will this work properly on non-US systems? + res = gFontSubstituteConverter->Init("ISO-8859-1",
Assignee | ||
Comment 19•23 years ago
|
||
Yes. This causes the result of the substitution to be in ASCII. Then the resulting ASCII string is copied to Unicode (since ASCII code points are invariant in Unicode). And from there on, the result is fed to other functions which expects Unicode.
Comment 20•23 years ago
|
||
Comment on attachment 51176 [details] [diff] [review] updated patch in gfxwin r/sr=waterson, whichever helps.
Attachment #51176 -
Flags: superreview+
Assignee | ||
Comment 21•23 years ago
|
||
Will checkin shortly with the assumption that the earlier r=shanjian still applies after transposing the patch at the wake of font changes. Also noted a couple of possible leaks on the error code-paths that shanjian pointed in bug 99010 and somehow I missed them in the heat of that bug.
Assignee | ||
Comment 22•23 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•