foundrytools-cli 1.0.2.1__tar.gz → 1.0.3__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.0.2.1/foundrytools_cli.egg-info → foundrytools-cli-1.0.3}/PKG-INFO +1 -1
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/Font.py +1 -4
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/ttf_to_otf.py +14 -15
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3/foundrytools_cli.egg-info}/PKG-INFO +1 -1
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/setup.py +1 -1
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/LICENSE +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/MANIFEST.in +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/README.md +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/__init__.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_assistant.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_cff.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_converter.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_fix.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_hhea.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_metrics.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_name.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_os2.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_otf.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_post.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_print.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_ttf.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/CLI/ftcli_utils.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/VFont.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/__init__.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/assistant/UI.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/assistant/__init__.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/assistant/fonts_data.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/assistant/styles_mapping.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/constants.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/__init__.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/options.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/otf_to_ttf.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/sfnt_to_web.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/ttc_to_sfnt.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/variable_to_static.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/web_to_sfnt.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/printer/UI.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/printer/__init__.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/tables/CFF_.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/tables/OS_2.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/tables/__init__.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/tables/head.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/tables/hhea.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/tables/name.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/tables/post.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/utils/__init__.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/utils/bits_tools.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/utils/cli_tools.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/utils/click_tools.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/utils/otf_tools.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/utils/skia_tools.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/utils/text_tools.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/utils/ttf_tools.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/__init__.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/__main__.py +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundrytools_cli.egg-info/SOURCES.txt +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundrytools_cli.egg-info/dependency_links.txt +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundrytools_cli.egg-info/entry_points.txt +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundrytools_cli.egg-info/not-zip-safe +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundrytools_cli.egg-info/requires.txt +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundrytools_cli.egg-info/top_level.txt +0 -0
- {foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/setup.cfg +0 -0
|
@@ -6,6 +6,7 @@ from pathlib import Path
|
|
|
6
6
|
from beziers.line import Line
|
|
7
7
|
from beziers.path import BezierPath
|
|
8
8
|
from beziers.point import Point
|
|
9
|
+
from cffsubr import subroutinize, desubroutinize
|
|
9
10
|
from fontTools.misc.psCharStrings import T2CharString
|
|
10
11
|
from fontTools.misc.timeTools import timestampToString
|
|
11
12
|
from fontTools.pens.boundsPen import BoundsPen
|
|
@@ -456,8 +457,6 @@ class Font(TTFont):
|
|
|
456
457
|
if not self.is_otf:
|
|
457
458
|
return
|
|
458
459
|
|
|
459
|
-
from cffsubr import desubroutinize
|
|
460
|
-
|
|
461
460
|
flavor = self.flavor
|
|
462
461
|
self.flavor = None
|
|
463
462
|
desubroutinize(otf=self)
|
|
@@ -470,8 +469,6 @@ class Font(TTFont):
|
|
|
470
469
|
if not self.is_otf:
|
|
471
470
|
return
|
|
472
471
|
|
|
473
|
-
from cffsubr import subroutinize
|
|
474
|
-
|
|
475
472
|
flavor = self.flavor
|
|
476
473
|
self.flavor = None
|
|
477
474
|
subroutinize(otf=self)
|
{foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/ttf_to_otf.py
RENAMED
|
@@ -57,11 +57,8 @@ class TTF2OTFRunner(object):
|
|
|
57
57
|
)
|
|
58
58
|
)
|
|
59
59
|
|
|
60
|
-
temp_source_fd, temp_source_file = tempfile.mkstemp(suffix=".ttf")
|
|
61
60
|
if self.options.scale_upm:
|
|
62
61
|
source_font.ttf_scale_upem(units_per_em=self.options.scale_upm)
|
|
63
|
-
source_font.save(temp_source_file)
|
|
64
|
-
source_font = Font(temp_source_file, recalcTimestamp=self.options.recalc_timestamp)
|
|
65
62
|
|
|
66
63
|
# Decomponentize the source font
|
|
67
64
|
source_font.ttf_decomponentize()
|
|
@@ -71,12 +68,7 @@ class TTF2OTFRunner(object):
|
|
|
71
68
|
|
|
72
69
|
if len(failed) > 0:
|
|
73
70
|
generic_info_message(f"Retrying to get {len(failed)} charstrings...")
|
|
74
|
-
|
|
75
|
-
t2_charstrings = get_t2_charstrings(font=source_font)
|
|
76
|
-
t2_otf_font: Font = t2_ttf2otf_converter.run(charstrings=t2_charstrings)
|
|
77
|
-
t2_otf_2_ttf_converter = CFFToTrueType(font=t2_otf_font)
|
|
78
|
-
t2_otf_2_ttf_font = t2_otf_2_ttf_converter.run()
|
|
79
|
-
_, fallback_charstrings = get_qu2cu_charstrings(t2_otf_2_ttf_font)
|
|
71
|
+
fallback_charstrings = get_fallback_charstrings(font=source_font)
|
|
80
72
|
|
|
81
73
|
for c in failed:
|
|
82
74
|
try:
|
|
@@ -90,16 +82,13 @@ class TTF2OTFRunner(object):
|
|
|
90
82
|
ttf2otf_converter = TrueTypeToCFF(font=source_font)
|
|
91
83
|
cff_font: Font = ttf2otf_converter.run(charstrings=charstrings)
|
|
92
84
|
|
|
85
|
+
cff_font.save(output_file)
|
|
86
|
+
cff_font = Font(output_file, recalcTimestamp=False)
|
|
93
87
|
cff_font.otf_fix_contours(min_area=25, verbose=False)
|
|
94
|
-
|
|
95
88
|
if self.options.subroutinize:
|
|
96
89
|
cff_font.otf_subroutinize()
|
|
97
|
-
|
|
98
|
-
cff_font.flavor = flavor
|
|
99
90
|
cff_font.save(output_file)
|
|
100
|
-
|
|
101
|
-
os.close(temp_source_fd)
|
|
102
|
-
os.remove(temp_source_file)
|
|
91
|
+
cff_font.close()
|
|
103
92
|
|
|
104
93
|
generic_info_message(f"Elapsed time: {round(time.time() - t, 3)} seconds")
|
|
105
94
|
file_saved_message(output_file)
|
|
@@ -226,3 +215,13 @@ def get_t2_charstrings(font: Font) -> dict:
|
|
|
226
215
|
t2_charstrings[k] = charstring
|
|
227
216
|
|
|
228
217
|
return t2_charstrings
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def get_fallback_charstrings(font: Font) -> dict:
|
|
221
|
+
ttf2otf_converter = TrueTypeToCFF(font=font)
|
|
222
|
+
t2_charstrings = get_t2_charstrings(font=font)
|
|
223
|
+
otf_font: Font = ttf2otf_converter.run(charstrings=t2_charstrings)
|
|
224
|
+
otf_2_ttf_converter = CFFToTrueType(font=otf_font)
|
|
225
|
+
otf_font = otf_2_ttf_converter.run()
|
|
226
|
+
_, fallback_charstrings = get_qu2cu_charstrings(otf_font)
|
|
227
|
+
return fallback_charstrings
|
|
@@ -7,7 +7,7 @@ long_description = this_directory.joinpath("README.md").read_text()
|
|
|
7
7
|
|
|
8
8
|
setuptools.setup(
|
|
9
9
|
name="foundrytools-cli",
|
|
10
|
-
version="1.0.
|
|
10
|
+
version="1.0.3",
|
|
11
11
|
description="A set of command line tools to inspect, manipulate and convert font files",
|
|
12
12
|
long_description=long_description,
|
|
13
13
|
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.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/assistant/__init__.py
RENAMED
|
File without changes
|
{foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/assistant/fonts_data.py
RENAMED
|
File without changes
|
{foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/assistant/styles_mapping.py
RENAMED
|
File without changes
|
|
File without changes
|
{foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/__init__.py
RENAMED
|
File without changes
|
{foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/options.py
RENAMED
|
File without changes
|
{foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/otf_to_ttf.py
RENAMED
|
File without changes
|
{foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/sfnt_to_web.py
RENAMED
|
File without changes
|
{foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/converters/ttc_to_sfnt.py
RENAMED
|
File without changes
|
|
File without changes
|
{foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/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.0.2.1 → foundrytools-cli-1.0.3}/foundryToolsCLI/Lib/utils/click_tools.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
|
{foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundrytools_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{foundrytools-cli-1.0.2.1 → foundrytools-cli-1.0.3}/foundrytools_cli.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|