You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-9Lines changed: 28 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
4
4
### About
5
-
font-line is a libre open source command line tool for font vertical metrics reporting and line spacing modifications. It currently supports reporting and modifications of `.ttf` and `.otf` font builds.
5
+
font-line is a libre open source command line tool for font vertical metrics reporting and line spacing modifications. It currently supports `.ttf` and `.otf` font builds.
6
6
7
7
### Contents
8
8
@@ -15,16 +15,24 @@ font-line is a libre open source command line tool for font vertical metrics rep
15
15
16
16
### Install
17
17
18
-
font-line is built with Python and can be used on systems with Python 2.7+ and Python 3.3+ interpreters. Use either of the following methods to install font-line on your system.
18
+
font-line is built with Python and can be used on systems with Python 2.7+ and Python 3.3+ interpreters, including current releases of pypy and pypy3. You can verify your installed Python version on the command line with the command:
19
+
20
+
```
21
+
$ python --version
22
+
```
23
+
24
+
Use either of the following methods to install font-line on your system.
19
25
20
26
#### pip Install
21
27
22
-
The latest release version is available through the Python Package Index and can be installed with pip:
28
+
The latest font-line release is available through the Python Package Index and can be installed with pip:
23
29
24
30
```
25
31
$ pip install font-line
26
32
```
27
33
34
+
To upgrade to a new version of font-line after a pip install, use the command `pip install --upgrade font-line`.
35
+
28
36
#### Download Project Repository and Install
29
37
30
38
The current repository version (which may be ahead of the PyPI release) can be installed by [downloading the repository](https://github.com/source-foundry/font-line/archive/master.zip) or cloning it with git:
@@ -39,11 +47,13 @@ Navigate to the top level repository directory and enter the following command:
39
47
$ python setup.py install
40
48
```
41
49
50
+
Follow the same instructions to upgrade to a new version of the application if you elect to install with this approach.
51
+
42
52
### Usage
43
53
44
-
font-line works via sub-commands to the `font-line` executable. The following sub-commands are available:
54
+
font-line works via sub-commands to the `font-line`command line executable. The following sub-commands are available:
45
55
46
-
-`percent` - modify the line spacing of a font to a percent of the Ascender to Descender delta value
56
+
-`percent` - modify the line spacing of a font to a percent of the Ascender to Descender distance
47
57
-`report` - report OpenType metrics values for a font
48
58
49
59
Usage of these sub-commands is described in detail below.
@@ -70,8 +80,13 @@ Enter one or more font path arguments to the command:
70
80
$ font-line report [fontpath 1] <fontpath ...>
71
81
```
72
82
73
-
Here is an example of the report generated with `font-line report`:
83
+
Here is an example of the report generated with the Hack typeface file `Hack-Regular.ttf` using the command:
@@ -103,19 +118,23 @@ Descent to TypoDescender: -9
103
118
TypoLineGap / UPM: 0.2
104
119
```
105
120
121
+
The report includes the font version string, a SHA-1 hash digest of the font file, and OpenType table metrics that are associated with line spacing in the font.
122
+
106
123
Unix/Linux/OS X users can write this report to a file with the `>` command line idiom:
107
124
108
125
```
109
126
$ font-line report TheFont.ttf > font-report.txt
110
127
```
111
128
129
+
You can modify `font-report.txt` to the file path of your choice.
130
+
112
131
#### Vertical Metrics Modifications
113
132
114
133
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.
115
134
116
135
##### `percent` Sub-Command Usage
117
136
118
-
Enter the desired percentage of the TA:TD metric as the first argument to the command. This should be formatted as an integer value. Then enter one or more font paths to which you would like to apply your font metrics changes.
137
+
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.
@@ -131,11 +150,11 @@ Increase or decrease the integer value to increase or decrease your line spacing
131
150
132
151
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.
133
152
134
-
You can inspect the new vertical metrics in the new font file with the `report` subcommand (see Usage above).
153
+
You can inspect the vertical metrics in the new font file with the `report` subcommand (see Usage above).
135
154
136
155
##### Details of Font Metrics Changes with `percent` Sub-Command
137
156
138
-
The interpretation of the multiple vertical metric values is platform and application dependent. This has led to [debate over the 'best' approach to font 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).
157
+
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).
139
158
140
159
*The following values are preserved from the original font design*:
0 commit comments