weixin_39849888
weixin_39849888
2020-11-29 01:52

wrong glyph for chinese word 小 (U+5C0F) since 2.0.0

after upgrade libharfbuzz0b to 2.0.0 (or later) in Debian, the Chinese word 小 (U+5C0F) is not render correct.

in version 1.9.0, it render correct: tommy:~$ hb-shape --verbose --trace --shapers=ot --font-file=msjh.ttf --text-file 1.txt 1: (小) 1: 1: [space=0+0|uni5C0F=1+2048]

in version 2.0.0 to 2.3.0, it render not correct: tommy:~$ hb-shape --verbose --trace --shapers=ot --font-file=msjh.ttf --text-file 1.txt 1: (小) 1: 1: trace: start kern subtable 0 buffer: [.notdef=0+1428|uni5C0F=1+2048] 1: trace: end kern subtable 0 buffer: [.notdef=0+1428|uni5C0F=1+2048] 1: [space=0+0|uni5C0F=1+2048]

该提问来源于开源项目:harfbuzz/harfbuzz

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

7条回答

  • weixin_39605296 weixin_39605296 5月前

    I don’t see any difference in the output between the two (apart from the extra tracing messages), what is the issue exactly?

    点赞 评论 复制链接分享
  • weixin_39849888 weixin_39849888 5月前

    When I use ffmpeg to render .ass subtitle, U+5C0F will render like a Korean word, not the Chinese word: 小

    any command I can use to get more information?

    点赞 评论 复制链接分享
  • weixin_39605296 weixin_39605296 5月前

    I don’t know what ffmpeg is doing, but the hb-shape output above is identical in both versions. This has to be debugged inside ffmpeg, may be it is passing the wrong language to HarfBuzz causing it to pick different glyph variant.

    点赞 评论 复制链接分享
  • weixin_39849888 weixin_39849888 5月前

    But the same version of ffmpeg and libass, only change the version of libharfbuzz0b.so, will get different result. for the correct render, like: https://www.teatime.com.tw/~tommy/test/correct.jpg for the wrong render, like: https://www.teatime.com.tw/~tommy/test/wrong.jpg

    the left character is different for libharfbuzz.so.0.10900.0 and libharfbuzz.so.0.2000.0 (or newer).

    点赞 评论 复制链接分享
  • weixin_39605296 weixin_39605296 5月前

    I don’t really know, but if hb-shape output is the same, then it is a string indication that HarfBuzz is working correctly. Are you sure the font in your image is actually msjh.ttf? It looks like a different font to me. You need to know the exact font used and check it with hb-shape.

    点赞 评论 复制链接分享
  • weixin_39849888 weixin_39849888 5月前

    Sorry, I found this is not bug in harfbuzz, it's just incompatible with libass's code since harfbuzz 2.0.0 (API change?). recompile libass without harfbuzz will avoid this issue.

    点赞 评论 复制链接分享
  • weixin_39958631 weixin_39958631 5月前

    What was the problem exactly?

    点赞 评论 复制链接分享

相关推荐