Apple Keynote: Scaling Text When Resizing Groups of Objects
Keynote.app is my favorite tool for creating presentations. Of course, it’s not perfect… but there’s one unforgivable omission: it doesn’t provide the functionality to scale typography when enlarging or shrinking grouped elements.
I’m sharing a solution I found that keeps elements editable (unlike solutions based on exporting and reimporting as an image).
TL;DR: Summary of the Method
The method is based on Keynote correctly scaling the texts when changing the document dimensions.
Step by step:
- Select and copy the elements. Take note of the size of the set.
- Create a new presentation. Adjust the document size to the larger dimension (width or height) of the set.
- Paste the elements into the new presentation. Change the document size to the desired maximum dimension (width or height).
- Now we have scaled and editable elements. Copy them back to the original presentation.
The Problem
For this example, I’ll use an illustration I prepared for a class, where I translated to spanish Jared Spool’s design decision methods model:
When grouping the elements, we get an object of 1126 x 620 px:
Let’s see what happens when we try to resize it.
For instance, to make it 800px wide, we enter “800” in the corresponding box and get… this:
Shapes, rectangles, and/or images in the group scale in size. But texts don’t: the typography remains the same size. So, we end up with a bunch of text boxes framing words that don’t fit.
Searching on Google, I found many bad solutions. For example, exporting the slide as a PDF (or copying and pasting in Preview, and exporting PDF from there). Then inserting that PDF into the presentation, losing the ability to edit it. From that point on, every change we need to make in the illustration becomes a hassle: finding the document version where the illustration was, editing the slide again, creating a PDF of it, including it again…
I researched until I found a better way.
The Solution
Start by grouping the elements, copying them to the clipboard (⌘C), and take a quick mental note of the largest dimension reported by the Inspector.
In this case, as the group is wider than it is tall, the largest dimension is the width: 1126 px. We make a mental note of that.
Now, create a new document. The template doesn’t matter; for this example, I’ll use the first one on the list (“Black”).
The first slide comes with a title and subtitle.
As they will be in the way later, we select them (⌘A) and delete (⌫). Alternatively, we change the slide style to “Blank”.
Now, go to the “Document” section of the Inspector.
Under “Slide Size,” choose “Custom Size.” When the dialog box appears, enter the dimension you had originally observed.
In this case, we had mentally noted the width: 1126 px.
So, we enter that value as both width and height, and click OK.
Now, on our blank document of 1126 x 1126 px, paste (⌘V) the group of elements we copied at the beginning;
Now, we just have to change the width and height of the document to the largest size we want our group of elements to be.
In this example, we want the illustration to be 800 px. wide.
So, we enter that measurement, 800 px, as the width and height of the document:
It turns out that Keynote does scale the size of the texts when scaling the document.
So, in this new presentation... we effectively have our group of elements, scaled to the size we wanted! 😀🎉
Copy it (⌘C), paste it into the presentation (⌘V), and mission accomplished 😎
I hope this solution is as useful to you as it was to me.
See you in the comments!
Postscript
You might wonder, why create a square document with the larger dimension? Why not create it with the exact size of the original element (in this example, 1126 x 620 px)?
It could be. But:
- We would have to remember two numbers instead of just one.
- When resizing the document, should we enter… also two values, calculating simple three-rule for the second value?
It’s more practical to remember just one number.
By using it as both width and height, we ensure that the document scales while maintaining the proportion. For the document, it will be square; for the element, the correct one.
Postscript to the Postscript
You might wonder, if it can be done manually, why not automate it?
Turns out I tried to automate this solution using AppleScript. But the implementation of Keynote (at least the version running on my machine) leaves much to be desired.
So, it is left as an exercise for the reader 😘
Update: AppleScript to create the temporary Keynote document
Although my Keynote.app version throws an AppleScript error when trying to “get the selection” (in order to get its width & height, copy it, etc), creating a new document with an arbitrary size worked OK.
So, for those of you who are handy with Script Editor, have the script menu in the menu bar and other nerdy stuff, here goes the AppleScript code:
tell application “Keynote 801”
activate
-- This block is our "UI": a dialog box with input validation.
set listo to false
set lePrompt to "Size (width and height) of the new Keynote document?
Between 200 and 6000 px."
repeat until listo
set pregunta to display dialog lePrompt default answer “200”
set respuesta to text returned of pregunta
-- If the answer is not numeric, we avoid execution error; in the next block we take it as out of range.
try
set respuesta to respuesta as integer
on error
set respuesta to -1
end try
-- We verify that the answer is within the range; if not, we ask again.
if respuesta ≥ 200 and respuesta ≤ 6000 then
set listo to true
else
set lePrompt to "Incorrect Size :(
Size (width and height) of the new Keynote document?
Between 200 and 6000 px."
end if
end repeat
-- This block is the functional part: creating a new document with the "respuesta" measure.
set customWH to respuesta
set newDocument to make new document
set height of newDocument to customWH
set width of newDocument to customWH
end tell