# [Fontinst] accessing unencoded charecters

Mon Dec 1 20:36:57 CET 2003

"WS" == Walter Schmidt writes:

WS> Assuming there is an mtx file for a re-encoded font, which says
WS> \setscalednotglyph{space}...

WS> i.e., the space charecter is present in the real font, but not in
WS> the re-encoded one.

WS> Now I'm going to use this mtx file in an \installfont command.
WS> How can I determine the width of the space charecter?  Using the
WS> command

WS>       \width{space}

WS> in the .etx file would result in an error:

WS>   ! Missing number, treated as zero.  <to be read again> \g-space

WS> Further question: The command \ifsiglyph{space} would return
WS> "false" in this case.  How can I check for the existence of a
WS> character, regardles of whether or not it is present in the
WS> current encoding?

see the recent archives of fontinst list. the possible solution is to
use something like this:

\ifisglyph{space}\then
\setint{spacewidth}{\width{space}}
\Else\ifisglyph{space-not}\then
\setint{spacewidth}{\width{space-not}}
\Else
\setint{spacewidth}{500} % Fallback default
\Fi\Fi

and then use \int{spacewidth}

Another approach which i suggested but which Lars did not like was to
redefine the \glyph_parameter in a following way:

\def\glyph_parameter#1#2{
\if_defined{g-#2}\then
\expandafter\expandafter\expandafter
#1\csname g-#2\expandafter\endcsname
\else\if_defined{g-#2-not}\then
\expandafter\expandafter\expandafter
#1\csname g-#2-not\expandafter\endcsname
\else
% error: glyph not set
\fi\fi
}

then you can use \width{space} and it will extract the width of the
space regardless of whether it is encoded or not.

Best,
v.