How to detect the length of the tallest letter and that of the deepest letter of the current font size?

the strutbox is defined to exactly the height of \baselineskip which is the smallest value including the interlinespace of a row. However, you have to redefine every time the strutbux when changing the fontsize. This is the reason why it makes no sense to have an own strut value. Use instead the \vphantom macro:

\def\mystrut{\vphantom{Äg}}

One problem is that the font metrics do not include appropriate dimensions for this. The code below provides a short macro for displaying the font dimensions.

\documentclass[10pt]{article}

\usepackage{graphicx, booktabs, tabularx, scalefnt, xcolor} 


\begin{document}
\def\displayfontmetrics#1{\medskip
\noindent 
\begin{table}[htbp]
\begin{tabular}{lcl}
\toprule
  Parameter  & Description & Value\\
\midrule
  fontdimen1 & slant &  \the\fontdimen1\font\\
  fontdimen2 &interword space  &  \the\fontdimen2\font\\
  fontdimen3 &interword stretch &  \the\fontdimen3\font\\
  fontdimen4 & interword shrink &  \the\fontdimen4\font\\
  fontdimen5 & x-height &  \the\fontdimen5\font\\
  fontdimen6 & quad width &  \the\fontdimen6\font\\
  fontdimen7 & extra space &  \the\fontdimen7\font\\
\bottomrule
\end{tabular}
\caption{Font metrics for font #1}
\end{table}
\medskip}


\scalebox{2}{ H\'AMB\"URG\'E\c F\'ON\c ST\'IV}

\scalebox{2}{ \lowercase{H\'AMB\"URG\'E\'ty\c F\'ON\c ST\'IV}}

\end{document}

One solution is to use a vphantom which you can use as a strut.

\def\Z{\vphantom{y\vphantom{\'l}}}

\colorbox{yellow}{\Z abcdy}

Tags:

Lengths