Support Kashida justification |
|||
Issue descriptionI guess this should be considered seriously while or after LayoutNG, specially as Edge switch to Chromium. Kashida justification is a special kind of justification in Arabic and some other cursive scripts, see https://stackoverflow.com/a/20790740 and https://docs.microsoft.com/en-us/windows/desktop/directwrite/justification--kerning--and-spacing. Edge supports this currently using `text-justify: kashida;` but Chrome don't. Now with Edge switch. this should be prioritized here I guess, or, asking Microsoft to share their experiences. We know which APIs are related to such task https://github.com/harfbuzz/harfbuzz/blob/master/src/hb-directwrite.cc#L702-L778 but low level details and maybe some code contribution (to Chrome or HarfBuzz) will be more nice also. Testcase: Open this in Chrome and Edge data:text/html;charset=utf8,<div style="text-justify: kashida; text-align-last: justify; text-align: justify; width: 300px">%D9%85%D8%AA%D9%86</div> Actual: No justification happens Expected: Like Edge, if the testcase is saved as file and opened in Edge. See the attached screenshot also
,
Dec 11
Ebrahim, do you know whether this is a feature of DWrite or implemented in Edge, on top of DWrite? In other words, is this something that IDWriteFactory::CreateTextLayout https://docs.microsoft.com/en-us/windows/desktop/api/dwrite/nf-dwrite-idwritefactory-createtextlayout can do for Edge, or is it something that's implemented at a higher level?
,
Dec 11
It can be both theoretically, LibreOffice does it on top of HarfBuzz https://github.com/mirror/openoffice/blob/ac58ea25d9ea6e57181d6047264340cdc75de79a/main/sw/source/core/text/porlay.cxx#L1145 without involving HarfBuzz itself but HarfBuzz needs to have this for supporting things like AAT's just https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6just.html and OT's JSTF https://docs.microsoft.com/en-us/typography/opentype/spec/jstf so AFAIK this is done by https://github.com/harfbuzz/harfbuzz/blob/master/src/hb-directwrite.cc#L702-L778 (I wrote the part and whole hb-directwrite for HarfBuzz just to be able to access those) so I think it leverages DirectWrite's implementation. Just to note here, this was considered for CSS3 but deferred to CSS4 and later removed from it apparently also but the only reason was the lack of documentation and available implementations. Font-driven justification (which can result to Kashida also) using just/JSTF tables are about supporting such features which Chrome should have anyway (but Kashida justification should happen without their presence also) but now that Edge switches to Chrome, this will be a regression also.
,
Dec 11
,
Dec 11
Filed on https://github.com/harfbuzz/harfbuzz/issues/1469 also
,
Dec 13
Thanks for the report. This is definitively something we'd like to support in LayoutNG, post phase 1. |
|||
►
Sign in to add a comment |
|||
Comment 1 by kojii@chromium.org
, Dec 11Status: Available (was: Untriaged)