EB-Garamond icon indicating copy to clipboard operation
EB-Garamond copied to clipboard

Diacritic (dot under) not working properly with XeLaTeX, but works fine with pdfLaTeX

Open ravchin opened this issue 3 years ago • 1 comments

When using \d{}, the dot under the character is offset to the right when compiled under XeTeX (and to the left under LuaTeX). It works fine with pdfLaTeX. Also, the behavior of \textsc{\d{}} is inconsistent.

pdfLaTeX-crop.pdf

XeLaTeX-crop.pdf

ravchin avatar Nov 12 '21 06:11 ravchin

The situation as I see it:

  1. pdfLaTeX puts the dot under without resorting to font internal information, instead calculating (quite well) where best to place it.
  2. Xe/LuaLaTex seem to use Unicode and font features to set the dot, where encodings exist (?)
  3. Glyphs with descenders (g, j, p, q, J, Q) in EBG don’t have a below anchor set (yet), so the font doesn’t define where to place the dot below. Its placement to the right is therefore somehow expected although not desired.
  4. There’s an encoded y with dot below which is explicitly designed as you see it. You can consider this “the artist‘s choice” ;). Probably not ideal in mathematics vel sim.
  5. In \d{\textsc{a}} it seems that neither font logic nor LaTeX magic is applied. Otherwise, either all (LaTeX magic) or at least \d{\textsc{c}} would show correct placement (c.sc has a well placed anchor for dot below).
  6. \textsc{\d{a}} fails where there’s either an encoded \d{x} glyph because no smallcaps rule for those exists (yet) in the font or where no anchor for dot below is defined (as in f.sc).

TODOs

  • [ ] define anchors for below accents for glyphs with descender.
  • [ ] add lookups for xbelowdot in smcp feature.
  • [ ] what to do with y+belowdot?
  • [ ] Why does no. 5 fail? (Ask LaTeX gurus)

georgd avatar Mar 17 '23 23:03 georgd