-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect placement of bopomofo tone marks in vertical writing mode #532
Comments
This should affect mark attachment in vertical text. I have no font to test, but this sounds the right order. Noticed while debugging #532
The font uses mark attachment in the 'vkrn' feature to place the tone marks relative to the base glyphs. However, it looks to me like the GPOS attachment positions in the test font don't really make sense for the desired placement. We have anchors on the base glyphs such as
where the y-coordinate suggests a mark placed well below the base character to which it is attached, and the x-coordinate shifts it just a bit to the right. The desired result, OTOH, is for the mark to be raised up somewhat relative to the base, and shifted quite a long way to the right. And sure enough, if I modify the font to have base anchors that reflect this, e.g.:
then the harfbuzz (hb-view) and Chrome results look a lot like the "expected" image. (Firefox currently has a bug in how it interprets the position offsets from harfbuzz, so it gets the horizontal offset wrong, but that's a separate issue for us to fix.) Modifying the font in this way, then, will give the desired result in harfbuzz-based applications. Unfortunately, however, it breaks the result in Safari, which ends up with something similar to the "bad" Chrome result. I think this means that Safari has a bug in how it applies mark attachment in vertical mode, such that it swaps vertical and horizontal offsets; this example font was developed by "trial and error" such that it works under Safari's misinterpretation of the attachments, but this results in bad rendering for harfbuzz-based apps. But we'll need to check this with Ned at Apple. |
cc @nedley |
I also tried setting the BaseAnchor to (0, 0) on all the glyphs. The mark anchors are also at (0, 0). Hence, we'd expect to see the attached marks overlaying their base characters. And indeed, this is what happens in Chrome. But in Safari, the marks "attached" at (0, 0) appear to be about 1em below and to the right of their base characters. It looks like Safari is doing something quite weird with attachments in vertical mode. |
Have you checked Safari on High Sierra? |
No, I'm still on Sierra. If behavior has changed in HS, that could potentially be very good news. |
Hi, The tone mark (gid46) has neither h advance nor v advance. Its y-offset does not look like it has been attached to an anchor. That makes the later character overlapped with the tone mark, as can be seen by hb-view. @jfkthame you mentioned that Firefox had the correct result except x-offset with updated font in #532 (comment) . How is that possible? Can you tell me how applications should render the tone mark in this case? Do I need information other than x and y offsets to render the tone mark correctly? Sorry for these naive questions. |
I think you need to explicitly enable the 'vkrn' feature. |
(and then add --margin 200 or something like that to the hb-view command, so the shifted tone mark is visible) |
FWIW, here's a sample with a "hacked" version of the bopomofo font that renders as I'd expect in both Chrome and Firefox Beta (or Nightly) .... not in current release Firefox (57) due to a bug, but that's fixed for FF 58 and later. |
@jfkthame It also worked in LibreOffice with minor tweaks. Thank you! |
Dr. Ken Lunde recommend to use OpenType GPOS 'vert' for long-term solution. So we updated test case here: https://bobbytung.github.io/BopomofoLayoutTest/ Works with Firefox 58 and Chrome 65. Might work with LibreOffice as well. @marklh9 |
@bobbytung The new font works fine with LibreOffice 6.0. Users do not have to set vkrn feature manually now. Thank you! |
@kahsieh This isn’t the proper venue for discussing it. You can file a bug at bugreport.apple.com. |
@nedley Thanks, will do |
Please reopen if anything is left to be done in HarfBuzz. |
Neither Chrome nor Firefox correctly place bopomofo tone marks next to the annotations for the test case at https://bobbytung.github.io/BopomofoLayoutTest/case02/index.html, where the tone marks' positions are adjusted using
vkrn
.Expected result:
![image](https://user-images.githubusercontent.com/19560595/30011172-3276dc48-90ea-11e7-9617-9db6f23be3f5.png)
Chrome:
![image](https://user-images.githubusercontent.com/19560595/30011203-758274b6-90ea-11e7-8f2b-91ece89bcef0.png)
Firefox:
![image](https://user-images.githubusercontent.com/19560595/30011211-7cfb8f5c-90ea-11e7-9a65-da85428c282f.png)
Safari (gets the placement correct except there's extra space where the tone mark would be if its position were not adjusted):
![image](https://user-images.githubusercontent.com/19560595/30011177-3f6caa68-90ea-11e7-81e7-7907a566ff25.png)
Minimal testcase:
testcase.zip
See also:
https://bugzilla.mozilla.org/show_bug.cgi?id=1395774
The text was updated successfully, but these errors were encountered: