Adobe Illustrator obviously ignores any metrics values stored in the font to calculate the height of a text frame (point type). It rather uses the bounding box.
But that is not the full story. Illustrator seems to use a subset of glyphs for the bbox‽
There are glyphs that change the frame height.
What is going on under the hood of Illustrator?
How can I prepare my fonts that the frame always shows the same height?
Comments
With this method, it’s good to consider the boldest weight first.
what do you mean with “use as the vertical limit”? Do you limit your bounding box, thus your design, for every parenthesis, integral or even swash letter? Do you always increase the lighter Å to the bold height?
Adrien,
you’re right somehow. I changed the integrals due to a special customer request. But the shown example is made with a single font.
Frode,
with the Illustrator text tool you can just klick and type, whereby the frame is generated depending on the text.
Software care about the Bbox, as defined in your TypoAscender/Descender, WinAscent/Descent, hhea Ascender/Descender and LineGap values.
In FontLab you can configure those values under: Font Info -> Metrics and Dimentions -> TrueType-Specific metrics. Sadly many people don't know or don't care about it, and just leave the automatically calculated values.
In Glyphs app, you can configure it using custom parameters.
The uncomfortable truth however is that there is lots of ambiguity about how to define the vertical dimensions in the OS/2 table, and also how certain software interprets these values again. See for instance this explanation at the Glyphs website that lists different strategies. And then I am not even talking about different strategies for webfonts such as these advised by the Google Font Directory.
No snake oil here, but a muddy minefield instead.
these are the known (and confusing) values that Illustrator obviously ignores.
Or am I wrong?
This is what I do:
1) Make sure that the BBox is not greater than 125% of the UPM:
For example, if the UPM is 1000 units, the sum of TypoAscender + TypoDescender should not exceed 1250.
2) Unify values (To reduce ambiguity in the how the software handle those values):
TypoAscender = WinAscent = hhea Ascender
TypoDescender = WinDescent = hhea Descender
LineGaps = 0 (both)
Sample attached
You can choose whatever values make sense for your font. Just make sure they are not bigger than 125% UPM, and keep them consistent in all the 3 places.
It's from another font (Different values, but same strategy).
It presents a clear methodology and works well in end-user applications in my experience.
Similarly, I make the bottom of the Commaaccent as the WinDescent And hhea.Descender value.
This ensures* consistency of the Bounding Box, irrespective of issues concerning TypoLineGap.
I make the total of Typo values = 1000, with TypoLineGap then being the difference between 1000 and WinAscent+WinDescent. Giving TypoLineGap a value other than zero apparently causes some minor inconsistencies between certain browsers and devices, as Pablo notes.
*Unless big swashes and flourishes are in the font.
Which works only for simple Latin fonts.
I can't say about other scripts such as Arabic, etc... since I have no experience in those.
✒︎ The point where I clicked with the text tool becomes the baseline.
✒︎ From there Illustrator places the top of the text frame at around 83,5 % of the point size.
That seems to be independent from any font values. Attention: when a higher glyph occurs while typing, Illustrator adjusts the text frame height (see screenshots in the initial post).
✒︎ The bottom of the text frame is calculated as the lowest glyph part in the font. That may correspond with the yMin value in the head table. But obviously Illustrator ignores that and measures by itself.
Is there somebody who can confirm, complement or correct that?
The box around the text that you get with point type is only there to allow you to scale, skew, or rotate the text. You can't use it to align to other objects. It only appears when you select the text with the selection tool. The only part of point type that can be used for alignment is the origin point, that is, the point where you originally clicked. It's at the left end, middle, or right end of the baseline of the first line of text, depending on whether the text is left, center, or right aligned. The size of the bounding box is unrelated to any metrics in the font. It only needs to be a convenient size to manipulate and large enough not to obscure the text. Things like baseline shift or larger characters will cause it to grow larger.
When you create area type by dragging out a box with the text tool, the distance from the distance from the baseline to the top of the box is always equal to the ascender height of the font, or the tallest ascender if there are multiple fonts or type sizes on the line. This distance stays the same regardless of leading or baseline shift. A text box like this can only be aligned using the edges or corners of the box.
But in one point you are wrong: This point type box is not only for scale-skew-rotate, but also for alignment. Which may result in difficulties. (I tested CS3 and CS5, does CC behave different?)
As you mentioned: when a higher glyphs comes up, the top border of the box shifts.
Top align then results in useless mess.
And that’s the reason why I was asking. My client has many point text boxes in many charts and wants to substitute old fonts with my new one. Some boxes are aligned at the top, some are at the bottom, some are not aligned.
It seems to turn out that I have to limit the overall BBox, thus omit some tall glyphs …
There is a way: If you want to use the alignment buttons with type, use area type instead. Alignment will be based on the text box you create. As long as all the instances of area type have the same type size and font, they will align perfectly, including along the baseline.
Alternatively, if you want to keep using point type, use the direct selection tool to select the handle on the baseline of the text and align using smart guides. It's not as efficient, but it works.
As I am the type designer and not the Illustrator user I come to the conclusion that I have to limit the bounding box for design. In short: I will offer a subset font with fewer glyphs.