Hi, in the gnuplot module the following macro is used for the TikZ terminal: \def\calculateGNUPLOTcharsize{% \global\GNUPLOThcharsize=1.05\fontcharwd\font`0% \global\GNUPLOTvcharsize=1.05\fontcharht\font`0% \global\advance\GNUPLOTvcharsize by 1.05\fontchardp\font`g% } What are \font`0 and font`g? AFAIK the backtick converts the character to the character code, which means it yields \font48 and \font103. The goal is to get the current font, right? Why is the current font width and height addressed with `0 and the depth with `g? And when do `0 and `g result in different values? In my tests they were always the same. Marco
On Thu, May 9, 2013 at 11:58 PM, Marco Patzer wrote:
Hi,
in the gnuplot module the following macro is used for the TikZ terminal:
\def\calculateGNUPLOTcharsize{% \global\GNUPLOThcharsize=1.05\fontcharwd\font`0% \global\GNUPLOTvcharsize=1.05\fontcharht\font`0% \global\advance\GNUPLOTvcharsize by 1.05\fontchardp\font`g% }
What are \font`0 and font`g? AFAIK the backtick converts the character to the character code, which means it yields \font48 and \font103. The goal is to get the current font, right?
I believe it gives you width/height/depth of character 48/103 in current font. But I'm not sure how exactly all this works.
Why is the current font width and height addressed with `0 and the depth with `g?
Simply because the glyph for "0" usually doesn't stick below the baseline and would normally have the depth zero. Using the number "0" for width and height on the other hand becomes important as it represents the exact width (and height) when using numbers with "tabular" (not proportional) width.
And when do `0 and `g result in different values? In my tests they were always the same.
Almost always. Do you have a minimal example that shows otherwise? Mojca
On 2013–05–10 Mojca Miklavec wrote:
What are \font`0 and font`g? AFAIK the backtick converts the character to the character code, which means it yields \font48 and \font103. The goal is to get the current font, right?
I believe it gives you width/height/depth of character 48/103 in current font. But I'm not sure how exactly all this works.
Why is the current font width and height addressed with `0 and the depth with `g?
Simply because the glyph for "0" usually doesn't stick below the baseline and would normally have the depth zero.
I didn't get that it addresses a particular glyph.
Using the number "0" for width and height on the other hand becomes important as it represents the exact width (and height) when using numbers with "tabular" (not proportional) width.
And when do `0 and `g result in different values? In my tests they were always the same.
Almost always. Do you have a minimal example that shows otherwise?
I only tested the width or different fonts in different sizes, but not the depth. Now the `g actually makes sense. Thanks for the clarification, Mojca. Marco
participants (2)
-
Marco Patzer
-
Mojca Miklavec