Skip to content

Commit e9fd094

Browse files
Merge pull request #25 from source-foundry/dev
v3.1.0
2 parents 885f6b1 + 4c76831 commit e9fd094

File tree

8 files changed

+102
-68
lines changed

8 files changed

+102
-68
lines changed

.travis.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,32 @@ matrix:
1111
script: flake8 --ignore=E501,W503 lib/fontline/*.py
1212
- python: 3.6
1313
env: TOX_ENV=py36
14-
install: pip install tox
14+
install:
15+
- pip install tox
1516
script: tox -e $TOX_ENV
1617
- python: 3.7
1718
env: TOX_ENV=py37
18-
install: pip install tox
19+
install:
20+
- pip install tox
21+
dist: xenial
22+
script: tox -e $TOX_ENV
23+
- python: 3.8
24+
env: TOX_ENV=py38
25+
install:
26+
- pip install tox
1927
dist: xenial
2028
script: tox -e $TOX_ENV
2129
- python: 3.7
2230
dist: xenial
2331
env: TOX_ENV=coverage
2432
install:
2533
- pip install --upgrade coverage
26-
- pip install .
34+
- pip install -r requirements.txt .
2735
script:
2836
- coverage run --source fontline -m py.test
2937
- coverage report -m
3038
after_success:
3139
- bash <(curl -s https://codecov.io/bash)
3240

3341
notifications:
34-
email: false
42+
email: false

CHANGELOG.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
## Changelog
22

3+
### v3.1.0
4+
5+
- add requirements.txt file with pinned dependency versions
6+
- update all build dependencies to current release versions
7+
- the fontTools dependency updates add support for Unicode 13
8+
- convert PyPI documentation to repository README Markdown file
9+
- add Py3.8 interpreter to CI testing
10+
311
### v3.0.0
412

513
- added baseline to baseline distance calculations for hhea, typo, and win metrics to reports
@@ -18,7 +26,7 @@
1826
- modified Travis CI testing to Python 3.5 - 3.7
1927
- refactored Appveyor CI settings file
2028
- modified Appveyor CI testing to Python 3.5 - 3.7
21-
-
29+
-
2230

2331
### v1.0.1
2432

@@ -52,8 +60,8 @@
5260

5361
- modified percent command calculations to maintain vertical metrics approaches in the original font design
5462
- added vertical metrics modification support for fonts designed with the following vertical metrics approaches:
55-
- Google style metrics where TypoLinegap = hhea linegap = 0, internal leading is present in [OS/2] TypoAsc/TypoDesc, [hhea] Asc/Desc, [OS/2] winAsc/winDesc
56-
- Adobe style metrics where TypoLinegap = hhea linegap = 0, TypoAsc - TypoDesc = UPM, internal leading in [hhea] Asc/Desc & [OS/2] winAsc/winDesc
63+
- Google style metrics where TypoLinegap = hhea linegap = 0, internal leading is present in [OS/2] TypoAsc/TypoDesc, [hhea] Asc/Desc, [OS/2] winAsc/winDesc
64+
- Adobe style metrics where TypoLinegap = hhea linegap = 0, TypoAsc - TypoDesc = UPM, internal leading in [hhea] Asc/Desc & [OS/2] winAsc/winDesc
5765

5866
### v0.5.4
5967

README.md

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
<img src ="https://raw.githubusercontent.com/source-foundry/font-line/img/img/font-line-crunch.png" />
22

3-
4-
[![PyPI](https://img.shields.io/pypi/v/font-line.svg)](https://pypi.org/project/font-line)
3+
[![PyPI](https://img.shields.io/pypi/v/font-line?color=blueviolet&label=PyPI&logo=python&logoColor=white)](https://pypi.org/project/font-line)
54
[![Build Status](https://travis-ci.org/source-foundry/font-line.svg?branch=master)](https://travis-ci.org/source-foundry/font-line)
6-
[![Build status](https://ci.appveyor.com/api/projects/status/2s4725o5mxh2298c/branch/master?svg=true)](https://ci.appveyor.com/project/chrissimpkins/font-line/branch/master)
5+
[![Build status](https://ci.appveyor.com/api/projects/status/2s4725o5mxh2298c/branch/master?svg=true)](https://ci.appveyor.com/project/chrissimpkins/font-line/branch/master)
76
[![codecov.io](https://codecov.io/github/source-foundry/font-line/coverage.svg?branch=master)](https://codecov.io/github/source-foundry/font-line?branch=master)
87
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d77b55866c794a5a9dd3b3dfea9ec318)](https://www.codacy.com/app/SourceFoundry/font-line)
98

109
## About
11-
font-line is a libre, open source command line tool for OpenType vertical metrics reporting and command line based font line spacing modifications. It supports `.ttf` and `.otf` font builds.
10+
11+
font-line is a libre, open source command line tool for OpenType vertical metrics reporting and command line based font line spacing modifications. It supports `.ttf` and `.otf` font builds.
1212

1313
## Contents
1414

1515
- [Install Guide](https://github.com/source-foundry/font-line#install)
16-
- [Usage](https://github.com/source-foundry/font-line#usage)
17-
- [Vertical Metrics Reporting](https://github.com/source-foundry/font-line#vertical-metrics-reporting)
18-
- [Line Spacing Modifications](https://github.com/source-foundry/font-line#vertical-metrics-modifications)
16+
- [Usage](https://github.com/source-foundry/font-line#usage) - [Vertical Metrics Reporting](https://github.com/source-foundry/font-line#vertical-metrics-reporting) - [Line Spacing Modifications](https://github.com/source-foundry/font-line#vertical-metrics-modifications)
1917
- [Changelog](https://github.com/source-foundry/font-line/blob/master/CHANGELOG.md)
2018
- [License](https://github.com/source-foundry/font-line/blob/master/docs/LICENSE.md)
2119

@@ -64,7 +62,7 @@ Follow the same instructions to upgrade to a new version of the application if y
6462

6563
## Usage
6664

67-
font-line works via sub-commands to the `font-line` command line executable. The following sub-commands are available:
65+
font-line works via sub-commands to the `font-line` command line executable. The following sub-commands are available:
6866

6967
- `percent` - modify the line spacing of a font to a percent of the Ascender to Descender distance
7068
- `report` - report OpenType metrics values for a font
@@ -104,6 +102,7 @@ $ font-line report Hack-Regular.ttf
104102
```
105103

106104
#### Example Font Vertical Metrics Report
105+
107106
```
108107
=== Hack-Regular.ttf ===
109108
Version 3.003;[3114f1256]-release
@@ -197,34 +196,33 @@ where external leading is defined as:
197196
MAX(0, hhea.LineGap - ((OS/2.WinAscent + OS/2.winDescent) - (hhea.Ascent - hhea.Descent)))
198197
```
199198

200-
201199
### Vertical Metrics Modifications
202200

203-
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.
201+
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.
204202

205203
#### `percent` Sub-Command Usage
206204

207-
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.
205+
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.
208206

209207
```
210208
$ font-line percent [percent change] [fontpath 1] <fontpath ...>
211209
```
212210

213-
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:
211+
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:
214212

215213
```
216214
$ font-line percent 20 TheFont.ttf
217215
```
218216

219217
Increase or decrease the integer value to increase or decrease your line spacing accordingly.
220218

221-
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.
219+
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.
222220

223221
You can inspect the vertical metrics in the new font file with the `report` sub-command (see Usage above).
224222

225223
#### Details of Font Metrics Changes with `percent` Sub-Command
226224

227-
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.
225+
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.
228226

229227
font-line currently supports three commonly used vertical metrics approaches.
230228

@@ -237,7 +235,7 @@ Where metrics are defined as:
237235
- [OS/2] TypoAscender = [OS/2] winAscent = [hhea] Ascent
238236
- [OS/2] TypoDescender = [OS/2] winDescent = [hhea] Descent
239237

240-
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.
238+
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.
241239

242240
**Vertical Metrics Approach 2**
243241

@@ -249,7 +247,7 @@ Where metrics are defined as:
249247
- [OS/2] winAscent = [hhea] Ascent
250248
- [OS/2] winDescent = [hhea] Descent
251249

252-
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.
250+
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.
253251

254252
**Vertical Metrics Approach 3**
255253

@@ -261,31 +259,28 @@ Where metrics are defined as:
261259
- [OS/2] winAscent = [hhea] Ascent
262260
- [OS/2] winDescent = [hhea] Descent
263261

264-
*Changes to the metrics values in the font are defined as*:
262+
_Changes to the metrics values in the font are defined as_:
265263

266-
- [OS/2] TypoLineGap = x% * UPM value
264+
- [OS/2] TypoLineGap = x% \* UPM value
267265
- [hhea] Ascent = [OS/2] TypoAscender + 0.5(modified TypoLineGap)
268266
- [hhea] Descent = [OS/2] TypoDescender + 0.5(modified TypoLineGap)
269267
- [OS/2] WinAscent = [OS/2] TypoAscender + 0.5(modified TypoLineGap)
270268
- [OS/2] WinDescent = [OS/2] TypoDescender + 0.5(modified TypoLineGap)
271269

272-
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.
270+
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.
273271

274272
### Important
275273

276-
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.
277-
274+
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.
278275

279276
## Issue Reporting
280277

281278
Please [submit a new issue report](https://github.com/source-foundry/font-line/issues/new) on the project repository.
282279

283-
284280
## Acknowledgments
285281

286282
font-line is built with the fantastic [fontTools](https://github.com/fonttools/fonttools) Python library.
287283

288-
289284
## License
290285

291-
MIT License. See [LICENSE.md](docs/LICENSE.md) for details.
286+
MIT License. See [LICENSE.md](docs/LICENSE.md) for details.

appveyor.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ environment:
88
PYTHON_HOME: "C:\\Python37-x64"
99
TOX_PY: py37
1010

11+
- JOB: "3.8 64-bit"
12+
PYTHON_HOME: "C:\\Python38-x64"
13+
TOX_PY: py38
14+
1115
install:
1216
# Prepend Python to the PATH of this build
1317
- "SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\\Scripts;%PATH%"
1418

1519
# check that we have the expected version and architecture for Python
1620
- "python --version"
17-
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
21+
- 'python -c "import struct; print(struct.calcsize(''P'') * 8)"'
1822

1923
# upgrade pip and setuptools to avoid out-of-date warnings
2024
- "python -m pip install --disable-pip-version-check --user --upgrade pip setuptools virtualenv"
@@ -36,4 +40,4 @@ branches:
3640
- /^v\d+\.\d+.*$/
3741

3842
test_script:
39-
- "tox -e %TOX_PY%"
43+
- "tox -e %TOX_PY%"

lib/fontline/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Version Number
1010
# ------------------------------------------------------------------------------
1111
major_version = "3"
12-
minor_version = "0"
12+
minor_version = "1"
1313
patch_version = "0"
1414

1515
# ------------------------------------------------------------------------------

requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# This file is autogenerated by pip-compile
3+
# To update, run:
4+
#
5+
# pip-compile
6+
#
7+
commandlines==0.4.1 # via font-line (setup.py)
8+
fonttools==4.6.0 # via font-line (setup.py)
9+
standardstreams==0.2.0 # via font-line (setup.py)

setup.py

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1+
import io
12
import os
23
import re
4+
import sys
35
from setuptools import setup, find_packages
46

57

6-
def docs_read(fname):
7-
return open(os.path.join(os.path.dirname(__file__), 'docs', fname)).read()
8+
# Use repository Markdown README.md for PyPI long description
9+
try:
10+
with io.open("README.md", encoding="utf-8") as f:
11+
readme = f.read()
12+
except IOError as readme_e:
13+
sys.stderr.write(
14+
"[ERROR] setup.py: Failed to read the README.md file for the long description definition: {}".format(
15+
str(readme_e)
16+
)
17+
)
18+
raise readme_e
819

920

1021
def version_read():
11-
settings_file = open(os.path.join(os.path.dirname(__file__), 'lib', 'fontline', 'settings.py')).read()
22+
settings_file = open(
23+
os.path.join(os.path.dirname(__file__), "lib", "fontline", "settings.py")
24+
).read()
1225
major_regex = """major_version\s*?=\s*?["']{1}(\d+)["']{1}"""
1326
minor_regex = """minor_version\s*?=\s*?["']{1}(\d+)["']{1}"""
1427
patch_regex = """patch_version\s*?=\s*?["']{1}(\d+)["']{1}"""
@@ -28,38 +41,35 @@ def version_read():
2841

2942

3043
setup(
31-
name='font-line',
44+
name="font-line",
3245
version=version_read(),
33-
description='A font vertical metrics reporting and line spacing adjustment tool',
34-
long_description=(docs_read('README.rst')),
35-
url='https://github.com/source-foundry/font-line',
36-
license='MIT license',
37-
author='Christopher Simpkins',
38-
author_email='chris@sourcefoundry.org',
39-
platforms=['any'],
46+
description="A font vertical metrics reporting and line spacing adjustment tool",
47+
long_description=readme,
48+
long_description_content_type="text/markdown",
49+
url="https://github.com/source-foundry/font-line",
50+
license="MIT license",
51+
author="Christopher Simpkins",
52+
author_email="chris@sourcefoundry.org",
53+
platforms=["any"],
4054
packages=find_packages("lib"),
41-
package_dir={'': 'lib'},
42-
install_requires=['commandlines', 'standardstreams', 'fontTools'],
43-
entry_points={
44-
'console_scripts': [
45-
'font-line = fontline.app:main'
46-
],
47-
},
48-
keywords='font,typeface,fonts,spacing,line spacing,spaces,vertical metrics,metrics,type',
55+
package_dir={"": "lib"},
56+
install_requires=["commandlines", "standardstreams", "fontTools"],
57+
entry_points={"console_scripts": ["font-line = fontline.app:main"],},
58+
keywords="font,typeface,fonts,spacing,line spacing,spaces,vertical metrics,metrics,type",
4959
include_package_data=True,
5060
classifiers=[
51-
'Development Status :: 5 - Production/Stable',
52-
'Natural Language :: English',
53-
'License :: OSI Approved :: MIT License',
54-
'Operating System :: OS Independent',
55-
'Programming Language :: Python',
56-
'Programming Language :: Python :: 2',
57-
'Programming Language :: Python :: 2.7',
58-
'Programming Language :: Python :: 3',
59-
'Programming Language :: Python :: 3.3',
60-
'Programming Language :: Python :: 3.4',
61-
'Programming Language :: Python :: 3.5',
62-
'Programming Language :: Python :: 3.6',
63-
'Topic :: Software Development :: Libraries :: Python Modules',
61+
"Development Status :: 5 - Production/Stable",
62+
"Natural Language :: English",
63+
"License :: OSI Approved :: MIT License",
64+
"Operating System :: OS Independent",
65+
"Programming Language :: Python",
66+
"Programming Language :: Python :: 2",
67+
"Programming Language :: Python :: 2.7",
68+
"Programming Language :: Python :: 3",
69+
"Programming Language :: Python :: 3.3",
70+
"Programming Language :: Python :: 3.4",
71+
"Programming Language :: Python :: 3.5",
72+
"Programming Language :: Python :: 3.6",
73+
"Topic :: Software Development :: Libraries :: Python Modules",
6474
],
6575
)

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[tox]
2-
envlist = py27, py36, py37
2+
envlist = py37
33

44
[testenv]
55
commands =
66
py.test tests
77
;- coverage run --source {{fontline}} -m py.test
88
;- coverage report
99
deps =
10+
-rrequirements.txt
1011
pytest
11-
fontTools
1212

1313
[testenv:flake8]
1414
deps =

0 commit comments

Comments
 (0)