foundrytools-cli 1.1.5__tar.gz → 1.1.6__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.
Files changed (68) hide show
  1. {foundrytools-cli-1.1.5/foundrytools_cli.egg-info → foundrytools-cli-1.1.6}/PKG-INFO +4 -4
  2. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_cff.py +1 -0
  3. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/ps_recalc_zones.py +33 -4
  4. foundrytools-cli-1.1.6/foundryToolsCLI/__init__.py +3 -0
  5. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6/foundrytools_cli.egg-info}/PKG-INFO +4 -4
  6. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundrytools_cli.egg-info/requires.txt +3 -3
  7. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/requirements.txt +3 -3
  8. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/setup.py +1 -1
  9. foundrytools-cli-1.1.5/foundryToolsCLI/__init__.py +0 -3
  10. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/LICENSE +0 -0
  11. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/MANIFEST.in +0 -0
  12. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/README.md +0 -0
  13. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/__init__.py +0 -0
  14. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_assistant.py +0 -0
  15. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_converter.py +0 -0
  16. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_fix.py +0 -0
  17. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_hhea.py +0 -0
  18. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_metrics.py +0 -0
  19. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_name.py +0 -0
  20. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_os2.py +0 -0
  21. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_otf.py +0 -0
  22. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_post.py +0 -0
  23. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_print.py +0 -0
  24. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_ttf.py +0 -0
  25. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/CLI/ftcli_utils.py +0 -0
  26. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/Font.py +0 -0
  27. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/VFont.py +0 -0
  28. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/__init__.py +0 -0
  29. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/assistant/UI.py +0 -0
  30. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/assistant/__init__.py +0 -0
  31. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/assistant/fonts_data.py +0 -0
  32. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/assistant/styles_mapping.py +0 -0
  33. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/constants.py +0 -0
  34. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/converters/__init__.py +0 -0
  35. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/converters/options.py +0 -0
  36. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/converters/otf_to_ttf.py +0 -0
  37. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/converters/sfnt_to_web.py +0 -0
  38. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/converters/ttc_to_sfnt.py +0 -0
  39. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/converters/ttf_to_otf.py +0 -0
  40. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/converters/variable_to_static.py +0 -0
  41. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/converters/web_to_sfnt.py +0 -0
  42. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/printer/UI.py +0 -0
  43. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/printer/__init__.py +0 -0
  44. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/tables/CFF_.py +0 -0
  45. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/tables/OS_2.py +0 -0
  46. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/tables/__init__.py +0 -0
  47. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/tables/head.py +0 -0
  48. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/tables/hhea.py +0 -0
  49. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/tables/name.py +0 -0
  50. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/tables/post.py +0 -0
  51. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/__init__.py +0 -0
  52. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/bits_tools.py +0 -0
  53. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/cli_tools.py +0 -0
  54. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/click_tools.py +0 -0
  55. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/logger.py +0 -0
  56. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/otf_tools.py +0 -0
  57. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/ps_recalc_stems.py +0 -0
  58. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/skia_tools.py +0 -0
  59. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/text_tools.py +0 -0
  60. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/timer.py +0 -0
  61. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/Lib/utils/ttf_tools.py +0 -0
  62. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundryToolsCLI/__main__.py +0 -0
  63. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundrytools_cli.egg-info/SOURCES.txt +0 -0
  64. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundrytools_cli.egg-info/dependency_links.txt +0 -0
  65. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundrytools_cli.egg-info/entry_points.txt +0 -0
  66. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundrytools_cli.egg-info/not-zip-safe +0 -0
  67. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/foundrytools_cli.egg-info/top_level.txt +0 -0
  68. {foundrytools-cli-1.1.5 → foundrytools-cli-1.1.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foundrytools-cli
3
- Version: 1.1.5
3
+ Version: 1.1.6
4
4
  Summary: A set of command line tools to inspect, manipulate and convert font files
5
5
  Home-page: https://github.com/ftCLI/FoundryTools-CLI
6
6
  Author: ftCLI
@@ -10,11 +10,11 @@ Classifier: Operating System :: OS Independent
10
10
  Requires-Python: >=3.9
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
- Requires-Dist: afdko>=4.0.0
14
- Requires-Dist: fonttools>=4.46.0
13
+ Requires-Dist: afdko>=4.0.1
14
+ Requires-Dist: fonttools>=4.47.2
15
15
  Requires-Dist: brotli>=1.1.0
16
16
  Requires-Dist: click>=8.1.7
17
- Requires-Dist: cffsubr>=0.2.9.post1
17
+ Requires-Dist: cffsubr>=0.3.0
18
18
  Requires-Dist: dehinter>=4.0.0
19
19
  Requires-Dist: loguru>=0.7.2
20
20
  Requires-Dist: pathvalidate>=3.2.0
@@ -33,6 +33,7 @@ tbl_cff = click.Group("subcommands")
33
33
  "--copyright", "Copyright", is_flag=True, help="Deletes CFF.cff.topDictIndex[0] Copyright"
34
34
  )
35
35
  @click.option("--notice", "Notice", is_flag=True, help="Deletes CFF.cff.topDictIndex[0] Copyright")
36
+ @click.option("--unique-id", "UniqueID", is_flag=True, help="Deletes CFF.cff.topDictIndex[0] UniqueID")
36
37
  @add_recursive_option()
37
38
  @add_common_options()
38
39
  @Timer(logger=logger.info)
@@ -4,9 +4,9 @@ from collections import Counter
4
4
  from fontTools.pens.boundsPen import BoundsPen
5
5
  from fontTools.ttLib.ttFont import TTFont
6
6
 
