foundrytools-cli 1.1.16__tar.gz → 1.1.17__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.
- {foundrytools_cli-1.1.16/foundrytools_cli.egg-info → foundrytools_cli-1.1.17}/PKG-INFO +1 -1
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_utils.py +80 -2
- foundrytools_cli-1.1.17/foundryToolsCLI/__init__.py +3 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17/foundrytools_cli.egg-info}/PKG-INFO +1 -1
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/setup.py +1 -1
- foundrytools_cli-1.1.16/foundryToolsCLI/__init__.py +0 -3
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/LICENSE +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/MANIFEST.in +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/README.md +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/__init__.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_assistant.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_cff.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_converter.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_fix.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_hhea.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_metrics.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_name.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_os2.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_otf.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_post.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_print.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/CLI/ftcli_ttf.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/Font.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/VFont.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/__init__.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/assistant/UI.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/assistant/__init__.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/assistant/fonts_data.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/assistant/styles_mapping.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/constants.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/__init__.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/options.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/otf_to_ttf.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/sfnt_to_web.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/ttc_to_sfnt.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/ttf_to_otf.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/variable_to_static.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/web_to_sfnt.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/printer/UI.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/printer/__init__.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/tables/CFF_.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/tables/OS_2.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/tables/__init__.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/tables/head.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/tables/hhea.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/tables/name.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/tables/post.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/__init__.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/bits_tools.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/cli_tools.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/click_tools.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/logger.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/otf_tools.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/ps_recalc_stems.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/ps_recalc_zones.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/skia_tools.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/text_tools.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/timer.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/ttf_tools.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/__main__.py +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundrytools_cli.egg-info/SOURCES.txt +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundrytools_cli.egg-info/dependency_links.txt +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundrytools_cli.egg-info/entry_points.txt +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundrytools_cli.egg-info/not-zip-safe +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundrytools_cli.egg-info/requires.txt +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundrytools_cli.egg-info/top_level.txt +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/requirements.txt +0 -0
- {foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/setup.cfg +0 -0
|
@@ -5,6 +5,7 @@ from copy import deepcopy
|
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
|
|
7
7
|
import click
|
|
8
|
+
from afdko.fdkutils import run_shell_command
|
|
8
9
|
from fontTools.misc.cliTools import makeOutputFileName
|
|
9
10
|
from fontTools.ttLib import TTFont
|
|
10
11
|
from pathvalidate import sanitize_filename, sanitize_filepath
|
|
@@ -254,8 +255,18 @@ def font_organizer(
|
|
|
254
255
|
""",
|
|
255
256
|
)
|
|
256
257
|
@add_recursive_option()
|
|
258
|
+
@click.option(
|
|
259
|
+
"-o",
|
|
260
|
+
"--overwrite",
|
|
261
|
+
"overwrite",
|
|
262
|
+
is_flag=True,
|
|
263
|
+
help="""
|
|
264
|
+
Allow overwriting output files. THIS MIGHT POTENTIALLY RESULT IN LOSS OF FILES.
|
|
265
|
+
USE WITH CARE. This might result in a loss of files.
|
|
266
|
+
""",
|
|
267
|
+
)
|
|
257
268
|
@Timer(logger=logger.info)
|
|
258
|
-
def font_renamer(input_path: Path, source: str, recursive: bool = False):
|
|
269
|
+
def font_renamer(input_path: Path, source: str, recursive: bool = False, overwrite: bool = False):
|
|
259
270
|
"""
|
|
260
271
|
Rename font files according to the provided source string.
|
|
261
272
|
"""
|
|
@@ -283,7 +294,7 @@ def font_renamer(input_path: Path, source: str, recursive: bool = False):
|
|
|
283
294
|
new_file_name,
|
|
284
295
|
extension=new_file_extension,
|
|
285
296
|
outputDir=file.parent,
|
|
286
|
-
overWrite=
|
|
297
|
+
overWrite=overwrite,
|
|
287
298
|
)
|
|
288
299
|
)
|
|
289
300
|
file.rename(output_file)
|
|
@@ -347,6 +358,73 @@ def rebuild(
|
|
|
347
358
|
font.close()
|
|
348
359
|
|
|
349
360
|
|
|
361
|
+
@utils.command()
|
|
362
|
+
@add_file_or_path_argument()
|
|
363
|
+
@add_recursive_option()
|
|
364
|
+
@add_common_options()
|
|
365
|
+
@Timer(logger=logger.info)
|
|
366
|
+
def remove_unreachable_glyphs(
|
|
367
|
+
input_path: Path,
|
|
368
|
+
recursive: bool = False,
|
|
369
|
+
output_dir: t.Optional[Path] = None,
|
|
370
|
+
recalc_timestamp: bool = False,
|
|
371
|
+
overwrite: bool = True,
|
|
372
|
+
):
|
|
373
|
+
"""
|
|
374
|
+
Subsets a font file by removing unreachable glyphs.
|
|
375
|
+
"""
|
|
376
|
+
|
|
377
|
+
fonts = get_fonts_in_path(
|
|
378
|
+
input_path=input_path, recursive=recursive, recalc_timestamp=recalc_timestamp
|
|
379
|
+
)
|
|
380
|
+
if not initial_check_pass(fonts=fonts, output_dir=output_dir):
|
|
381
|
+
return
|
|
382
|
+
|
|
383
|
+
for font in fonts:
|
|
384
|
+
try:
|
|
385
|
+
in_file = Path(font.reader.file.name)
|
|
386
|
+
out_file = Path(makeOutputFileName(in_file, outputDir=output_dir, overWrite=overwrite))
|
|
387
|
+
logger.opt(colors=True).info(Logs.current_file, file=in_file)
|
|
388
|
+
|
|
389
|
+
command = [
|
|
390
|
+
"fonttools",
|
|
391
|
+
"subset",
|
|
392
|
+
in_file,
|
|
393
|
+
f"--output-file={out_file}",
|
|
394
|
+
"--unicodes=*",
|
|
395
|
+
"--notdef-glyph",
|
|
396
|
+
"--notdef-outline",
|
|
397
|
+
"--layout-features=*",
|
|
398
|
+
"--layout-scripts=*",
|
|
399
|
+
"--drop-tables=",
|
|
400
|
+
"--passthrough-tables",
|
|
401
|
+
"--legacy-kern",
|
|
402
|
+
"--name-IDs=*",
|
|
403
|
+
"--name-legacy",
|
|
404
|
+
"--name-languages=*",
|
|
405
|
+
"--glyph-names",
|
|
406
|
+
"--legacy-cmap",
|
|
407
|
+
"--symbol-cmap",
|
|
408
|
+
"--recalc-bounds",
|
|
409
|
+
"--recalc-average-width",
|
|
410
|
+
"--recalc-max-context",
|
|
411
|
+
]
|
|
412
|
+
|
|
413
|
+
if recalc_timestamp:
|
|
414
|
+
command.append("--recalc-timestamp")
|
|
415
|
+
else:
|
|
416
|
+
command.append("--no-recalc-timestamp")
|
|
417
|
+
|
|
418
|
+
run_shell_command(command)
|
|
419
|
+
|
|
420
|
+
logger.success(Logs.file_saved, file=out_file)
|
|
421
|
+
|
|
422
|
+
except Exception as e:
|
|
423
|
+
logger.exception(e)
|
|
424
|
+
finally:
|
|
425
|
+
font.close()
|
|
426
|
+
|
|
427
|
+
|
|
350
428
|
@utils.command()
|
|
351
429
|
@add_file_or_path_argument()
|
|
352
430
|
@click.option("-major", type=click.IntRange(0, 999), help="Major version")
|
|
@@ -18,7 +18,7 @@ def _get_requirements():
|
|
|
18
18
|
|
|
19
19
|
setuptools.setup(
|
|
20
20
|
name="foundrytools-cli",
|
|
21
|
-
version="1.1.
|
|
21
|
+
version="1.1.17",
|
|
22
22
|
description="A set of command line tools to inspect, manipulate and convert font files",
|
|
23
23
|
long_description=long_description,
|
|
24
24
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/assistant/__init__.py
RENAMED
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/assistant/fonts_data.py
RENAMED
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/assistant/styles_mapping.py
RENAMED
|
File without changes
|
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/__init__.py
RENAMED
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/options.py
RENAMED
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/otf_to_ttf.py
RENAMED
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/sfnt_to_web.py
RENAMED
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/ttc_to_sfnt.py
RENAMED
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/ttf_to_otf.py
RENAMED
|
File without changes
|
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/converters/web_to_sfnt.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/click_tools.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/ps_recalc_stems.py
RENAMED
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundryToolsCLI/Lib/utils/ps_recalc_zones.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundrytools_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{foundrytools_cli-1.1.16 → foundrytools_cli-1.1.17}/foundrytools_cli.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|