# What exactly is the custom font’s height-point size-ratio?

**URL:** <https://forum.generic-mapping-tools.org/t/what-exactly-is-the-custom-font-s-height-point-size-ratio/1265>\
**Category:** Q&A\
**Created:** [January 26, 2021, 2:02pm UTC](https://forum.generic-mapping-tools.org/t/what-exactly-is-the-custom-font-s-height-point-size-ratio/1265 "2021-01-26T14:02:27Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [February 25, 2023, 9:58pm UTC](https://forum.generic-mapping-tools.org/t/what-exactly-is-the-custom-font-s-height-point-size-ratio/1265/5 "2023-02-25T21:58:59Z")

</div>

**Down the typography rabbit hole**

Looking at `standard_adobe_fonts.h` I found, among others, this:

```auto
{ "Helvetica", 0.700,	0,	0 },

```

Following Pauls memories I opened my favourite vector graphics program and set a capital letter “N” in the Helvetica font and at 1000pt size. Next, I measured its height digitally in the program. I also printed it on a consumer printer and measured it with my cheap ruler from high school days.

| measurement | mm | pt |
| --- | --- | --- |
| digital | 253.0 | 717.3 |
| printout | 252.4 | _715.5_ |

_The pt value from the printout is calculated from the measured Millimeter value with 1pt = 25.4mm/72dpi = 0.3527777778mm_

I consider a 0.6mm difference between the digital measurement and the analog printout surprisingly accurate.

In general this means that a 1000pt tall capital letter “N” is only 717.3pt tall in reality. That comes pretty close to the `0.700` factor given in `standard_adobe_fonts.h`. Lets check some more values:

| font | given | measured |
| --- | --- | --- |
| Helvetica | 0.700 | 0.7173 |
| Helvetica Bold | 0.709 | 0.7197 |
| Helvetica-Oblique | 0.700 | 0.7173 |
| Helvetica-BoldOblique | 0.709 | 0.7197 |

The difference between the given and measured values is consistent, yet they don’t match. Any ideas? Maybe visual matching when comparing different fonts?

**Typography basics I learnt on the way:**

The font size–contrary to popular belief–is not the actual size of the letters but the size of the so called _em&nbsp;square_. An arbitrary square where all glyphs of a font are sized relative to. And _usually_ also fit into.

 ![em square](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/8/880769104fdb669f819637a1188bbe4335f25aaa.png)  
_visualisation of the_ em&nbsp;square _around the letter_ h _– note how the ascenders as well as the descenders stay within the square. ([source](https://fonts.google.com/knowledge/glossary/em))_

On average the _cap height_ (see image below for terminology) of capital letters is about 70% of the point size, and the _x-height_ of lower-case letters is about 70% of the _cap height_, or about half the point size. But those are only averages, and there is no technical requirement whatsoever that one has to be close to those averages.

That’s where the elusive _font-size ratio_ comes into play. To scale two different fonts in a visually similar way for a given point size, we need to know how tall the _cap height_ is in relation to the _em&nbsp;square_. As the _cap height_ of capital letters is about 70% of the point size, we get a _font-size ratio_ of `0.700` as a base line. That’s apparently where the default value comes from. One could argue that scaling based on _x-height_ would me more accurate but that seems not to be used here.

 ![names of different line heights in a font](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/3/31f9f47857f04a0fae18f5fc144424a4ab57ef25.png)  
_some font terminology ([source](https://fonts.google.com/knowledge/choosing_type/exploring_x_height_the_em_square))_

---

_[View the full topic](https://forum.generic-mapping-tools.org/t/what-exactly-is-the-custom-font-s-height-point-size-ratio/1265)._