7
- UPPERCASE_LETTERS = [chr(i) for i in range(65, 91)]
7
+ UPPERCASE_LETTERS = [chr(i) for i in range(65, 91)] # A-Z
8
8
  UPPERCASE_DESCENDERS = ["J", "Q"]
9
- LOWERCASE_LETTERS = [chr(i) for i in range(97, 123)]
9
+ LOWERCASE_LETTERS = [chr(i) for i in range(97, 123)] # a-z
10
10
  LOWERCASE_DESCENDERS = ["f", "g", "j", "p", "q", "y"]
11
11
  LOWERCASE_ASCENDERS = ["b", "d", "f", "h", "k", "l", "t"]
12
12
 
@@ -21,7 +21,7 @@ UPPERCASE_GLYPHS = UPPERCASE_LETTERS
21
21
  ASCENDER_GLYPHS = list(set(LOWERCASE_ASCENDERS) - {"t"})
22
22
 
23
23
 
24
- __all__ = ["recalc_zones"]
24
+ __all__ = ["recalc_zones", "GlyphBounds"]
25
25
 
26
26
 
27
27
  class GlyphBounds(t.TypedDict):
@@ -137,6 +137,29 @@ def fix_lists_overlaps(lists: t.List[t.List[float]]) -> t.List[t.List[float]]:
137
137
  return lists
138
138
 
139
139
 
140
+ def fix_min_separation_limits(lists: t.List[t.List[float]], limit: int) -> t.List[t.List[float]]:
141
+ """
142
+ Fixes the minimum separation between zones.
143
+
144
+ Args:
145
+ lists (List[List[float]]): A list of lists of floats.
146
+ limit (int): The minimum separation between zones.
147
+
148
+ Returns:
149
+ List[List[float]]: The input list with the minimum separation between zones fixed.
150
+ """
151
+ for i in range(len(lists) - 1):
152
+ if lists[i + 1][0] - lists[i][1] < limit:
153
+ # If the difference between the two values is less than 3, then
154
+ # set the second value to the first value
155
+ if lists[i + 1][1] - lists[i][1] > limit:
156
+ lists[i + 1][0] = lists[i + 1][1]
157
+ else:
158
+ # Remove the second list
159
+ lists.pop(i + 1)
160
+ return lists
161
+
162
+
140
163
  def calculate_zone(
141
164
  font: TTFont, glyph_names: t.List[str], min_or_max: t.Literal["yMin", "yMax"]
142
165
  ) -> t.List[float]:
@@ -211,7 +234,13 @@ def recalc_zones(
211
234
  if lists_overlaps(zones):
212
235
  zones = fix_lists_overlaps(zones)
213
236
 
237
+ min_separation = font["CFF "].cff.topDictIndex[0].Private.BlueFuzz * 2 + 1
238
+ zones = fix_min_separation_limits(zones, limit=min_separation)
239
+
214
240
  other_blues = [int(v) for v in zones[0]]
215
- blue_values = [int(v) for v in zones[1] + zones[2] + zones[3] + zones[4]]
241
+
242
+ blue_values = []
243
+ for zone in zones[1:]:
244
+ blue_values.extend([int(v) for v in zone])
216
245
 
217
246
  return other_blues, blue_values
@@ -0,0 +1,3 @@
1
+ VERSION = __version__ = "1.1.6"
2
+
3
+ __all__ = ["VERSION"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foundrytools-cli
3
- Version: 1.1.5
3
+ Version: 1.1.6
4
4
  Summary: A set of command line tools to inspect, manipulate and convert font files
5
5
  Home-page: https://github.com/ftCLI/FoundryTools-CLI
6
6
  Author: ftCLI
@@ -10,11 +10,11 @@ Classifier: Operating System :: OS Independent
10
10
  Requires-Python: >=3.9
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
- Requires-Dist: afdko>=4.0.0
14
- Requires-Dist: fonttools>=4.46.0
13
+ Requires-Dist: afdko>=4.0.1
14
+ Requires-Dist: fonttools>=4.47.2
15
15
  Requires-Dist: brotli>=1.1.0
16
16
  Requires-Dist: click>=8.1.7
17
- Requires-Dist: cffsubr>=0.2.9.post1
17
+ Requires-Dist: cffsubr>=0.3.0
18
18
  Requires-Dist: dehinter>=4.0.0
19
19
  Requires-Dist: loguru>=0.7.2
20
20
  Requires-Dist: pathvalidate>=3.2.0
@@ -1,8 +1,8 @@
1
- afdko>=4.0.0
2
- fonttools>=4.46.0
1
+ afdko>=4.0.1
2
+ fonttools>=4.47.2
3
3
  brotli>=1.1.0
4
4
  click>=8.1.7
5
- cffsubr>=0.2.9.post1
5
+ cffsubr>=0.3.0
6
6
  dehinter>=4.0.0
7
7
  loguru>=0.7.2
8
8
  pathvalidate>=3.2.0
@@ -1,9 +1,9 @@
1
1
  # Hard pinning here gets relaxed to ">=" in setup.py
2
- afdko==4.0.0
3
- fonttools==4.46.0
2
+ afdko==4.0.1
3
+ fonttools==4.47.2
4
4
  brotli==1.1.0
5
5
  click==8.1.7
6
- cffsubr==0.2.9.post1
6
+ cffsubr==0.3.0
7
7
  dehinter==4.0.0
8
8
  loguru==0.7.2
9
9
  pathvalidate==3.2.0
@@ -18,7 +18,7 @@ def _get_requirements():
18
18
 
19
19
  setuptools.setup(
20
20
  name="foundrytools-cli",
21
- version="1.1.5",
21
+ version="1.1.6",
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",
@@ -1,3 +0,0 @@
1
- VERSION = __version__ = "1.1.5"
2
-
3
- __all__ = ["VERSION"]