# Discrepancy between the size of a font (specified by FontSize) and the generated size by "Spacer" (both claimed to be in printer's points)

The documentation says FontSize specifies the vertical size of a font, in printer's points, and that Spacer specifies a spacer as wide as the number provided in its argument, also in printer's points.

Why then the following two do not have the same width?:

Rotate[Style["X", FontSize -> 50], Pi/2]


what outputs (after rasterization)

and

Framed@Spacer@50


what outputs

I am using this to control gaps for some elements in some plots (namely axes labels, after having set them manually using this) but this is preventing me from adding the amount of space in an automatic way so that everything fits nicely for any plot generated.

Maybe I am missing something very obvious but cannot understand that.

• Might have been introduced in an update a cleaner and more direct way to specify the position of the axes labels in a plot other than the linked method (which is quite hacky)?
– abcd
Sep 1 '20 at 4:36
• perhaps you can do Framed@Style[Invisible@"X", FontSize -> 50] or Framed@Spacer[Rasterize[Style["X", FontSize -> 50], "RasterSize"]]?
– kglr
Sep 1 '20 at 5:18

On my screen at 150% magnification, your spacer seems to be about 50 printer's points in width. Your rotated capital letter "x" is a bit short.

The documentation article ref/FontSize says:

The size of a font is typically taken to be the distance from the top of the highest character to the bottom of the lowest character.

Your capital "x" goes as high as any character but it doesn't go as low as some. That's because it has no descender. So let's look at how things look if we use text with characters occupying the whole vertical space and see how that shows compared to the 50-pt spacer.

Column[{Framed @ Rotate[Style["ly", 50, "TR"], Pi/2], Framed @ Spacer@50}]


The output looks like so:

The two frames now are very close in width—maybe differing by a printer's point. The small difference may result from rounding that happened during the calculation of the fram size, but that is pure conjecture on my part.enter code here

• Try it with CurrentValue["FontLineHeight"]. You'll have to reorg the example a bit and wrap the Spacer in Dynamic. Sep 1 '20 at 12:49
• I've also learnt the options FrameMargins and ContentPadding apparently also play a role in this issue.
– abcd
Sep 5 '20 at 22:57