NotYAFC 1.0.0__tar.gz → 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {notyafc-1.0.0 → notyafc-1.0.1}/PKG-INFO +25 -9
- {notyafc-1.0.0 → notyafc-1.0.1}/README.md +10 -8
- {notyafc-1.0.0 → notyafc-1.0.1}/pyproject.toml +19 -1
- {notyafc-1.0.0 → notyafc-1.0.1}/pyproject.toml.orig +19 -1
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/cli.py +24 -24
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/finder.py +1 -1
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/font.py +1 -1
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/instance_tree.py +2 -1
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/profile_options.py +1 -1
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/profiles.py +4 -4
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/window.py +36 -141
- notyafc-1.0.1/src/font_converter/gui/worker.py +143 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/inspection.py +1 -1
- notyafc-1.0.1/src/font_converter/models.py +189 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/service.py +77 -187
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/__init__.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/__main__.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/assets/ico.png +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/assets/notyafc-1024.png +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/assets/notyafc.ico +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/assets/notyafc.svg +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/constants.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/contours.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/css_kit.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/__init__.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/conversion_dialog.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/file_list.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/logs.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/organization_dialog.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/scanner.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/styles.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/gui/widgets.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/merge_curves.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/otf_builder.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/qu2cu.py +0 -0
- {notyafc-1.0.0 → notyafc-1.0.1}/src/font_converter/ttf_builder.py +0 -0
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: NotYAFC
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Not Yet Another Font Converter: a free and open-source font converter for desktop and command-line use, written in Python.
|
|
5
5
|
Author: Cesare Gilento
|
|
6
6
|
Author-email: Cesare Gilento <ftCLI@proton.me>
|
|
7
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
8
|
+
Classifier: Environment :: Console
|
|
9
|
+
Classifier: Environment :: X11 Applications :: Qt
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
19
|
+
Classifier: Topic :: Text Processing :: Fonts
|
|
7
20
|
Requires-Dist: cffsubr>=0.4.0
|
|
8
21
|
Requires-Dist: fonttools[pathops,woff]>=4.68.0
|
|
9
22
|
Requires-Dist: pathvalidate>=3.3.1
|
|
@@ -11,6 +24,7 @@ Requires-Dist: pyside6>=6.8
|
|
|
11
24
|
Requires-Dist: typer==0.28.0
|
|
12
25
|
Requires-Dist: ttfautohint-py>=0.6.1
|
|
13
26
|
Requires-Python: >=3.11
|
|
27
|
+
Project-URL: homepage, https://github.com/ftCLI/NotYAFC
|
|
14
28
|
Description-Content-Type: text/markdown
|
|
15
29
|
|
|
16
30
|
# NotYAFC — Not Yet Another Font Converter
|
|
@@ -100,10 +114,10 @@ uv run notyafc
|
|
|
100
114
|
|---------|-------------|
|
|
101
115
|
| `ttf2otf` | TrueType → PostScript (TTF → OTF) |
|
|
102
116
|
| `otf2ttf` | PostScript → TrueType (OTF → TTF) |
|
|
103
|
-
| `ft2wf` | SFNT → WOFF / WOFF2 webfonts |
|
|
104
|
-
| `woff2ft` | WOFF →
|
|
105
|
-
| `woff22ft` | WOFF2 →
|
|
106
|
-
| `ttc2sfnt` | TTC/OTC
|
|
117
|
+
| `ft2wf` | TTF / OTF (SFNT) → WOFF / WOFF2 webfonts |
|
|
118
|
+
| `woff2ft` | WOFF → TTF / OTF |
|
|
119
|
+
| `woff22ft` | WOFF2 → TTF / OTF |
|
|
120
|
+
| `ttc2sfnt` | Collection (TTC/OTC) → TTF / OTF |
|
|
107
121
|
| `var2static` | Variable font → static instances |
|
|
108
122
|
|
|
109
123
|
### Profile Options
|
|
@@ -121,7 +135,7 @@ uv run notyafc
|
|
|
121
135
|
- **Target UPM** — Scale the font to a chosen units-per-em value.
|
|
122
136
|
- **Autohint** (on by default) — Add TrueType hinting instructions via `ttfautohint`.
|
|
123
137
|
|
|
124
|
-
####
|
|
138
|
+
#### TTF / OTF → WOFF / WOFF2 (`ft2wf`)
|
|
125
139
|
|
|
126
140
|
- **Format** — Choose WOFF, WOFF2, or both (both selected by default).
|
|
127
141
|
- **Obfuscate names** — Replace family, full, and PostScript names with hashes (including in the output filename).
|
|
@@ -130,11 +144,11 @@ uv run notyafc
|
|
|
130
144
|
- **Remove DSIG table** (WOFF only) — Remove the digital signature table.
|
|
131
145
|
- **Create CSS** — Write a `fonts.css` file with `@font-face` rules and classes for detected OpenType features (e.g., `.ft-liga`).
|
|
132
146
|
|
|
133
|
-
#### WOFF →
|
|
147
|
+
#### WOFF → TTF / OTF (`woff2ft`) / WOFF2 → TTF / OTF (`woff22ft`)
|
|
134
148
|
|
|
135
149
|
Converts back to the original outline type (TTF or OTF). No extra options needed.
|
|
136
150
|
|
|
137
|
-
####
|
|
151
|
+
#### Collection (TTC/OTC) → TTF / OTF (`ttc2sfnt`)
|
|
138
152
|
|
|
139
153
|
Unpacks a TTC/OTC collection into individual font files. No extra options needed.
|
|
140
154
|
|
|
@@ -157,7 +171,7 @@ Export named or custom variable-font instances as separate static fonts.
|
|
|
157
171
|
2. **Choose a profile** — The list shows how many scanned fonts are compatible with each conversion. Select a profile before converting; you can also choose one before adding fonts.
|
|
158
172
|
3. **Select fonts** — The input table shows each font's name, format, outline type, and UPM. Right-click its header to show the optional Family and Style columns; the choice is remembered, and filtering searches those fields even when hidden. Incompatibility reasons appear beside names when space permits, in tooltips, and below the table for a selected incompatible font. Use *Select compatible fonts* or *Hide incompatible* to filter.
|
|
159
173
|
4. **Set output and options** — Converted files are saved next to their sources by default. Choose a separate folder, optionally organize the output, and adjust profile-specific options. Open *Save options…* in the output card for settings shared by all conversions.
|
|
160
|
-
5. **Convert** — Check the profile, selection count, and destination
|
|
174
|
+
5. **Convert** — Check the profile, selection count, and destination, then use the fixed *Convert* button or Ctrl+Enter. Before converting, NotYAFC asks you to confirm that you have the legal right to modify the selected fonts. Choose **Remember this choice** to skip the confirmation on future runs; otherwise, you will be asked again next time. Monitor progress, pause, resume, or cancel mid-run. Afterward, use *View last run* to review or export logs, or *Open output folder* to open the last conversion's output.
|
|
161
175
|
|
|
162
176
|
For variable fonts, *Variable → Static* changes the input list to a tree of fonts and instances.
|
|
163
177
|
Select a font or instance and use *Add custom instance…*. Right-click a custom
|
|
@@ -178,6 +192,8 @@ Big batch, tidy folders. In the GUI, **Organize output…** lets you build a fol
|
|
|
178
192
|
properties such as family, output format, outline type, UPM, tolerance, and contour simplification.
|
|
179
193
|
The available criteria depend on the conversion profile.
|
|
180
194
|
|
|
195
|
+

|
|
196
|
+
|
|
181
197
|
Add a folder level for each directory you want, then choose one or more criteria for it. Criteria
|
|
182
198
|
in the same level are joined with `_`; separate levels create nested folders. For example, putting
|
|
183
199
|
**Format** and **Outline type** in the first level and **UPM** in the second could produce:
|
|
@@ -85,10 +85,10 @@ uv run notyafc
|
|
|
85
85
|
|---------|-------------|
|
|
86
86
|
| `ttf2otf` | TrueType → PostScript (TTF → OTF) |
|
|
87
87
|
| `otf2ttf` | PostScript → TrueType (OTF → TTF) |
|
|
88
|
-
| `ft2wf` | SFNT → WOFF / WOFF2 webfonts |
|
|
89
|
-
| `woff2ft` | WOFF →
|
|
90
|
-
| `woff22ft` | WOFF2 →
|
|
91
|
-
| `ttc2sfnt` | TTC/OTC
|
|
88
|
+
| `ft2wf` | TTF / OTF (SFNT) → WOFF / WOFF2 webfonts |
|
|
89
|
+
| `woff2ft` | WOFF → TTF / OTF |
|
|
90
|
+
| `woff22ft` | WOFF2 → TTF / OTF |
|
|
91
|
+
| `ttc2sfnt` | Collection (TTC/OTC) → TTF / OTF |
|
|
92
92
|
| `var2static` | Variable font → static instances |
|
|
93
93
|
|
|
94
94
|
### Profile Options
|
|
@@ -106,7 +106,7 @@ uv run notyafc
|
|
|
106
106
|
- **Target UPM** — Scale the font to a chosen units-per-em value.
|
|
107
107
|
- **Autohint** (on by default) — Add TrueType hinting instructions via `ttfautohint`.
|
|
108
108
|
|
|
109
|
-
####
|
|
109
|
+
#### TTF / OTF → WOFF / WOFF2 (`ft2wf`)
|
|
110
110
|
|
|
111
111
|
- **Format** — Choose WOFF, WOFF2, or both (both selected by default).
|
|
112
112
|
- **Obfuscate names** — Replace family, full, and PostScript names with hashes (including in the output filename).
|
|
@@ -115,11 +115,11 @@ uv run notyafc
|
|
|
115
115
|
- **Remove DSIG table** (WOFF only) — Remove the digital signature table.
|
|
116
116
|
- **Create CSS** — Write a `fonts.css` file with `@font-face` rules and classes for detected OpenType features (e.g., `.ft-liga`).
|
|
117
117
|
|
|
118
|
-
#### WOFF →
|
|
118
|
+
#### WOFF → TTF / OTF (`woff2ft`) / WOFF2 → TTF / OTF (`woff22ft`)
|
|
119
119
|
|
|
120
120
|
Converts back to the original outline type (TTF or OTF). No extra options needed.
|
|
121
121
|
|
|
122
|
-
####
|
|
122
|
+
#### Collection (TTC/OTC) → TTF / OTF (`ttc2sfnt`)
|
|
123
123
|
|
|
124
124
|
Unpacks a TTC/OTC collection into individual font files. No extra options needed.
|
|
125
125
|
|
|
@@ -142,7 +142,7 @@ Export named or custom variable-font instances as separate static fonts.
|
|
|
142
142
|
2. **Choose a profile** — The list shows how many scanned fonts are compatible with each conversion. Select a profile before converting; you can also choose one before adding fonts.
|
|
143
143
|
3. **Select fonts** — The input table shows each font's name, format, outline type, and UPM. Right-click its header to show the optional Family and Style columns; the choice is remembered, and filtering searches those fields even when hidden. Incompatibility reasons appear beside names when space permits, in tooltips, and below the table for a selected incompatible font. Use *Select compatible fonts* or *Hide incompatible* to filter.
|
|
144
144
|
4. **Set output and options** — Converted files are saved next to their sources by default. Choose a separate folder, optionally organize the output, and adjust profile-specific options. Open *Save options…* in the output card for settings shared by all conversions.
|
|
145
|
-
5. **Convert** — Check the profile, selection count, and destination
|
|
145
|
+
5. **Convert** — Check the profile, selection count, and destination, then use the fixed *Convert* button or Ctrl+Enter. Before converting, NotYAFC asks you to confirm that you have the legal right to modify the selected fonts. Choose **Remember this choice** to skip the confirmation on future runs; otherwise, you will be asked again next time. Monitor progress, pause, resume, or cancel mid-run. Afterward, use *View last run* to review or export logs, or *Open output folder* to open the last conversion's output.
|
|
146
146
|
|
|
147
147
|
For variable fonts, *Variable → Static* changes the input list to a tree of fonts and instances.
|
|
148
148
|
Select a font or instance and use *Add custom instance…*. Right-click a custom
|
|
@@ -163,6 +163,8 @@ Big batch, tidy folders. In the GUI, **Organize output…** lets you build a fol
|
|
|
163
163
|
properties such as family, output format, outline type, UPM, tolerance, and contour simplification.
|
|
164
164
|
The available criteria depend on the conversion profile.
|
|
165
165
|
|
|
166
|
+

|
|
167
|
+
|
|
166
168
|
Add a folder level for each directory you want, then choose one or more criteria for it. Criteria
|
|
167
169
|
in the same level are joined with `_`; separate levels create nested folders. For example, putting
|
|
168
170
|
**Format** and **Outline type** in the first level and **UPM** in the second could produce:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "NotYAFC"
|
|
3
|
-
version = "1.0.
|
|
3
|
+
version = "1.0.1"
|
|
4
4
|
description = "Not Yet Another Font Converter: a free and open-source font converter for desktop and command-line use, written in Python."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -12,6 +12,21 @@ dependencies = [
|
|
|
12
12
|
"typer==0.28.0",
|
|
13
13
|
"ttfautohint-py>=0.6.1",
|
|
14
14
|
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 5 - Production/Stable",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Environment :: X11 Applications :: Qt",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Intended Audience :: End Users/Desktop",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Programming Language :: Python :: 3.13",
|
|
26
|
+
"Programming Language :: Python :: 3.14",
|
|
27
|
+
"Programming Language :: Python :: 3.15",
|
|
28
|
+
"Topic :: Text Processing :: Fonts",
|
|
29
|
+
]
|
|
15
30
|
|
|
16
31
|
[[project.authors]]
|
|
17
32
|
name = "Cesare Gilento"
|
|
@@ -23,6 +38,9 @@ notyafc-cli = "font_converter.cli:main"
|
|
|
23
38
|
[project.gui-scripts]
|
|
24
39
|
notyafc = "font_converter.__main__:main"
|
|
25
40
|
|
|
41
|
+
[project.urls]
|
|
42
|
+
homepage = "https://github.com/ftCLI/NotYAFC"
|
|
43
|
+
|
|
26
44
|
[dependency-groups]
|
|
27
45
|
dev = [
|
|
28
46
|
"pytest>=9.1.1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "NotYAFC"
|
|
3
|
-
version = "1.0.
|
|
3
|
+
version = "1.0.1"
|
|
4
4
|
description = "Not Yet Another Font Converter: a free and open-source font converter for desktop and command-line use, written in Python."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -15,6 +15,21 @@ dependencies = [
|
|
|
15
15
|
"typer==0.28.0",
|
|
16
16
|
"ttfautohint-py>=0.6.1",
|
|
17
17
|
]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Development Status :: 5 - Production/Stable",
|
|
20
|
+
"Environment :: Console",
|
|
21
|
+
"Environment :: X11 Applications :: Qt",
|
|
22
|
+
"Intended Audience :: Developers",
|
|
23
|
+
"Intended Audience :: End Users/Desktop",
|
|
24
|
+
"Operating System :: OS Independent",
|
|
25
|
+
"Programming Language :: Python :: 3",
|
|
26
|
+
"Programming Language :: Python :: 3.11",
|
|
27
|
+
"Programming Language :: Python :: 3.12",
|
|
28
|
+
"Programming Language :: Python :: 3.13",
|
|
29
|
+
"Programming Language :: Python :: 3.14",
|
|
30
|
+
"Programming Language :: Python :: 3.15",
|
|
31
|
+
"Topic :: Text Processing :: Fonts",
|
|
32
|
+
]
|
|
18
33
|
|
|
19
34
|
[project.scripts]
|
|
20
35
|
notyafc-cli = "font_converter.cli:main"
|
|
@@ -22,6 +37,9 @@ notyafc-cli = "font_converter.cli:main"
|
|
|
22
37
|
[project.gui-scripts]
|
|
23
38
|
notyafc = "font_converter.__main__:main"
|
|
24
39
|
|
|
40
|
+
[project.urls]
|
|
41
|
+
homepage = "https://github.com/ftCLI/NotYAFC"
|
|
42
|
+
|
|
25
43
|
[dependency-groups]
|
|
26
44
|
dev = [
|
|
27
45
|
"pytest>=9.1.1",
|
|
@@ -6,11 +6,10 @@ from typing import Annotated, Any
|
|
|
6
6
|
import typer
|
|
7
7
|
|
|
8
8
|
from font_converter.inspection import inspect_font
|
|
9
|
-
from font_converter.
|
|
9
|
+
from font_converter.models import (
|
|
10
10
|
ConversionRequest,
|
|
11
11
|
ConversionResult,
|
|
12
12
|
ConversionSettings,
|
|
13
|
-
ConverterService,
|
|
14
13
|
FontOutcome,
|
|
15
14
|
FontOutcomeKind,
|
|
16
15
|
InstanceSpec,
|
|
@@ -22,6 +21,7 @@ from font_converter.service import (
|
|
|
22
21
|
Woff2ToSfntOptions,
|
|
23
22
|
WoffToSfntOptions,
|
|
24
23
|
)
|
|
24
|
+
from font_converter.service import ConverterService
|
|
25
25
|
|
|
26
26
|
app = typer.Typer(
|
|
27
27
|
no_args_is_help=True,
|
|
@@ -253,6 +253,16 @@ def _run(
|
|
|
253
253
|
def ttf2otf(
|
|
254
254
|
inputs: Inputs,
|
|
255
255
|
tolerance: TtfToOtfTolerance = 1.0,
|
|
256
|
+
simplify: Annotated[
|
|
257
|
+
int,
|
|
258
|
+
typer.Option(
|
|
259
|
+
"--simplify",
|
|
260
|
+
min=0,
|
|
261
|
+
max=3,
|
|
262
|
+
help="Contour simplification level (0 disables it).",
|
|
263
|
+
rich_help_panel="TTF to OTF options",
|
|
264
|
+
),
|
|
265
|
+
] = 0,
|
|
256
266
|
target_upm: TargetUpmTtfToOtf = None,
|
|
257
267
|
subroutinize: Annotated[
|
|
258
268
|
bool,
|
|
@@ -262,16 +272,6 @@ def ttf2otf(
|
|
|
262
272
|
rich_help_panel="TTF to OTF options",
|
|
263
273
|
),
|
|
264
274
|
] = True,
|
|
265
|
-
optimize_contours: Annotated[
|
|
266
|
-
int,
|
|
267
|
-
typer.Option(
|
|
268
|
-
"--optimize-contours",
|
|
269
|
-
min=0,
|
|
270
|
-
max=3,
|
|
271
|
-
help="Contour simplification level (0 disables it).",
|
|
272
|
-
rich_help_panel="TTF to OTF options",
|
|
273
|
-
),
|
|
274
|
-
] = 0,
|
|
275
275
|
output_dir: OutputDir = None,
|
|
276
276
|
recursive: Recursive = False,
|
|
277
277
|
overwrite: Overwrite = False,
|
|
@@ -291,9 +291,9 @@ def ttf2otf(
|
|
|
291
291
|
reorder_tables,
|
|
292
292
|
TtfToOtfOptions,
|
|
293
293
|
tolerance=tolerance,
|
|
294
|
+
optimize_contours=simplify,
|
|
294
295
|
target_upm=target_upm,
|
|
295
296
|
subroutinize=subroutinize,
|
|
296
|
-
optimize_contours=optimize_contours,
|
|
297
297
|
)
|
|
298
298
|
|
|
299
299
|
|
|
@@ -342,7 +342,7 @@ def ft2wf(
|
|
|
342
342
|
typer.Option(
|
|
343
343
|
"--woff/--no-woff",
|
|
344
344
|
help="Create WOFF output.",
|
|
345
|
-
rich_help_panel="
|
|
345
|
+
rich_help_panel="TTF/OTF to WOFF options",
|
|
346
346
|
),
|
|
347
347
|
] = True,
|
|
348
348
|
woff2: Annotated[
|
|
@@ -350,7 +350,7 @@ def ft2wf(
|
|
|
350
350
|
typer.Option(
|
|
351
351
|
"--woff2/--no-woff2",
|
|
352
352
|
help="Create WOFF2 output.",
|
|
353
|
-
rich_help_panel="
|
|
353
|
+
rich_help_panel="TTF/OTF to WOFF options",
|
|
354
354
|
),
|
|
355
355
|
] = True,
|
|
356
356
|
obfuscate_names: Annotated[
|
|
@@ -358,7 +358,7 @@ def ft2wf(
|
|
|
358
358
|
typer.Option(
|
|
359
359
|
"--obfuscate-names/--no-obfuscate-names",
|
|
360
360
|
help="Replace identifying font names with hashes.",
|
|
361
|
-
rich_help_panel="
|
|
361
|
+
rich_help_panel="TTF/OTF to WOFF options",
|
|
362
362
|
),
|
|
363
363
|
] = False,
|
|
364
364
|
remove_unused_glyphs: Annotated[
|
|
@@ -366,7 +366,7 @@ def ft2wf(
|
|
|
366
366
|
typer.Option(
|
|
367
367
|
"--remove-unused-glyphs/--no-remove-unused-glyphs",
|
|
368
368
|
help="Remove glyphs unused by the cmap and OpenType features.",
|
|
369
|
-
rich_help_panel="
|
|
369
|
+
rich_help_panel="TTF/OTF to WOFF options",
|
|
370
370
|
),
|
|
371
371
|
] = False,
|
|
372
372
|
remove_non_windows_names: Annotated[
|
|
@@ -374,7 +374,7 @@ def ft2wf(
|
|
|
374
374
|
typer.Option(
|
|
375
375
|
"--remove-non-windows-names/--no-remove-non-windows-names",
|
|
376
376
|
help="Remove name records whose platform ID is not Windows.",
|
|
377
|
-
rich_help_panel="
|
|
377
|
+
rich_help_panel="TTF/OTF to WOFF options",
|
|
378
378
|
),
|
|
379
379
|
] = False,
|
|
380
380
|
remove_dsig: Annotated[
|
|
@@ -382,7 +382,7 @@ def ft2wf(
|
|
|
382
382
|
typer.Option(
|
|
383
383
|
"--remove-dsig/--no-remove-dsig",
|
|
384
384
|
help="Remove the DSIG table from WOFF output.",
|
|
385
|
-
rich_help_panel="
|
|
385
|
+
rich_help_panel="TTF/OTF to WOFF options",
|
|
386
386
|
),
|
|
387
387
|
] = False,
|
|
388
388
|
css_kit: Annotated[
|
|
@@ -390,7 +390,7 @@ def ft2wf(
|
|
|
390
390
|
typer.Option(
|
|
391
391
|
"--css-kit/--no-css-kit",
|
|
392
392
|
help="Generate fonts.css.",
|
|
393
|
-
rich_help_panel="
|
|
393
|
+
rich_help_panel="TTF/OTF to WOFF options",
|
|
394
394
|
),
|
|
395
395
|
] = False,
|
|
396
396
|
output_dir: OutputDir = None,
|
|
@@ -400,7 +400,7 @@ def ft2wf(
|
|
|
400
400
|
recalc_timestamp: RecalcTimestamp = False,
|
|
401
401
|
reorder_tables: ReorderTables = True,
|
|
402
402
|
) -> None:
|
|
403
|
-
"""Convert
|
|
403
|
+
"""Convert TTF or OTF fonts to WOFF and/or WOFF2."""
|
|
404
404
|
if not woff and not woff2:
|
|
405
405
|
raise typer.BadParameter("Select at least one output format with --woff or --woff2.")
|
|
406
406
|
_run(
|
|
@@ -432,7 +432,7 @@ def woff2ft(
|
|
|
432
432
|
recalc_timestamp: RecalcTimestamp = False,
|
|
433
433
|
reorder_tables: ReorderTables = True,
|
|
434
434
|
) -> None:
|
|
435
|
-
"""Convert WOFF fonts back to
|
|
435
|
+
"""Convert WOFF fonts back to TTF or OTF."""
|
|
436
436
|
_run(
|
|
437
437
|
"woff2ft",
|
|
438
438
|
inputs,
|
|
@@ -456,7 +456,7 @@ def woff22ft(
|
|
|
456
456
|
recalc_timestamp: RecalcTimestamp = False,
|
|
457
457
|
reorder_tables: ReorderTables = True,
|
|
458
458
|
) -> None:
|
|
459
|
-
"""Convert WOFF2 fonts back to
|
|
459
|
+
"""Convert WOFF2 fonts back to TTF or OTF."""
|
|
460
460
|
_run(
|
|
461
461
|
"woff22ft",
|
|
462
462
|
inputs,
|
|
@@ -480,7 +480,7 @@ def ttc2sfnt(
|
|
|
480
480
|
recalc_timestamp: RecalcTimestamp = False,
|
|
481
481
|
reorder_tables: ReorderTables = True,
|
|
482
482
|
) -> None:
|
|
483
|
-
"""Extract each font from TrueType Collections (TTC) as a separate
|
|
483
|
+
"""Extract each font from TrueType Collections (TTC/OTC) as a separate TTF or OTF font."""
|
|
484
484
|
_run(
|
|
485
485
|
"ttc2sfnt",
|
|
486
486
|
inputs,
|
|
@@ -165,7 +165,7 @@ class FontFinder:
|
|
|
165
165
|
and self.filter.filter_out_woff2
|
|
166
166
|
and self.filter.filter_out_sfnt
|
|
167
167
|
):
|
|
168
|
-
raise FinderError("Cannot filter out WOFF, WOFF2 and
|
|
168
|
+
raise FinderError("Cannot filter out WOFF, WOFF2, TTF and OTF fonts at the same time.")
|
|
169
169
|
if self.filter.filter_out_static and self.filter.filter_out_variable:
|
|
170
170
|
raise FinderError("Cannot filter out both static and variable fonts.")
|
|
171
171
|
|
|
@@ -276,7 +276,7 @@ class Font:
|
|
|
276
276
|
|
|
277
277
|
def to_sfnt(self) -> None:
|
|
278
278
|
if self.is_sfnt:
|
|
279
|
-
raise FontConversionError("Font is already a
|
|
279
|
+
raise FontConversionError("Font is already a TTF or OTF font.")
|
|
280
280
|
self.ttfont.flavor = None
|
|
281
281
|
|
|
282
282
|
def remove_unused_glyphs(self) -> int:
|
|
@@ -35,7 +35,8 @@ from font_converter.gui.widgets import (
|
|
|
35
35
|
set_drag_over,
|
|
36
36
|
)
|
|
37
37
|
from font_converter.inspection import AxisInfo, FontInfo
|
|
38
|
-
from font_converter.
|
|
38
|
+
from font_converter.models import InstanceSpec
|
|
39
|
+
from font_converter.service import instance_label, instance_stem
|
|
39
40
|
|
|
40
41
|
_SPEC_ROLE = Qt.ItemDataRole.UserRole
|
|
41
42
|
_CUSTOM_ROLE = Qt.ItemDataRole.UserRole + 1
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
CONVERSIONS: dict[str, str] = {
|
|
4
4
|
"ttf2otf": "TrueType → PostScript (TTF → OTF)",
|
|
5
5
|
"otf2ttf": "PostScript → TrueType (OTF → TTF)",
|
|
6
|
-
"ft2wf": "
|
|
7
|
-
"woff2ft": "WOFF →
|
|
8
|
-
"woff22ft": "WOFF2 →
|
|
9
|
-
"ttc2sfnt": "
|
|
6
|
+
"ft2wf": "TTF / OTF → WOFF / WOFF2",
|
|
7
|
+
"woff2ft": "WOFF → TTF / OTF",
|
|
8
|
+
"woff22ft": "WOFF2 → TTF / OTF",
|
|
9
|
+
"ttc2sfnt": "Collection (TTC/OTC) → TTF / OTF",
|
|
10
10
|
"var2static": "Variable → Static (instances)",
|
|
11
11
|
}
|
|
12
12
|
|