source-foundry/font-line là một trong những repo phía máy chủ mà TopGit theo dõi, hiện có 204 sao, viết chủ yếu bằng Python. OpenType vertical metrics reporting and font line spacing adjustment tool
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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.
source-foundry/font-line thuộc nhóm Backend trên TopGit, cùng 12 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về source-foundry/font-line ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/source-foundry/font-line là nguồn chính thức.
source-foundry/font-line có bao nhiêu sao?
source-foundry/font-line có 204 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/source-foundry/font-line. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
source-foundry/font-line có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho source-foundry/font-line. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
source-foundry/font-line có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho source-foundry/font-line. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
source-foundry/font-line là gì?
source-foundry/font-line (source-foundry/font-line) là dự án Python trên GitHub. Theo mô tả gốc: OpenType vertical metrics reporting and font line spacing adjustment tool
source-foundry/font-line so với các dự án Backend khác thế nào?
source-foundry/font-line được TopGit xếp vào nhóm Backend, với 204 sao GitHub và viết bằng Python. Xem trang chủ đề Backend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc font-line có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về font-line.