YuanshengZhao / Garamond-Math

An OTF math font matching the EB Garamond.
SIL Open Font License 1.1
104 stars 6 forks source link

Spacing Problem, especially letter f. Eg. `(f)`, `\frac16f'''(w)` #3

Open ghost opened 6 years ago

ghost commented 6 years ago
\documentclass{article}

\usepackage{unicode-math}
\setmathfont{Garamond-Math}

\begin{document}
    \( (f) \quad \{f\} \quad [f] \quad \lvert f\rvert \)

    \( (y) \quad \{y\} \quad [y] \quad \lvert y\rvert \)
\end{document}

screenshot from 2018-05-08 09-36-29

I think those will need some treatment. I don't know what will be an appropriate approach however. I'm not sure kerning can solve the issue without making everything look asymmetric. In a text font this looks like maybe ligatures are needed, but this is perhaps not the correct thing to do for a math font. So maybe the glyphs of the letters need to be adjusted for the math font?

stone-zeng commented 6 years ago

I don't know whether increase the width of parenthesis, or make the "tail" of f/y shoter. Which one do you think is better?

YuanshengZhao commented 6 years ago

untitled untitled1

These are the effects ((\textit{ }) vs $( )$, the first two rows are XITS), rough though. In fact the height of "f" is larger than the parenthesis, it might be better to use larger parenthesis, and the second picture may look better.

stone-zeng commented 6 years ago

What about \mathit and \symit? @yuanshengzhao

YuanshengZhao commented 6 years ago

Through it may be changed latter, I have temporarily settled on the latter.

svenper commented 5 years ago

What about changing the sidebearings of the letters? E.g. Computer Modern does this, which makes character spacing inconsistent (which should be irrelevant for a math font, where letters are variables, not parts of words).

1

YuanshengZhao commented 5 years ago

Thank you very much for your reply! In fact, this is part of what is done. Changing the sidebearings of letter certainly an essential part. Besides, the sidebearings of ()[]||, etc, is also widened. I do not think the metric has been adjusted very well and more adjustment will be made when new problems are found.

BTW, I admit that character spacing is not so important in math, sometimes too inconsistent spacing may result in a equation not look very nice. Also, there is the case that $SO(3)$ will be used. So, some concession is needed.

image

ghost commented 5 years ago

I don't think, $SO(3)$ should ever be used. It should always be $\operatorname{SO}(3)$ or something like this, so that SO will be printed in the text font.

stone-zeng commented 5 years ago

Upright and italic SO are both widely used, and it's more like a preference.

Personally, I will use \mathit{SO}(3), or

\def\SO{\mathit{SO}}
\SO(3)
YuanshengZhao commented 5 years ago

The spacing of ij and (i), (j) seems to be incompatible: either spacing of ij will be too large or the lower end j will come out of the parenthesis. The main problem is the left side of j which is too extended, and there is no item in math table that can deal with this (at least I do not know).

Sometimes the italic correction will worsen the situation: in TeX, italic correction will almost always be added to width; in MS Word, it will be added when the next glyph is an operator or something. In the case of TT\mathrm{T}, TeX will give too wide space between the first two Ts while MS Word will give too little space between the last two Ts. IMO, the italic correction should and only should be added between last two Ts. Maybe there is an option to let engines behave like that?

YuanshengZhao commented 5 years ago

Another comment here. In the latest version, the spacing of bracket has been adjusted to a (maybe, and only works on XeTeX) acceptable value. But the problem persist on VA, V_A, etc, where the spacing is just too large.

In math, no kerning on VA, this is fine in most cases, but as Garamond has large italic angle, the spacing is too large, even if it is regard as product between V and A. For subscripts, as XeTeX and LuaTeX with unicode-math have somewhat strange behavior to MathKerning (XeTeX only works for single char, while LuaTeX only works for multiple char), the MathKerning cannot be efficiently implemented (if there are any).

At present, some manual adjustment is required for these pairs.