As a backend project, source-foundry/font-line has picked up 204 stars on GitHub (Python). OpenType vertical metrics reporting and font line spacing adjustment tool
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
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.
Contents
Install Guide
Usage - Vertical Metrics Reporting - Line Spacing Modifications
Changelog
License
Quickstart
Install: $ pip3 install font-line
Metrics Report: $ font-line report [font path]
Modify line spacing: $ font-line percent [integer %] [font path]
Help: $ font-line --help
Install
font-line is built with Python and supports Python 3.7+ interpreters. Check your installed Python version on the command line with the command:
$ python3 --version
Use either of the following methods to install font-line on your system.
pip Install
The latest font-line release is available through the Python Package Index and can be installed with pip:
$ pip3 install font-line
To upgrade to a new version of font-line after a pip install, use the command pip3 install --upgrade font-line.
Download Project Repository and Install
The current repository version (which may be ahead of the PyPI release) can be installed by downloading the repository or cloning it with git:
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.
Unix/Linux/OS X users can write this report to a file with the > command line idiom:
$ font-line report TheFont.ttf > font-report.txt
Modify the font-report.txt file path above to the file path string of your choice.
Baseline to Baseline Distance Calculations
Baseline to baseline distance (BTBD) calculations are performed according to the Microsoft Recommendations for OpenType Fonts and OpenType OS/2 table specification.
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.
percent Sub-Command Usage
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.
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:
$ font-line percent 20 TheFont.ttf
Increase or decrease the integer value to increase or decrease your line spacing accordingly.
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.
You can inspect the vertical metrics in the new font file with the report sub-command (see Usage above).
Details of Font Metrics Changes with percent Sub-Command
The interpretation and display of these multiple vertical metrics values is platform and application dependent. There is no broadly accepted "best" approach. As such, font-line attempts to preserve the original metrics design in the font when modifications are made with the percent sub-command.
font-line currently supports three commonly used vertical metrics approaches.
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.
Vertical Metrics Approach 2
Where metrics are defined as:
[OS/2] TypoLinegap = 0
[hhea] linegap = 0
[OS/2] TypoAscender + TypoDescender = UPM
[OS/2] winAscent = [hhea] Ascent
[OS/2] winDescent = [hhea] Descent
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.
Vertical Metrics Approach 3
Where metrics are defined as:
[OS/2] TypoAscender + TypoDescender = UPM
[OS/2] TypoLinegap is set to leading value
[hhea] linegap = 0
[OS/2] winAscent = [hhea] Ascent
[OS/2] winDescent = [hhea] Descent
Changes to the metrics values in the font are defined as:
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.
Important
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.
Issue Reporting
Please submit a new issue report on the project repository.
Acknowledgments
font-line is built with the fantastic fontTools Python library.
Does source-foundry/font-line have a project website?
No homepage URL was recorded for source-foundry/font-line in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
How does source-foundry/font-line compare to other Backend projects?
source-foundry/font-line is tracked by TopGit in the Backend category, with 204 GitHub stars and written in Python. Browse the Backend topic page on TopGit to compare it against similar projects by stars and activity.
How many stars does source-foundry/font-line have?
source-foundry/font-line has 204 GitHub stars — refresh the page for the live number, or check github.com/source-foundry/font-line. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is source-foundry/font-line open source?
TopGit's metadata for source-foundry/font-line does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
What else is in the Backend space?
source-foundry/font-line is tracked by TopGit under the Backend category, alongside 12 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is source-foundry/font-line?
source-foundry/font-line (source-foundry/font-line) is a Python project on GitHub. From the project's own README: OpenType vertical metrics reporting and font line spacing adjustment tool
Where do I read more about source-foundry/font-line?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/source-foundry/font-line is the definitive source.
Read full README in the tab above.
Still deciding about font-line?
One click hands the question to an AI along with this page — see what it says about font-line.