Select to view content in your preferred language

Annotations: How are the extents calculated?

155
2
a week ago
AlfredBaldenweck
MVP Regular Contributor

This is an out-there question, but

How is the shape of an annotation determined from the text of the annotation? Or, given a textbox of a height of X, how can I determine the font size of the text inside?

I can't find any sort of consistent buffer, like "The box is always 1.25x the height of the text string" or something. Nor does the relationship appear to be consistent between the same text string at different reference scales.

 

How do we get from this blue hatched box (minimum bounding of the annotation text) to this red box (Annotation shape)?

AlfredBaldenweck_0-1766087755438.png

 

0 Kudos
2 Replies
VenkataKondepati
Regular Contributor

the red box isn't tracking the "ink"—it’s tracking the typography metadata.

Think of it this way:

  • The Blue Box (Ink): This is just the "visible" height of the characters you typed. If you type "aaa," it’s short; if you type "Agy," it’s tall.

  • The Red Box (Shape): This is the Em Square. Every font file (like Arial or Calibri) has an internal "logical height" that includes the Ascent (space for tall letters), Descent (space for tails like 'y'), and Leading (the gap so lines don't touch).

The reason it feels inconsistent is that the red box is fixed to the Font Size, not the characters. Even if you only type a period ".", the red box stays the full height of the font's design space.

To get the font size from a box height ($X$):

You can't just measure the box because every font has a different "internal padding." However, a good rule of thumb for standard fonts is that the Font Size (pts) is roughly 70–80% of the total height of that red box (when measured in points).

If you want the exact math, you have to factor in the Reference Scale, because that red box is stored in map units, but font size is defined in points.

Debert
by
Frequent Contributor

Working with Annotations was/is a major pain. I'm still hoping we can publish Annotations as feature class/services some day (fingers crossed).

I am the GIS Coordinator for Iowa Regional Utilities Association.
Find me on Linkedin.
0 Kudos