1

I am facing a little confusion regarding how the bounding box around text behaves in Adobe Illustrator.

I would like to align multiple text boxes by snapping along a vertical guide.

I noticed there is a space/offset between the actual text content and the left and right edges of the bounding box due to the glyph/character's side bearings. The larger the character size, the larger the "space" is.

(please note the areas highlighted in yellow in the image below). enter image description here

With this behavior, if I align all text boxes along the guide, although their respective bounding boxes are all aligned and snap into place, the varying side bearing (relative to the character size) of the text makes it seem as if they are not aligned and the text does not appear flush against the guide (this is more prominent on larger font sizes).

There are two workarounds I can think of:

a) Convert the type to outlines, so that the bounding box fits the exact width of the text. This is not an ideal solution since text can no longer be edited.

b) Disable the guide/grid snapping and manually align each text box. Again this does not sound like an ideal solution.

Considering the wide spread use of Adobe Illustrator for print and typography specific designs, I find this behavior counter intuitive and difficult to work with.

I was wondering how others tackle this issue and if there might be a better way to precisely align type of varying font sizes / glyph side bearings.

Thanking you,

  • 1
    That little space is called bearing and it's a typographic feature. See more freetype.org/freetype2/docs/glyphs/glyphs-3.html – Luciano Nov 14 '19 at 12:56
  • @Luciano, Thank you, that is very helpful, I have amended my question to mention the "glyph side bearings" as per your suggestion. I am currently looking into developing a script for illustrator to redact the side bearings by manipulating the kerning of the first and last character so that the bounding box may fit the text content. – Sameer Nov 14 '19 at 14:21
  • oh that's great, sometimes I also would like to align objects to the text content, your script would be very useful! – Luciano Nov 14 '19 at 14:25
  • @Semeer maybe just adjust paragraph options. But this is something the font designer intended to do. – joojaa Nov 14 '19 at 14:26
  • See here: graphicdesign.stackexchange.com/a/51780/3270 It should provide a workaround for the issue without outlining type. – Scott Nov 14 '19 at 18:47
0

Some background

The visible bearing at the start of the line is a side-effect of how digital typography works. In traditional typesetting, lining up the left edge of a typeface was standard practice because, as you've discovered, misaligned left edges can look bad under certain circumstances. When digital desktop publishing became the norm, this tidy visual nicety was sacrificed for the speed and ease of digital software. Why? Because making things look aligned is more complicated than just ignoring the left-bearing on the first character in a line. Certain stacked characters (T and L, for instance) may be accurately lined up without the lead bearing, but will still look off-balance because the combination of character shapes don't have the same visual balance. There's a lot of art that goes into getting things to look balanced which makes it difficult to accomplish automatically. As a result, even "easy" alignment cases such as yours don't get solved.

Modern applications have begun trying to fix this with a feature called optical margin alignment, where the software tries to balance out the characters with some math-magic. Unfortunately, Illustrator isn't intended for typesetting. This is reflected in its very poor OMA feature. I can completely guarantee it won't work well for you here. (If you were using InDesign you'd get very good results. Select the text box and go to the type menu, and select the "story" option. Click the checkbox in the panel that opens and start tweaking the value in the other box until it looks how you want it to.)

The fix

There's a finicky work-around you can use instead: manually kerning the first character of each line. It's a soft-adjustment to the text properties that will enable you to keep the objects snapped to the grid, while achieving the same effect as disabling snapping and making manual adjustments to each box.

  1. Open the character panel (Window > Type > Character)
  2. Place the cursor before the first character in the line
  3. Tweak the kerning up or down 1 by 1 until they line up how you like (the kern option is the V/A icon with a left-arrow under only the A.)
  4. Each line is going to require a different amount of adjustment, so be patient.

Before and After:

Before Kerning

After Kerning

|improve this answer|||||
  • @superliminal Thank you, this is very helpful and insightful. I'm really impressed with your knowledge on the subject. Might I ask, how you have been acquainted with the subject?, as I was curious about what professional background you might have pertaining to typography. The kerning trick is something I discovered by fluke and I am currently developing a script to automate the process. The script works by subtracting the width of the text frame before and after outlining the text for each line, so wont have to manually tweak the first character. Will post back here later with the results. – Sameer Nov 15 '19 at 20:58
  • I have a background in design and print, with the last 6 years of my career being spent as a prepress operator for a commercial offset print group. The script sounds very useful, but as I stated in my response, be careful where you use it since different letter stacks can still look weird even when they are perfectly aligned. Good luck! – superluminal Nov 16 '19 at 21:13
  • Regarding your example, it is not clear a) if the text is written with the type tool (point text) or the area type tool. And b) what effect the kerning has on the bounding box. Apparently adjusting the kerning before the first character behaves differently on point text and area text. With point text, a negative kerning value has no effect on the bounding box, where as with area type a negative kerning value of the first character will infact "shrink" the bounding box. Whether the text is justified left or right also influences the behavior of kerning the first or last characters – Sameer Nov 16 '19 at 22:46
  • My example used point type, but I suspect that it does not matter too greatly if it's area or point type. I did not pay close attention to the size of the bounding boxes (as that didn't seem to matter that much when I initially read your question), other than that the anchor point seems to stay put (though the right/left alignment differences you're seeing are not surprising). – superluminal Nov 17 '19 at 23:37
  • What's the reason you're asking this question if you don't mind my asking? Is it a live project or just something you're looking to solve to speed up future projects? Or is it something else? If either of the first two cases, I highly recommend moving to InDesign as illustrator really isn't suited for type-heavy projects (and if you're writing a script, I have a feeling you have enough type to make manual adjustments annoying). Especially if you're submitting the work to print, the prepress/file management team will greatly appreciate it. – superluminal Nov 17 '19 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.