TeX-Live / yhmath

Development of the yhmath package
Other
4 stars 0 forks source link

Merged font bug: Wrong metrics and missing glyphs? #3

Open RuixiZhang42 opened 5 years ago

RuixiZhang42 commented 5 years ago

I dug a little further from our discussion on the “slightly larger intermediate parentheses”. In my previous comment I mentioned that

We can see that yhcmex10’s \bigg is slightly smaller than cmex10’s \bigg […]

This appears to be a yhcmex10 font bug after all. In the following example, I found that:

  1. All intermediate sizes — numbered “4” — meant to be between \Big and \bigg, were vertically off-center (metrics wrong?);
  2. All \bigg sizes — numbered “5” — were stuck at the previous smaller sizes and did not grow (glyphs missing?). The vertical placements were also wrong.

The second point now fully explains why TeX chooses the larger (and unpleasing) parentheses in \binom: TeX was supposed to choose \bigg, but it turned out that \bigg was mis-mapped to a smaller size and was not big enough. So TeX proceeded to the next bigger size available, the intermediate one (numbered 6, between \bigg and \Bigg).

qqqq

I have highlighted the problematic sizes in orange.

\documentclass{article}
\usepackage{xcolor}
\usepackage{yhmath}
\newcommand*\vcontent[1]{%
  \hrule height
  \ifcase#1 1.0em%  0: Normal size without extension
  \or       1.2em%  1: \big
  \or       1.5em%  2
  \or       1.8em%  3: \Big
  \or       2.1em%  4
  \or       2.4em%  5: \bigg
  \or       2.7em%  6
  \or       3.0em%  7: \Bigg
  \or       3.6em%  8
  \or       4.2em%  9
  \or       4.8em% 10
  \or       5.4em% 11
  \or       6.0em% 12
  \or       6.6em% 13: Largest size available in yhcmex10
  \or       7.2em% 14: Piecing parts together
  \else       0pt%
  \fi
  width 0.4pt\relax
}
\newcommand*\test[3]{%
  \kern-\nulldelimiterspace
  \left#1%
  \vcenter{\color{red}\vcontent{#3}\hbox{\smash{\color{blue}#3}}}%
  \right#2%
  \kern-\nulldelimiterspace
}
\pagestyle{empty}
\begin{document}
\(
()%
\test(){ 0}%
\test(){ 1}%
\test(){ 2}%
\test(){ 3}%
\test(){ 4}%
\test(){ 5}%
\test(){ 6}%
\test(){ 7}%
\test(){ 8}%
\test(){ 9}%
\test(){10}%
\test(){11}%
\test(){12}%
\test(){13}%
\test(){14}%
\)

\(
\langle\rangle
\test<>{ 0}%
\test<>{ 1}%
\test<>{ 2}%
\test<>{ 3}%
\test<>{ 4}%
\test<>{ 5}%
\test<>{ 6}%
\test<>{ 7}%
\test<>{ 8}%
\test<>{ 9}%
\test<>{10}%
\test<>{11}%
\test<>{12}%
\test<>{13}% Stop growing afterwards
\)

\(
/\backslash
\test/\backslash{ 0}%
\test/\backslash{ 1}%
\test/\backslash{ 2}%
\test/\backslash{ 3}%
\test/\backslash{ 4}%
\test/\backslash{ 5}%
\test/\backslash{ 6}%
\test/\backslash{ 7}% Stop growing afterwards
\)

\(
\{\}%
\test\{\}{ 0}%
\test\{\}{ 1}%
\test\{\}{ 2}%
\test\{\}{ 3}%
\test\{\}{ 4}%
\test\{\}{ 5}%
\test\{\}{ 6}%
\test\{\}{ 7}% Pieced together afterwards
\)
\(
[]%
\test[]{ 0}%
\test[]{ 1}%
\test[]{ 2}%
\test[]{ 3}%
\test[]{ 4}%
\test[]{ 5}%
\test[]{ 6}%
\test[]{ 7}% Pieced together afterwards
\)

\(
\lfloor\rfloor
\test\lfloor\rfloor{ 0}%
\test\lfloor\rfloor{ 1}%
\test\lfloor\rfloor{ 2}%
\test\lfloor\rfloor{ 3}%
\test\lfloor\rfloor{ 4}%
\test\lfloor\rfloor{ 5}%
\test\lfloor\rfloor{ 6}%
\test\lfloor\rfloor{ 7}% Pieced together afterwards
\)
\(
\lceil\rceil
\test\lceil\rceil{ 0}%
\test\lceil\rceil{ 1}%
\test\lceil\rceil{ 2}%
\test\lceil\rceil{ 3}%
\test\lceil\rceil{ 4}%
\test\lceil\rceil{ 5}%
\test\lceil\rceil{ 6}%
\test\lceil\rceil{ 7}% Pieced together afterwards
\)
\end{document}