Fontinst v1.914 patch 4 [was: bug in fontinst-prerelease]

Lars Hellström Lars.Hellstrom@math.umu.se
Sat, 7 Sep 2002 23:40:07 +0200


At 17.31 +0200 2002-09-07, trevelyn wrote:
>Hello fontinst,
>
>  with a statement like ...RMTMI scaled 856... i get, in the .vpl
>  output
>(MAPFONT D 0 (FONTNAME RMTMI) (FONTDSIZE R 10.0) (FONTAT R 8.55994))
>in fontinst v1.801
>
>(MAPFONT D 0 (FONTNAME RMTMI) (FONTDSIZE R 10.0) (FONTAT R 1.0))
>in fontinst v1.914 (prerelease version)
>
>not too familiar with fontinst, but is this a bug?

Yes, it's a bug. Turns out the \setscaledrawglyph and \setscalednotglyph
commands weren't, as they should be, testing whether the rawscale integer
was set (but rather whether the i-rawscale integer was set). That resulted
in the kerns being scaled, but not the actual glyphs.

Adding the following definitions to your fontinst.rc file will fix this.

%%%%%%%%%%%% v1.914 patch 4 %%%%%%%%%%%

\def\setscaledrawglyph#1#2#3#4#5#6#7#8#9{
   \if_undefined{g-#1}\then
      \eval_expr{#4}
      \ifnum \result=\one_thousand
         \let\a_macro\identity_one
      \else
         \edef\a_macro##1{\saved_scale{\the\result}{##1}}
      \fi
      \eval_expr_to\a_count{#6}
      \eval_expr_to\b_count{#7}
      \eval_expr_to\c_count{#8}
      \eval_expr_to\d_count{#9}
      \ifisint{rawscale}\then
         \e_count=\int{rawscale}
         \multiply \a_count \e_count  \l_rounded_thousandths\a_count
         \multiply \b_count \e_count  \l_rounded_thousandths\b_count
         \multiply \c_count \e_count  \l_rounded_thousandths\c_count
         \multiply \d_count \e_count  \l_rounded_thousandths\d_count
         \edef\a_macro##1{\saved_scale{\the\e_count}{\a_macro{##1}}}
      \fi
      \x_cs\edef{g-#1}{
         {\the\a_count}
         {\the\b_count}
         {\the\c_count}
         {\the\d_count}
         {\a_macro{\saved_raw{#2}{#5}{#1}}}
         {\a_macro{\saved_mapfont{#2}{#3}}}
      }
   \fi
}
\def\setscalednotglyph#1#2#3#4#5#6#7#8#9{
   \if_undefined{g-#1-not}\then
      \eval_expr_to\a_count{#6}
      \eval_expr_to\b_count{#7}
      \eval_expr_to\c_count{#8}
      \eval_expr_to\d_count{#9}
      \ifisint{rawscale}\then
         \e_count=\int{rawscale}
         \multiply \a_count \e_count  \l_rounded_thousandths\a_count
         \multiply \b_count \e_count  \l_rounded_thousandths\b_count
         \multiply \c_count \e_count  \l_rounded_thousandths\c_count
         \multiply \d_count \e_count  \l_rounded_thousandths\d_count
      \fi
      \x_cs\edef{g-#1-not}{
         {\the\a_count}
         {\the\b_count}
         {\the\c_count}
         {\the\d_count}
         {}{}
      }
   \fi
}

%%%%%%%%% end v1.914 patch 4 %%%%%%%%%%%

Lars Hellström