Fontsize independent text width
For a particular book, I have a style sheet that defines:
p {
font-family: Arial, "sans-serif";
font-size: 21pt;
margin-left: 2.7em;
margin-right: 2.7em;
text-align: left;
}
I also have a version with smaller font size:
p {
font-family: Arial, "sans-serif";
font-size: 18pt;
margin-left: 5.1em;
margin-right: 5.1em;
text-align: left;
}
In either version, the word breaks of the text are at exactly the same places. In other words, the page looks exactly the same in both versions except for the size (and margins).
To make the style settings independent of the font size, I want to use max-width instead of margin-right. Some experimenting reveals that I have to use max-width: 26.4em for the 21pt version, and 26.9em for the 18pt version. This is surprising, since I'd expect exactly the same value for both versions. max-width is expressed in terms of em so it should be independent of the font size. 0.5em difference is just too much to ignore.
What am I missing in the calculations?
|