Closed Bug 33498 Opened 24 years ago Closed 23 years ago

add transliterator to Windows version of font engine

Categories

(Core :: Layout, defect, P3)

x86
Windows NT
defect

Tracking

()

RESOLVED FIXED
mozilla0.9.5

People

(Reporter: erik, Assigned: rbs)

References

Details

Attachments

(2 files, 1 obsolete file)

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.
Blocks: 17962
Status: NEW → ASSIGNED
Target Milestone: --- → M20
Mark it as M25
Target Milestone: M20 → M25
mark this as future for now.
Target Milestone: --- → Future
erik resign. reassign all his bug to ftang for now.
Assignee: erik → ftang
Status: ASSIGNED → NEW
mark all future new as assigned after move from erik to ftang
Status: NEW → ASSIGNED
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).
Blocks: 79928
Attached patch patch in intlSplinter Review
Attached patch patch in gfx (obsolete) — Splinter Review
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
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. 
Wouldn't that allocate another area? Or is there another flavor that does the 
conversion in a caller provided buffer?
Status: NEW → ASSIGNED
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+
Attachment #50680 - Attachment is obsolete: true
Attachment #50680 - Flags: review+
Update at the wake of the font changes.
Ready for r/sr.
*** Bug 79928 has been marked as a duplicate of this bug. ***
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.
... and stepped in the debugger to see that things were going on as expected.
Why ISO-8859-1? Will this work properly on non-US systems?

+      res = gFontSubstituteConverter->Init("ISO-8859-1",

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 on attachment 51176 [details] [diff] [review]
updated patch in gfxwin

r/sr=waterson, whichever helps.
Attachment #51176 - Flags: superreview+
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.
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.

Attachment

General

Creator:
Created:
Updated:
Size: