Closed
Bug 728866
Opened 12 years ago
Closed 11 years ago
support unicode composition and decomposition during harfbuzz shaping
Categories
(Core :: Layout: Text and Fonts, defect)
Core
Layout: Text and Fonts
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: jfkthame, Assigned: jfkthame)
References
(Depends on 1 open bug)
Details
Attachments
(3 files)
2.71 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
3.11 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
4.33 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
Harfbuzz has added support for (limited/specialized) normalization during shaping, but currently we are only taking partial advantage of this - we get reordering of combining marks into a standard order for display (e.g. see bug 662055), but we don't get canonical (de)composition of precomposed accented characters, as that depends on a couple of new callbacks that we haven't yet implemented. The main advantage of implementing this is that some fonts - especially older ones - have a number of precomposed forms, but do not have good (or any) dynamic mark positioning code. Hence, if a page includes a decomposed letter+diacritic sequence, the mark positioning may be poor, whereas if we support composition in the shaping process, we can use the better-looking precomposed glyph. To support this, harfbuzz needs two callbacks, one to implement a single step of decomposition, and one to compose two characters into one. Unfortunately, although our normalization component has the relevant data tables (though somewhat obsolete, see bug 728180), it does not currently provide this level of API, but we can pretty easily expose it.
Assignee | ||
Comment 1•12 years ago
|
||
For harfbuzz shaping purposes, I don't want the extra indirection of going through an nsIUnicodeNormalizer; the idea here is to expose the low-level data needed in the most direct way possible.
Attachment #598847 -
Flags: review?(smontagu)
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #598848 -
Flags: review?(smontagu)
Assignee | ||
Comment 3•12 years ago
|
||
Unfortunately, using standard canonical composition does not give us good rendering of Hebrew with old fonts (such as those from WinXP), because the Hebrew presentation forms (U+FBxx) with dagesh, etc., are excluded from composition. However, it appears that Uniscribe et al use these glyphs if available, and I think we should do the same. With this patch, I finally get the desired rendering of your testcase from bug 727736 using the WinXP versions of Arial and Courier, for example.
Attachment #598849 -
Flags: review?(smontagu)
Updated•12 years ago
|
Attachment #598847 -
Flags: review?(smontagu) → review+
Comment 4•12 years ago
|
||
Comment on attachment 598847 [details] [diff] [review] part 1 - expose low-level character composition/decomposition functions in nsUnicodeNormalizer Review of attachment 598847 [details] [diff] [review]: ----------------------------------------------------------------- Hmm, on second thoughts perhaps Decompose should have a different name to clarify that it isn't doing a full decomposition. r=smontagu stands either way.
Updated•12 years ago
|
Attachment #598848 -
Flags: review?(smontagu) → review+
Comment 5•12 years ago
|
||
Comment on attachment 598849 [details] [diff] [review] part 3 - add support for composition of Hebrew presentation forms Review of attachment 598849 [details] [diff] [review]: ----------------------------------------------------------------- Looks good.
Attachment #598849 -
Flags: review?(smontagu) → review+
Assignee | ||
Comment 6•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/8ee6310cecda https://hg.mozilla.org/integration/mozilla-inbound/rev/2c3f7f3ace89 https://hg.mozilla.org/integration/mozilla-inbound/rev/969493463a87
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla13
Comment 7•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/8ee6310cecda https://hg.mozilla.org/mozilla-central/rev/2c3f7f3ace89 https://hg.mozilla.org/mozilla-central/rev/969493463a87
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 8•11 years ago
|
||
Humm. Ideally I want to support both Arabic and Hebrew presentation-form shaping in HB. Lets start thinking about that.
Comment 9•11 years ago
|
||
I added the hebrew decompositions to harfbuzz upstream now.
You need to log in
before you can comment on or make changes to this bug.
Description
•