khaledhosny / harftex

A TeX enginge with embedded HarfBuzz and Lua
GNU General Public License v2.0
30 stars 0 forks source link

glyph overlap in Segoe UI Emoji #12

Closed emojifreak closed 5 years ago

emojifreak commented 5 years ago
\documentclass{article}
\usepackage{harfload}
\usepackage{fontspec}

\begin{document}
\Huge
\noindent
\fontspec{Segoe UI Emoji}[RawFeature={mode=harf}]
πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦β°β°\\
\fontspec{Noto Color Emoji}[RawFeature={mode=harf}]
πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦β°β°
\end{document}

When I process the above file with harflatex 0.40 installed from TeXLive Contrib, I get emoji4 We see that the glyphs in Segoe UI Emoji are overlapping. I doubt if this is an intended behavior. The generated PDF is attached below. emoji4.pdf

khaledhosny commented 5 years ago

Is this a regression, did you get proper spacing before?

emojifreak commented 5 years ago

@khaledhosny Thank you for your reply. No, I believe it is NOT a regression. I have seen it before but did not see it as something to be reported. Moreover, mode=node and lualatex also give almost the same (improper) spacing with the black-and-white version of Segoe UI Emoji. Below is the result with mode=node. I am sorry if this is a bug (or a feature) of the font. Screenshot at 2019-08-15 04-17-37

khaledhosny commented 5 years ago

Looks like a HarfBuzz issue. I can reproduce the bad spacing with other HarfBuzz applications, but not with Apple’s TextEdit. Can you check on Windows whether applications like Notepad, Wordpad and MS Word handle this correctly?

The font has a dist feature and seems to expect it to be tutned on by default, but HarfBuzz only enables it by default for certain scripts only. Enabling it manually fixes the spacing:

\fontspec{Segoe UI Emoji}[RawFeature={mode=harf,dist}]
emojifreak commented 5 years ago

@khaledhosny Windows Notepad and Microsoft Word make correct spacing, i.e., two spacing among three glyph are the same in Segoe UI Emoji. Firefox on Windows make incorrect spacing, as expected.

khaledhosny commented 5 years ago

Thanks, this will be fixed in HarfBuzz.

khaledhosny commented 5 years ago

Fixed with 5645b9f74dae9476f80147b2174ae2e6966bddb6.