Skip to content

Commit ccaf6ac

Browse files
committed
[README.md] add baseline to baseline distance calculation documentation
1 parent ebf028b commit ccaf6ac

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,35 @@ $ font-line report TheFont.ttf > font-report.txt
169169

170170
You can modify the `font-report.txt` file path above to the file path string of your choice.
171171

172+
#### Baseline to Baseline Distance Calculations
173+
174+
Baseline to baseline distance (BTBD) calculations are performed according to the [Microsoft Recommendations for OpenType Fonts](https://docs.microsoft.com/en-us/typography/opentype/spec/recom#baseline-to-baseline-distances).
175+
176+
##### hhea Metrics
177+
178+
```
179+
BTBD = hhea.Ascent + abs(hhea.Descent) + hhea.LineGap
180+
```
181+
182+
##### typo Metrics
183+
184+
```
185+
BTBD = OS/2.typoAscent + abs(OS/2.typoDescent) + OS/2.typoLineGap
186+
```
187+
188+
##### win Metrics
189+
190+
```
191+
BTBD = OS/2.winAscent + OS/2.winDescent + [External Leading]
192+
```
193+
194+
where external leading is defined as:
195+
196+
```
197+
MAX(0, hhea.LineGap - ((OS/2.WinAscent + OS/2.winDescent) - (hhea.Ascent - hhea.Descent)))
198+
```
199+
200+
172201
### Vertical Metrics Modifications
173202

174203
font-line supports automated line spacing modifications to a user-defined percentage of the units per em metric. This value will be abbreviated as UPM below.

0 commit comments

Comments
 (0)