I have a rectangle with specified dimensions and I'd like to fill it with text, so that the text uses all (well, as much as possible) of the available area.
I tried to do it with
Framed@Pane[
TextCell[ExampleData[{"Text", "LoremIpsum"}],
TextJustification -> 0, TextAlignment -> Center, ImageMargins -> 0],
ImageSize -> 1/2 {1920, 1080}, ImageSizeAction -> "ResizeToFit",
Alignment -> {Center, Center}]
I'm not concerned about the little gaps caused by the TextJustification
option, but ImageSizeAction -> "ResizeToFit"
bothers me because it leaves empty spaces at the top and bottom of the rectangle. This becomes more apparent when the rectangle size gets bigger, and I want to make some very large images.
Rectangle size 960x540:
Rectangle size 1920x1080:
I would expect that the font size would increase to fill the empty space, but this does not happen.
StringTake[ExampleData[...], n]
and variedn
with aManipulate
. For some string lengths the font is magnified as expected, for others it isn't. $\endgroup$