What's the rectangle surrounding a font glyph, including its sidebearings, called?
arrybarry
Posts: 4
What's the rectangle surrounding a font glyph, including its sidebearings, called? I Googled the words "bounding box" and got conflicting results, where some sources say it's the rectangle that bound the glyph tightly (without sidebearings), and others say it includes sidebearings.
Tagged:
0
Comments
-
If we are to take terminology from metal type, it should be called the body. Otherwise, I think there isn't a term because the idea is not particularly meaningful. The vertical metrics are not "bearings" per se and they don't work in the same way.
3 -
K Pease said:If we are to take terminology from metal type, it should be called the body.K Pease said:The vertical metrics are not "bearings" per se and they don't work in the same way.
Notice in this illustration, the vertical text is much more cramped than the horizontal one. This is all because of the character 一 (in red): it has very little space for its horizontal bearings, but lots of space for its vertical bearings. All that space is completely collapsed here with tsume set at 100%, meaning 100% of all bearings is discarded.0 -
Bounding box, abbreviated bbox, is used in image processing for a simple geometric hull in the shape of a rectangle parallel to the coordinate system of the background ("canvas").
It should be used only in this meaning to avoid confusion.
1 -
I see, that makes sense. Having a strictly left-to-right script with ascenders, descenders, and diacritics makes our ideas of a font's full vertical dimension much more unclear, which is why digital type contains multiple values for vertical metrics that do not necessarily agree with one another, made to accommodate different computer systems and subsystems.I was surprised by your example of tsume, because one thing I thought I had learned from my extremely brief experience with setting Japanese was that the 一 character was supposed to be turned to a vertical line in vertical text. Is that not true?
1 -
K Pease said:the 一 character was supposed to be turned to a vertical line in vertical text. Is that not true?
2 -
@K PeaseIf we are to take terminology from metal type, it should be called the body. Otherwise, I think there isn't a term because the idea is not particularly meaningful. The vertical metrics are not "bearings" per se and they don't work in the same way.
In a key and specific sense, body height works exactly the same way in metal type and digital type, in that it is the height of the body that equals the nominal size of the type. So 10pt metal type has a body that measures 10 points in height, regardless of the size of the character image on that body, and 10pt digital type has a body that has been scaled to 10 points in height, regardless of the size of the glyph relative to that body.
So I still refer to the rectangle defined by left sidebearing and advance width and by em height as the ‘body’.3 -
Bounding box typically refers to the smallest rectangle that contains all of the glyphs control points.5
-
Yehang Yin posted an excerpt from 《排版知识问答》(Typography Q&A’s, by 罗树宝, 1987) in this twitter thread:Although this particular Q&A is on “kerns” (in metal types), the first sentence in the answer actually reads “the form of a [metal] type in which the strokes [of the letter] protrude the body is called a kerned type.” The word 字身 means literally “character body”. The illustration shows an italic lowercase f, which is clearly proportional-spaced. The “kerns” in metal types are somewhat equivalent to “negative side-bearings” in digital types. So, the rectangle that includes side-bearings (even if they are negative) is indeed called “body”.In proportional Latin (metal) types, the width of each letter differs, but the height of the body on which each letter is casted remains constant—this height equals 1em. It is actually very common for the baseline to vary within the body, between typefaces of the same size. This agrees with John’s terminology.“Bounding box” usually refers to the minimum rectangle that covers the “ink” of the letter, so to speak. For letters that have positive side-bearings on all four sides, their bounding boxes will be completely inside their bodies. Stacked accents on uppercase or fancy swash in italic can protrude the body, on any sides, so these will have bounding boxes that also protrude the bodies.3
-
K Pease said:[…] the 一 character was supposed to be turned to a vertical line in vertical text.arrybarry said:It's actually the character ー, or chōonpu, that rotates.
The constructions of U+30FC in the Mincho style follow ink brush calligraphy in horizontal and vertical text—how one would actually write it. They are not simply 90-degree rotations of each other.Peter Constable said:Bounding box typically refers to the smallest rectangle that contains all of the glyphs control points.
Source: tikz-bbox manual.1 -
Ruixi Zhang said:The constructions of U+30FC in the Mincho style follow ink brush calligraphy in horizontal and vertical text—how one would actually write it.0
-
Ruixi Zhang said:Peter Constable said:Bounding box typically refers to the smallest rectangle that contains all of the glyphs control points.
Source: tikz-bbox manual.0 -
From the OT spec:
"Note that the bounding rectangle from each character is defined as the rectangle with a lower left corner of (xMin, yMin) and an upper right corner of (xMax, yMax). These values are obtained directly from the point coordinate data for the glyph, comparing all on-curve and off-curve points."
That certainly doesn't ensure a box that's tight to the curve, but it's very quick to compute.0 -
Peter Constable said:From the OT spec:
"Note that the bounding rectangle from each character is defined as the rectangle with a lower left corner of (xMin, yMin) and an upper right corner of (xMax, yMax). These values are obtained directly from the point coordinate data for the glyph, comparing all on-curve and off-curve points."
That certainly doesn't ensure a box that's tight to the curve, but it's very quick to compute.Craig Eliason said:For what it's worth, if that curve had nodes at the horizontal and vertical extrema (common and recommended practice), all would fit inside that box on the right.1 -
An important question to consider is what the purpose is for obtaining a bounding box. For some purposes, it may or may not be worth the perf cost to calculate a tight box.0
-
I always thought this recommended practice is a direct consequence of the lazy algorithm: Instead of asking engineers to implement an algorithm that is mathematically correct, we ask designers to add on-curve points at extrema and to make sure that off-curve points stay within those triangular areas.Yes, the extrema recommendation is partly to enable this quick and easy calculation of an accurate bounding box, but the other important reason for it has been hinting.
1 -
It’s very important to have a bounding box of consistent height throughout a type family. (This may require some funny business, such as positioning a light weight cap accent higher than it really should be.)
Two reasons for this:
1) For consistent positioning of the baseline within a formatted text box, whatever weight or style of a typeface is used.
2) For precise alignment of layers, in layered font effects.
I don’t understand why the baseline isn’t used by layout apps to position type.0 -
Nick Shinn said:
I don’t understand why the baseline isn’t used by layout apps to position type.
I have never seen a layout app that did NOT use the baseline to position type, in any app that allows one to switch fonts or point sizes on the same line.
I am sure you know this, so you must mean… something else. I am curious as to what that something else is, exactly.0 -
I am guessing that Nick is referring to the way in which the distance of the baseline from the top of the text frame is generally determined by metrics that are not standardised across font families, and hence will vary between text frames if one inserts a character from a font with taller metrics into the top line of text.3
-
Right, that makes sense. I don’t really see a good alternative to that status quo, unless the app deals with it by reserving a really large amount of space above, or allows the text to exceed the top of the frame. I am sure both those options (and perhaps others) have been considered and discarded.0
-
True. But that doesn’t stop me from being uncomfortable with layout software that positions type according to a hard-to-visualize “guide line” determined by a rarely-used upper case diacritic, rather than the baseline the major letters stand upon.
On a positive note, certain distributors, notably Adobe and Monotype, have rigorous font-testing apps applied to typeface submissions, which flag inconsistencies in vertical metrics within a font family. This addresses bounding box issues, putting the onus on foundries to “get it right”.
0 -
Nick Shinn said:True. But that doesn’t stop me from being uncomfortable with layout software that positions type according to a hard-to-visualize “guide line” determined by a rarely-used upper case diacritic, rather than the baseline the major letters stand upon.
Rarely-used by us English-speakers, maybe. But since you agree that there is no viable alternative, maybe you need to get comfortable with it?
On a positive note, certain distributors, notably Adobe and Monotype, have rigorous font-testing apps applied to typeface submissions, which flag inconsistencies in vertical metrics within a font family. This addresses bounding box issues, putting the onus on foundries to “get it right”.
Such tests have been around a long time, and are used by many others as well. But they don’t make fonts perfectly consistent _across_ families, only within families.0 -
Rarely-used by us English-speakers…
I was alluding to characters such as Aringacute.
And Abrevehook, which is comparatively rare in Vietnamese—that is the tallest Latin character I’ve had to deal with, especially in Bold weight.But since you agree that there is no viable alternative,
I agreed with you that options had been tried and discarded, not that there is no other way to do things.maybe you need to get comfortable with it?
I’m more comfortable with analogue, and software that bears some resemblance to the physical world, you’ll never get me in a VR headset!0 -
Right, that makes sense. I don’t really see a good alternative to that status quo, unless the app deals with it by reserving a really large amount of space above, or allows the text to exceed the top of the frame. I am sure both those options (and perhaps others) have been considered and discarded.A lot of line layout in software is really dumb and can’t paint glyphs outside the text frame and allows subsequent lines to overwrite white space on previous lines, causing clipping if tight linespacing is used.
InDesign has an option to define the distance from the top of the text frame in terms of leading, which gives a fixed distance to the first baseline regardless of what mix of fonts is used. That is sensible and also means that one can set up an easy text frame baseline grid (unlike the utterly annoying baseline grid that InDesign tries to apply at the document level). Of course, this presumes a line layout model that is able to handle painting glyphs that extend beyond the text frame.
2 -
I’ve always called this space the “window” or “glyph window.” It never occurred to me that it would have a different name, though I can’t remember ever discussing it with anyone or hearing it called something else.
0 -
Nick Shinn said:True. But that doesn’t stop me from being uncomfortable with layout software that positions type according to a hard-to-visualize “guide line” determined by a rarely-used upper case diacritic, rather than the baseline the major letters stand upon.
They also had combining accents as separate characters for Hebrew and puzzled them together with non printing material. That's documented in the layouts of the wooden matrices e.g. in Gessner, 1744.
TextEdit on Mac allows the definition of line distance and seems to add or subtract space on top of the virtual body. Vertical alinement is along the base line.
Looks like this:
0 -
Peter Constable said:An important question to consider is what the purpose is for obtaining a bounding box. For some purposes, it may or may not be worth the perf cost to calculate a tight box.
In image processing with rasterised images (pixels) it is simple to get a bounding box. It also can be done from a scanned page of text.0 -
Helmut Wollmersdorfer said:Peter Constable said:An important question to consider is what the purpose is for obtaining a bounding box. For some purposes, it may or may not be worth the perf cost to calculate a tight box.0
-
I call that box the metrics because it's the maximum limit of a glyph's metrics in four directions. When I'm dealing with some TV caption fonts, I keep my italics inside the metrics. Sometimes my Vietnamese cap accents go outside the metrics.2
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 803 Font Technology
- 1K Technique and Theory
- 622 Type Business
- 444 Type Design Critiques
- 542 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 485 Typography
- 303 History of Typography
- 114 Education
- 68 Resources
- 499 Announcements
- 80 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 270 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports