‘Ultrafluid’ Line Wrap in InDesign
January 28, 2015 | Extras | en | fr
A typographer friend of mine wonders about the most convenient way to create text samples having arbitrary line wraps without hyphenation. Such layout is commonly used in foundries when preparing typographical specimens. Customers should be able to visualize the native behavior of the typeface without justification artifacts, therefore the sample text must be left-justified with no custom tracking/kerning/scaling applied…
From then, the crucial problem is to arrange realistic text snippets while preserving the optical balance of fully-justified composition. But since the use of a smart justification engine is proscribed, this problem leads to a puzzle that only advanced algorithms can solve. In the screenshot below, for instance, we see how a fontsquirrel.com's specimen is presented in several sizes, each line giving the illusion of a perfect aesthetic balance despite left alignment:
I won't go here into the study of those algorithms—albeit very challenging topic for InDesign scripters—but one can at least discern an approximate solution, based on a simple GREP Find/Change process.
Our goal is modest. We don't try to achieve a perfect right-alignment of the text (which only remains left-aligned) but we want to make it as ‘fluid’ as possible. That is, every character, no matter its location in a word, can freely flow from line to line without ever causing hyphenation. (Of course no hyphen should appear in the frame.)
The trick is based on appending after each character a discretionary line break (InDesign terminology), i.e. the Unicode character U+200B ZERO WIDTH SPACE
.
Note. — On InDesign special characters, give a look at this detailed PDF.
The GREP encoding of the discretionary line break being ~k
, all you need to do is to grab .
(any character) then replace it by $0~k
as shown below:
Should you have to edit the source text? Just remove the hidden characters by reversing the query: find ~k
and change it to nothing (empty field).
Note. — If you plan to use this technique repeatedly, save the GREP code in your set of predefined queries.
Comments
Très joli résultat que l'"ultrafluidité" ainsi créée !
Une astuce à conserver en mémoire, sans aucun doute.
Absolument génial.
Merci aussi pour le rappel des caractères spéciaux.
I have downloaded IndexMaticTry.jsx, loaded it into InDesign Scripts Panel folder (Mac). When I try and use it I am not getting a Scope panel come up -- only Scripts, Script Panel and Data Merge. Help please., Christine
@ Christine
Well, your question is somewhat off-the-topic ;-)
Anyway. IndexMatic is not supposed to setup a 'Scope panel' in InDesign. This so-called 'panel' is just an area ('SCOPE') visible in the main dialog of IndexMatic.
Now, in order to execute IndexMatic, go into your Scripts panel (InDesign), open the User branch, then double-click IndexMaticTry.jsx.
Hope that helps.
Regards,
Marc
Absolument dingue