Skip to content

Commit 06c53eb

Browse files
committed
updated readme for v0.6.0
1 parent eaef4d5 commit 06c53eb

File tree

1 file changed

+43
-14
lines changed

1 file changed

+43
-14
lines changed

README.md

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,17 @@ You can modify `font-report.txt` to the file path of your choice.
143143

144144
#### Vertical Metrics Modifications
145145

146-
font-line supports automated line spacing modifications to a user-defined percentage of the TypoAscender to TypoDescender metric (often defined with the same value as the font units per em metric). This delta value will be abbreviated as TA:TD below.
146+
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.
147147

148148
##### `percent` Sub-Command Usage
149149

150-
Enter the desired percentage of the TA:TD metric as the first argument to the command. This should be *entered as an integer value*. Then enter one or more font paths to which you would like to apply your font metrics changes.
150+
Enter the desired percentage of the UPM as the first argument to the command. This should be *entered as an integer value*. Then enter one or more font paths to which you would like to apply your font metrics changes.
151151

152152
```
153153
$ font-line percent [percent change] [fontpath 1] <fontpath ...>
154154
```
155155

156-
A common default value used by typeface designers is 20%. To modify a font on the path `TheFont.ttf` to 20% of the TA:TD metric, you would enter the following command:
156+
A common default value used by typeface designers is 20% UPM. To modify a font on the path `TheFont.ttf` to 20% of the UPM metric, you would enter the following command:
157157

158158
```
159159
$ font-line percent 20 TheFont.ttf
@@ -163,31 +163,60 @@ Increase or decrease the integer value to increase or decrease your line spacing
163163

164164
The original font file is preserved in an unmodified version and the modified file write takes place on a new path defined as `[original filename]-linegap[percent].[ttf|otf]`. The path to the file is reported to you in the standard output after the modification is completed. font-line does not modify the glyph set or hints applied to the font. See the Details section below for a description of the OpenType table modifications that occur when the application is used on a font file.
165165

166-
You can inspect the vertical metrics in the new font file with the `report` subcommand (see Usage above).
166+
You can inspect the vertical metrics in the new font file with the `report` sub-command (see Usage above).
167167

168168
##### Details of Font Metrics Changes with `percent` Sub-Command
169169

170-
The interpretation of these multiple vertical metric values is platform and application dependent. This has led to [debate over the 'best' approach to cross-platform typeface line spacing](https://grahamwideman.wikispaces.com/Font+Vertical+Metrics). The line spacing modification approach used in font-line is defined with a slightly modified version of Karsten Lücke's approach that is described [here](http://www.kltf.de/downloads/FontMetrics-kltf.pdf).
170+
The interpretation and display of these multiple vertical metrics values is platform and application dependent. [There is no broadly accepted "best" approach](https://github.com/source-foundry/font-line/issues/2). As such, font-line attempts to preserve the original metrics design in the font when modifications are made with the `percent` sub-command.
171171

172-
*The following values are preserved from the original font design*:
172+
font-line currently supports three commonly used vertical metrics approaches.
173173

174-
- [OS/2] TypoAscender
175-
- [OS/2] TypoDescender
174+
**Vertical Metrics Approach 1**:
175+
176+
Where metrics are defined as:
177+
178+
- [OS/2] TypoLinegap = 0
179+
- [hhea] linegap = 0
180+
- [OS/2] TypoAscender = [OS/2] winAscent = [hhea] Ascent
181+
- [OS/2] TypoDescender = [OS/2] winDescent = [hhea] Descent
182+
183+
font-line calculates a delta value for the total expected height based upon the % UPM value defined on the command line. The difference between this value and the observed number of units that span the [OS/2] winAscent to winDescent values is divided by half and then added to (for increased line spacing) or subtracted from (for decreased line spacing) each of the three sets of Ascender/Descender values in the font. The [OS/2] TypoLinegap and [hhea] linegap values are not modified.
184+
185+
**Vertical Metrics Approach 2**
176186

177-
We assume that the TypoAscender - TypoDescender delta value is equivalent to the UPM size, and therefore that the percent TA:TD value is equivalent to percent UPM when line spacing is defined.
187+
Where metrics are defined as:
178188

179-
*Changes to OpenType metrics values in the font are defined as*:
189+
- [OS/2] TypoLinegap = 0
190+
- [hhea] linegap = 0
191+
- [OS/2] TypoAscender + TypoDescender = UPM
192+
- [OS/2] winAscent = [hhea] Ascent
193+
- [OS/2] winDescent = [hhea] Descent
180194

181-
- [hhea] lineGap is always set to 0
182-
- [OS/2] TypoLineGap = x% * TA:TD value
195+
font-line calculates a delta value for the total expected height based upon the % UPM value defined on the command line. The difference between this value and the observed number of units that span the [OS/2] winAscent to winDescent values is divided by half and then added to (for increased line spacing) or subtracted from (for decreased line spacing) the [OS/2] winAsc/winDesc and [hhea] Asc/Desc values. The [OS/2] TypoAsc/TypoDesc values are not modified and maintain a definition of size = UPM value. The [OS/2] TypoLinegap and [hhea] linegap values are not modified.
196+
197+
**Vertical Metrics Approach 3**
198+
199+
Where metrics are defined as:
200+
201+
- [OS/2] TypoAscender + TypoDescender = UPM
202+
- [OS/2] TypoLinegap is set to leading value
203+
- [hhea] linegap = 0
204+
- [OS/2] winAscent = [hhea] Ascent
205+
- [OS/2] winDescent = [hhea] Descent
206+
207+
*Changes to the metrics values in the font are defined as*:
208+
209+
- [OS/2] TypoLineGap = x% * UPM value
183210
- [hhea] Ascent = [OS/2] TypoAscender + 0.5(modified TypoLineGap)
184211
- [hhea] Descent = [OS/2] TypoDescender + 0.5(modified TypoLineGap)
185212
- [OS/2] WinAscent = [OS/2] TypoAscender + 0.5(modified TypoLineGap)
186213
- [OS/2] WinDescent = [OS/2] TypoDescender + 0.5(modified TypoLineGap)
187214

188-
Note that the internal leading modifications are split evenly across [hhea] Ascent & Descent values, and across [OS/2] WinAscent & WinDescent values. We add half of the new [OS/2] TypoLineGap value to the original [OS/2] TypoAscender or TypoDescender in order to define these new metrics properties.
215+
Note that the internal leading modifications are split evenly across [hhea] Ascent & Descent values, and across [OS/2] WinAscent & WinDescent values. We add half of the new [OS/2] TypoLineGap value to the original [OS/2] TypoAscender or TypoDescender in order to define these new metrics properties. The [hhea] linegap value is always defined as zero.
216+
217+
#### Important
189218

190-
These newly defined properties can lead to clipping of glyph components if not properly defined. There are no tests in font-line to provide assurance that this does not occur. We assume that the user is versed in these issues before use of the application and leave this testing to the designer / user before the modified fonts are used in a production setting.
219+
The newly defined vertical metrics values can lead to clipping of glyph components if not properly defined. There are no tests in font-line to provide assurance that this does not occur. We assume that the user is versed in these issues before use of the application and leave this testing to the designer / user before the modified fonts are used in a production setting.
191220

192221

193222
### Issue Reporting

0 commit comments

Comments
 (0)