3

When we set the fontsize to be 20 points I am wondering which size of the fbox bonding box enclosing a letter is 20 points. To understand I write a code as below and there are two main questions I have:

  1. Although I set the fontsize to be 20, neither the width nor the height of the letter bonding boxes are 20 points (they are smaller) for both lower case and upper case letters. So which size in the fbox is 20 points?
  2. I also change the line spacing to be 20 but we see the spacing between the baselines are around 40 points, why? enter image description here
 \documentclass{book}

\fboxrule=0.1pt
 \fboxsep=-\fboxrule
\usepackage{xcolor}
\renewcommand\fbox{\fcolorbox{red}{white}}

\usepackage[grid,
gridcolor=blue!60!white,
subgridcolor=green!40!white,
gridunit=pt]{eso-pic}

%\usefont{<encoding>}{<family>}{<series>}{<shape>}
%\fontsize{size}{skip}

\newcommand{\myfont}{\usefont{T1}{cmr}{m}{n}\fontsize{20}{20} \selectfont}

\begin{document}
\myfont 




  \fbox{a}\fbox{b}\fbox{c}\fbox{d}\fbox{e}\fbox{f}\fbox{g}\fbox{h}
  \fbox{i}\fbox{j}\fbox{k}\fbox{l}\fbox{m}\ 
  fbox{n}\fbox{o}
  \fbox{p}\fbox{q}\fbox{r}\fbox{s}\fbox{t}\fbox{u}\fbox{v}\fbox{w}\fbox{x}\fbox{y}\fbox{z}\\

 \fbox{A}\fbox{B}\fbox{C}\fbox{D}\fbox{E}\fbox{F}\fbox{G}
\fbox{H}\fbox{I}\fbox{J}\fbox{K}\fbox{L}\fbox{M}
\fbox{N}\fbox{O} 
 \fbox{P}\fbox{Q}\fbox{R}\fbox{S}\fbox{T}
 \fbox{U}\fbox{V}\fbox{W}\fbox{X}\fbox{Y}\fbox{Z}\\
   \end{document}
2
  • 1
    Answers: 1. For the Computer Modern Roman font, the total height of parenthesis equals its font size. So \fbox{(} or \fbox{)} will have a total height (height plus depth) of 20pt (if you also have \fboxsep=-\fboxrule, of course). 2. \\ causes a manual line break, which becomes an empty line. You end up moving two \baselineskips downward, so there is 40pt of distance between two baselines. Commented Jan 25, 2021 at 1:09
  • 1
    Would you please put your answer below in the answer section? I appreciate your answer.
    – Aria
    Commented Jan 25, 2021 at 1:13

2 Answers 2

3

This answer expands @DavidCarlisle’s answer, but addresses directly to the two questions from the OP.

  1. For the Computer Modern Roman font, the total height of parenthesis (and bracket, brace, slash), without overshoot, is equal to the font size. So in the OP example, \fbox{(} or \fbox{)} will have a total height (height plus depth) of 20 points. I should mention that “font size” is a “nominal value” (see David’s answer). Fun facts: For most Latin/Greek/Cyrillic fonts, it is very rare that any character will have its total height equal to the font size (Computer Modern is an exception. Knuth designed CM this way). However, for most Chinese/Japanese fonts, due to the fact that Hanzi/Kanji characters are written in “squares”, the font size is almost always exactly equal to the character width (more precisely, the horizontal advance for Hanzi/Kanji character).
  2. When you type \\, you are forcing a manual line break, which results in an empty line. So there are two \baselineskips between the two baselines of text; i.e., you end up with 40 points between two baselines.
2

The "font size" is a purely nominal indication of the size of the characters it is a value set by the font designer but it does not necessarily correspond to any measurable length of the characters in the font.

The lines spacing is twice your expected value as you have four lines of text two are empty and give the warnings

 Underfull \hbox (badness 10000) in paragraph at lines 24--28
  
 Underfull \hbox (badness 10000) in paragraph at lines 29--34

you have \\ at the end of the paragraph so forcing a line break so the first paragraph with the lowercase letters has two lines of text, but the second line is empty. Never use \\ at the end of a paragraph.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .