foundrytools-cli 2.0.2__py3-none-any.whl → 2.0.4__py3-none-any.whl
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.
- foundrytools_cli/__init__.py +1 -1
- foundrytools_cli/commands/converter/cli.py +3 -1
- foundrytools_cli/commands/print/cli.py +14 -0
- foundrytools_cli/commands/print/vf_instances.py +47 -0
- foundrytools_cli/commands/utils/cli.py +10 -0
- foundrytools_cli/commands/utils/font_renamer.py +2 -2
- {foundrytools_cli-2.0.2.dist-info → foundrytools_cli-2.0.4.dist-info}/METADATA +9 -8
- {foundrytools_cli-2.0.2.dist-info → foundrytools_cli-2.0.4.dist-info}/RECORD +17 -17
- foundrytools_cli-2.0.4.dist-info/WHEEL +4 -0
- {foundrytools_cli-2.0.2.dist-info → foundrytools_cli-2.0.4.dist-info}/entry_points.txt +1 -0
- foundrytools_cli-2.0.2.dist-info/WHEEL +0 -4
- foundrytools_cli-2.0.2.dist-info/licenses/LICENSE +0 -21
foundrytools_cli/__init__.py
CHANGED
|
@@ -358,6 +358,7 @@ def ttc_to_sfnt(input_path: Path, **options: dict[str, Any]) -> None:
|
|
|
358
358
|
recursive = bool(options.get("recursive", False))
|
|
359
359
|
overwrite = bool(options.get("overwrite", True))
|
|
360
360
|
recalc_bboxes = bool(options.get("recalc_bboxes", True))
|
|
361
|
+
recalc_timestamp = bool(options.get("recalc_timestamp", False))
|
|
361
362
|
reorder_tables = bool(options.get("reorder_tables", False))
|
|
362
363
|
|
|
363
364
|
finder = FontFinder(input_path)
|
|
@@ -383,8 +384,9 @@ def ttc_to_sfnt(input_path: Path, **options: dict[str, Any]) -> None:
|
|
|
383
384
|
logger.info(f"Converting {collection_file} ({num_fonts} fonts in collection)")
|
|
384
385
|
|
|
385
386
|
for font in collection.fonts:
|
|
387
|
+
font.recalcBBoxes = recalc_bboxes
|
|
388
|
+
font.recalcTimestamp = recalc_timestamp
|
|
386
389
|
font_wrapper = Font(font)
|
|
387
|
-
font_wrapper.ttfont.recalcBBoxes = recalc_bboxes
|
|
388
390
|
file_stem = font_wrapper.t_name.get_debug_name(6)
|
|
389
391
|
file_ext = font_wrapper.get_file_ext()
|
|
390
392
|
|
|
@@ -6,10 +6,24 @@ from foundrytools import FontFinder
|
|
|
6
6
|
|
|
7
7
|
from foundrytools_cli.commands.print.font_info import main as print_font_info
|
|
8
8
|
from foundrytools_cli.commands.print.font_names import main as print_names
|
|
9
|
+
from foundrytools_cli.commands.print.vf_instances import main as print_vf_instances
|
|
9
10
|
|
|
10
11
|
cli = click.Group(help="Prints various font's information.")
|
|
11
12
|
|
|
12
13
|
|
|
14
|
+
@cli.command("instances")
|
|
15
|
+
@click.argument("input_path", type=click.Path(exists=True, resolve_path=True, path_type=Path))
|
|
16
|
+
def instances(input_path: Path) -> None:
|
|
17
|
+
"""
|
|
18
|
+
Prints a table with the variable font instances.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
finder = FontFinder(input_path)
|
|
22
|
+
finder.filter.filter_out_static = True
|
|
23
|
+
for font in finder.generate_fonts():
|
|
24
|
+
print_vf_instances(font)
|
|
25
|
+
|
|
26
|
+
|
|
13
27
|
@cli.command("font-info")
|
|
14
28
|
@click.argument("input_path", type=click.Path(exists=True, resolve_path=True, path_type=Path))
|
|
15
29
|
def font_info(input_path: Path) -> None:
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from fontTools.ttLib.tables._f_v_a_r import Axis, NamedInstance
|
|
2
|
+
from foundrytools import Font
|
|
3
|
+
from rich.console import Console
|
|
4
|
+
from rich.table import Table
|
|
5
|
+
|
|
6
|
+
__all__ = ["main"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def main(font: Font) -> None:
|
|
10
|
+
"""
|
|
11
|
+
Prints the variable font instances in a table format.
|
|
12
|
+
"""
|
|
13
|
+
console = Console()
|
|
14
|
+
|
|
15
|
+
table = Table(
|
|
16
|
+
title="\nftCLI - Variable Font Instances Viewer",
|
|
17
|
+
show_header=True,
|
|
18
|
+
header_style="bold cyan",
|
|
19
|
+
title_style="bold green",
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
axes: list[Axis] = font.t_fvar.table.axes
|
|
23
|
+
instances: list[NamedInstance] = font.t_fvar.table.instances
|
|
24
|
+
|
|
25
|
+
table.add_section()
|
|
26
|
+
table.add_column("#")
|
|
27
|
+
for axis in axes:
|
|
28
|
+
table.add_column(axis.axisTag)
|
|
29
|
+
table.add_column("postscriptNameID")
|
|
30
|
+
table.add_column("subfamilyNameID")
|
|
31
|
+
|
|
32
|
+
for count, instance in enumerate(instances, start=1):
|
|
33
|
+
subfamily_name = (
|
|
34
|
+
f"{instance.subfamilyNameID}: "
|
|
35
|
+
f"{font.t_name.table.getDebugName(instance.subfamilyNameID)}"
|
|
36
|
+
)
|
|
37
|
+
postscript_name = (
|
|
38
|
+
f"{instance.postscriptNameID}: "
|
|
39
|
+
f"{font.t_name.table.getDebugName(instance.postscriptNameID)}"
|
|
40
|
+
)
|
|
41
|
+
table.add_row(
|
|
42
|
+
str(count),
|
|
43
|
+
*[str(v) for k, v in instance.coordinates.items() if k in [a.axisTag for a in axes]],
|
|
44
|
+
postscript_name,
|
|
45
|
+
subfamily_name,
|
|
46
|
+
)
|
|
47
|
+
console.print(table)
|
|
@@ -54,6 +54,16 @@ cli = click.Group(help="Miscellaneous utilities.")
|
|
|
54
54
|
5: CFF TopDict FullName (CFF fonts only)
|
|
55
55
|
""",
|
|
56
56
|
)
|
|
57
|
+
@click.option(
|
|
58
|
+
"-o",
|
|
59
|
+
"--overwrite",
|
|
60
|
+
"overwrite",
|
|
61
|
+
is_flag=True,
|
|
62
|
+
help="""
|
|
63
|
+
Allow overwriting output files. THIS MIGHT POTENTIALLY RESULT IN LOSS OF FILES.
|
|
64
|
+
USE WITH CARE.
|
|
65
|
+
""",
|
|
66
|
+
)
|
|
57
67
|
@recursive_flag()
|
|
58
68
|
def font_renamer(input_path: Path, **options: dict[str, Any]) -> None:
|
|
59
69
|
"""
|
|
@@ -54,7 +54,7 @@ def _get_file_stem(font: Font, source: int = 1) -> str:
|
|
|
54
54
|
return sanitize_filename(file_name, platform="auto")
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
def main(font: Font, source: int = 1) -> None:
|
|
57
|
+
def main(font: Font, source: int = 1, overwrite: bool = False) -> None:
|
|
58
58
|
"""
|
|
59
59
|
Renames the given font files.
|
|
60
60
|
"""
|
|
@@ -71,7 +71,7 @@ def main(font: Font, source: int = 1) -> None:
|
|
|
71
71
|
file=Path(new_file_name),
|
|
72
72
|
extension=font.get_file_ext(),
|
|
73
73
|
output_dir=old_file.parent,
|
|
74
|
-
overwrite=
|
|
74
|
+
overwrite=overwrite,
|
|
75
75
|
)
|
|
76
76
|
if new_file == old_file:
|
|
77
77
|
logger.skip(f"{old_file.name} is already named correctly") # type: ignore
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: foundrytools-cli
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.4
|
|
4
4
|
Summary: A set of command line tools to inspect, manipulate and convert font files
|
|
5
|
-
|
|
5
|
+
Author: Cesare Gilento
|
|
6
6
|
Author-email: Cesare Gilento <ftcli@proton.me>
|
|
7
7
|
License-Expression: MIT
|
|
8
|
-
License-File: LICENSE
|
|
9
8
|
Classifier: Development Status :: 5 - Production/Stable
|
|
10
9
|
Classifier: Intended Audience :: Developers
|
|
11
10
|
Classifier: Intended Audience :: End Users/Desktop
|
|
12
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
13
11
|
Classifier: Natural Language :: English
|
|
14
12
|
Classifier: Operating System :: OS Independent
|
|
15
13
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -18,15 +16,18 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
18
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
21
20
|
Classifier: Topic :: Text Processing :: Fonts
|
|
22
|
-
Requires-Python: >=3.9
|
|
23
21
|
Requires-Dist: afdko>=4.0.2
|
|
24
22
|
Requires-Dist: click>=8.1.8
|
|
25
23
|
Requires-Dist: foundrytools>=0.1.4
|
|
26
24
|
Requires-Dist: loguru>=0.7.3
|
|
27
|
-
Requires-Dist: pathvalidate>=3.
|
|
28
|
-
Requires-Dist: rich>=14.
|
|
29
|
-
Requires-Dist:
|
|
25
|
+
Requires-Dist: pathvalidate>=3.3.1
|
|
26
|
+
Requires-Dist: rich>=14.1.0
|
|
27
|
+
Requires-Dist: ufolib2>=0.18.1
|
|
28
|
+
Requires-Dist: win32-setctime>=1.2.0 ; sys_platform >= 'win32'
|
|
29
|
+
Requires-Python: >=3.9
|
|
30
|
+
Project-URL: Homepage, https://github.com/ftCLI/FoundryTools-CLI
|
|
30
31
|
Description-Content-Type: text/markdown
|
|
31
32
|
|
|
32
33
|
# FoundryTools-CLI
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
foundrytools_cli/__init__.py,sha256=
|
|
1
|
+
foundrytools_cli/__init__.py,sha256=QBdIHrTuNzHH7pLNzUAs3oX-Q7u9hbQBrhKcqOOl-gU,55
|
|
2
2
|
foundrytools_cli/__main__.py,sha256=KbGmBzK1G41I6uLPlw4tOWcN4KBdN3t-9JP7-JdiBa8,1319
|
|
3
3
|
foundrytools_cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
foundrytools_cli/commands/cff.py,sha256=892d4o4s6rE9tUIFDN-UjwLayGwDXvMuiG3MZOdJrGE,3359
|
|
5
5
|
foundrytools_cli/commands/cmap.py,sha256=ZJYtBScffEfcUYaz0RDyL7dwO6X8klJJXVMSQ_AZJ8I,1236
|
|
6
|
+
foundrytools_cli/commands/converter/__init__.py,sha256=4p2HoanTsHRDQBYod4dYIFreH2sSRWo1VpxfYWeX9lA,75
|
|
7
|
+
foundrytools_cli/commands/converter/cli.py,sha256=tqL4Etfx_6UFOXGU5GbW0P7dpdBP6Eky56xov_DHIZs,13023
|
|
8
|
+
foundrytools_cli/commands/converter/ttf_to_otf.py,sha256=2FM2bAaof_4aPSbZlJLeJ027j6N9w4Ns1g5jU-iGy2o,7665
|
|
9
|
+
foundrytools_cli/commands/fix/__init__.py,sha256=1kJOW26OAkCYYvYDG2H9sCSqqQUQEtwzyxAqCrNfKeU,69
|
|
10
|
+
foundrytools_cli/commands/fix/cli.py,sha256=t1c44mnQg6kLI-7rss_ju-wMVsbjxMaWSqCGbzvDzEc,16507
|
|
11
|
+
foundrytools_cli/commands/fix/legacy_accents.py,sha256=pUHWxV-a2GZgI8W_K2u-lu2yMQt5YKEpQHUD9FyKl8A,2094
|
|
12
|
+
foundrytools_cli/commands/fix/vertical_metrics.py,sha256=j563oWfe3znOKuEW333Yx60d_14Nt0cGdXg3mkCTIN8,691
|
|
6
13
|
foundrytools_cli/commands/font.py,sha256=suSZotxn3JDByOqSlZaEac2Aga0rMUNx_NzCYcKpkzE,8256
|
|
7
14
|
foundrytools_cli/commands/gsub.py,sha256=iaOAy4jqW6p_RIBxvixtwaEV5AQivaezy0k_Mcufoqg,1454
|
|
8
15
|
foundrytools_cli/commands/hhea.py,sha256=59G0QFgx5uoCUYpnXYAatkq0iZZ5KXaizzuQUNr1jR4,3085
|
|
@@ -10,29 +17,22 @@ foundrytools_cli/commands/name.py,sha256=q3VGIK42G8rHNyHZF-QkyzxmNTreoTROcuc1i3J
|
|
|
10
17
|
foundrytools_cli/commands/os_2.py,sha256=m8jxOIXKnY1Yu-27sn51kFmXCJMcuKVbbIEcNDgy3ME,19525
|
|
11
18
|
foundrytools_cli/commands/otf.py,sha256=uienJ97SlDZ0iWPsNU5wJdosjDBxrKZPjpYG68lz9WU,10347
|
|
12
19
|
foundrytools_cli/commands/post.py,sha256=DpKVNuvvyxF14SsA0gYc09-Asw_4_T8wpYC62uiGa7U,2038
|
|
13
|
-
foundrytools_cli/commands/ttf.py,sha256=0ZJc36MM8m12_reMVD6GS5ZpSt84g_9RpXrKz_zqqfI,2151
|
|
14
|
-
foundrytools_cli/commands/converter/__init__.py,sha256=4p2HoanTsHRDQBYod4dYIFreH2sSRWo1VpxfYWeX9lA,75
|
|
15
|
-
foundrytools_cli/commands/converter/cli.py,sha256=W54AruWhytWL5V1mvWmdwOJTMEa0TkZgtxUmw55fo_g,12918
|
|
16
|
-
foundrytools_cli/commands/converter/ttf_to_otf.py,sha256=2FM2bAaof_4aPSbZlJLeJ027j6N9w4Ns1g5jU-iGy2o,7665
|
|
17
|
-
foundrytools_cli/commands/fix/__init__.py,sha256=1kJOW26OAkCYYvYDG2H9sCSqqQUQEtwzyxAqCrNfKeU,69
|
|
18
|
-
foundrytools_cli/commands/fix/cli.py,sha256=t1c44mnQg6kLI-7rss_ju-wMVsbjxMaWSqCGbzvDzEc,16507
|
|
19
|
-
foundrytools_cli/commands/fix/legacy_accents.py,sha256=pUHWxV-a2GZgI8W_K2u-lu2yMQt5YKEpQHUD9FyKl8A,2094
|
|
20
|
-
foundrytools_cli/commands/fix/vertical_metrics.py,sha256=j563oWfe3znOKuEW333Yx60d_14Nt0cGdXg3mkCTIN8,691
|
|
21
20
|
foundrytools_cli/commands/print/__init__.py,sha256=B1h44RtXGw3V4X5se75oCvQPWkh0RbQ0luHxK6z4ge8,71
|
|
22
|
-
foundrytools_cli/commands/print/cli.py,sha256=
|
|
21
|
+
foundrytools_cli/commands/print/cli.py,sha256=tWVHV8vLChiMFwHMgIomQCAhdQp9kTipb3fnpV3P5Ik,1941
|
|
23
22
|
foundrytools_cli/commands/print/font_info.py,sha256=PNeqiJJApIJsyj_ycBMCLU_JE56srkTB-gNWEQ9U3Gk,7824
|
|
24
23
|
foundrytools_cli/commands/print/font_names.py,sha256=4HL3APW4hjfAg__e2w3fohsxOkn67PFrfAoZ-C4mDsY,4845
|
|
24
|
+
foundrytools_cli/commands/print/vf_instances.py,sha256=vpp3sMyCcNh9f6CBbOn5lnWr4nzNaIX_ANvyw6R2zWY,1398
|
|
25
|
+
foundrytools_cli/commands/ttf.py,sha256=0ZJc36MM8m12_reMVD6GS5ZpSt84g_9RpXrKz_zqqfI,2151
|
|
25
26
|
foundrytools_cli/commands/utils/__init__.py,sha256=bF8Ue4I4QAaDplSpDSMvtb4AZMWjcYsTNIL5ZBp6-t8,71
|
|
26
|
-
foundrytools_cli/commands/utils/cli.py,sha256=
|
|
27
|
+
foundrytools_cli/commands/utils/cli.py,sha256=6OfMrOxsxfNiCc8UaWCVHZgosRiVFUAWzlNYy_8zTrw,3840
|
|
27
28
|
foundrytools_cli/commands/utils/font_organizer.py,sha256=9biz8Cxg81qNGtK53zp4xhgncbItE5xRXBL1Y1ZWHqg,4096
|
|
28
|
-
foundrytools_cli/commands/utils/font_renamer.py,sha256=
|
|
29
|
+
foundrytools_cli/commands/utils/font_renamer.py,sha256=I-g5txxjGlHv7wTMkz9VKmYJ0-d04Z18iJPX0v30MRc,3285
|
|
29
30
|
foundrytools_cli/commands/utils/sync_timestamps.py,sha256=mgmuX6-X07c1mw0pyBqG694_mQiBZjpPolBEjxa8Wvc,4127
|
|
30
31
|
foundrytools_cli/utils/__init__.py,sha256=OHiBHGK9qmQ8UQKwOfRQi3bFZUm-LmcfB94AKI0PFSk,8002
|
|
31
32
|
foundrytools_cli/utils/logger.py,sha256=ZjVgZ1AmzwwH1GEnBU1HP-pFvZv0BKkVV93P2gYvnLc,525
|
|
32
33
|
foundrytools_cli/utils/task_runner.py,sha256=DZMTt_yByOD7wvAAxkiOLYj-Z0kiNOaeOdimcx0_jwE,7114
|
|
33
34
|
foundrytools_cli/utils/timer.py,sha256=if4mLjDhTIhoAd_ZxydtHp8Ng9y7lG3VjqxOix4M0so,1862
|
|
34
|
-
foundrytools_cli-2.0.
|
|
35
|
-
foundrytools_cli-2.0.
|
|
36
|
-
foundrytools_cli-2.0.
|
|
37
|
-
foundrytools_cli-2.0.
|
|
38
|
-
foundrytools_cli-2.0.2.dist-info/RECORD,,
|
|
35
|
+
foundrytools_cli-2.0.4.dist-info/WHEEL,sha256=3id4o64OvRm9dUknh3mMJNcfoTRK08ua5cU6DFyVy-4,79
|
|
36
|
+
foundrytools_cli-2.0.4.dist-info/entry_points.txt,sha256=sNn6z8yZnx3Koh85LS6BYDqzaXZSP4KEvN3AdFGYRao,57
|
|
37
|
+
foundrytools_cli-2.0.4.dist-info/METADATA,sha256=UKVBTK-po0RNMNWU5ZUObrjyKLav-jEbDlmvsLexBxg,3969
|
|
38
|
+
foundrytools_cli-2.0.4.dist-info/RECORD,,
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 ftCLI
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|