vfbLib 0.4.2__tar.gz → 0.4.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.

Potentially problematic release.


This version of vfbLib might be problematic. Click here for more details.

Files changed (47) hide show
  1. vfbLib-0.4.3/DESCRIPTION.md +103 -0
  2. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/__init__.py +5 -4
  3. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/groups.py +16 -11
  4. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib.egg-info/PKG-INFO +1 -1
  5. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib.egg-info/SOURCES.txt +1 -0
  6. {vfbLib-0.4.2 → vfbLib-0.4.3}/PKG-INFO +1 -1
  7. {vfbLib-0.4.2 → vfbLib-0.4.3}/setup.cfg +1 -1
  8. {vfbLib-0.4.2 → vfbLib-0.4.3}/LICENSE +0 -0
  9. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/__init__.py +0 -0
  10. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/cmdline.py +0 -0
  11. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/constants.py +0 -0
  12. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/helpers.py +0 -0
  13. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/__init__.py +0 -0
  14. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/bitmap.py +0 -0
  15. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/cmap.py +0 -0
  16. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/glyph.py +0 -0
  17. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/guides.py +0 -0
  18. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/header.py +0 -0
  19. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/mm.py +0 -0
  20. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/numeric.py +0 -0
  21. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/options.py +0 -0
  22. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/ps.py +0 -0
  23. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/text.py +0 -0
  24. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/truetype.py +0 -0
  25. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/parsers/value.py +0 -0
  26. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/truetype.py +0 -0
  27. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/typing.py +0 -0
  28. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/glyph.py +0 -0
  29. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/guides.py +0 -0
  30. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/helpers.py +0 -0
  31. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/info.py +0 -0
  32. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/kerning.py +0 -0
  33. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/paths.py +0 -0
  34. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/pshints.py +0 -0
  35. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/time.py +0 -0
  36. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/tth.py +0 -0
  37. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/typing.py +0 -0
  38. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/ufo/vfb2ufo.py +0 -0
  39. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib/version.py +0 -0
  40. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib.egg-info/dependency_links.txt +0 -0
  41. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib.egg-info/entry_points.txt +0 -0
  42. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib.egg-info/not-zip-safe +0 -0
  43. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib.egg-info/requires.txt +0 -0
  44. {vfbLib-0.4.2 → vfbLib-0.4.3}/Lib/vfbLib.egg-info/top_level.txt +0 -0
  45. {vfbLib-0.4.2 → vfbLib-0.4.3}/README.md +0 -0
  46. {vfbLib-0.4.2 → vfbLib-0.4.3}/pyproject.toml +0 -0
  47. {vfbLib-0.4.2 → vfbLib-0.4.3}/setup.py +0 -0
@@ -0,0 +1,103 @@
1
+ # vfbLib
2
+
3
+ Converter and deserializer for FontLab Studio 5 VFB files.
4
+
5
+ FontLab’s own `vfb2ufo` converter is from 2015, only outputs UFO v2, and
6
+ contains serious bugs that are never going to be fixed. Its support on macOS is
7
+ subject to Apple’s mercy (no native support for Apple Silicon).
8
+
9
+ That’s why a single determined programmer with a hex editor set out to rectify
10
+ this situation.
11
+
12
+
13
+ ## Improvements Over vfb2ufo
14
+
15
+ - Outputs normalized UFO v3
16
+ - Outputs FontLab user data (font and glyph level)
17
+ - Mark colors are written to the official UFO v3 lib key
18
+ - Guideline data is written to the official UFO v3 elements
19
+ - Anchors are preserved in composite glyphs
20
+ - PostScript hinting is written correctly, but to the Adobe lib key
21
+ - Supports more UFO font info attributes:
22
+ - `openTypeGaspRangeRecords`
23
+ - `openTypeHeadLowestRecPPEM`
24
+ - `openTypeNameRecords`
25
+ - `openTypeOS2WeightClass` is written correctly
26
+
27
+
28
+ ## Command Line Script Usage
29
+
30
+ ### vfb3ufo
31
+
32
+ Convert a VFB to one UFO per master. Command line options are compatible to
33
+ FontLab’s `vfb2ufo`, but not all of them are implemented yet.
34
+
35
+ ```bash
36
+ $ vfb3ufo MyFile.vfb
37
+ ```
38
+
39
+ will convert the file to `MyFile.ufo` in the same directory. Existing files will
40
+ not be overwritten unless you specify the `-fo` option.
41
+
42
+ ```
43
+ vfb3ufo -h
44
+ usage: vfb3ufo [-h] [-p PATH] [-fo] [-ttx] [-64] [-s] [-nops] [-z] [-m] inputpath [outputpath]
45
+
46
+ VFB3UFO Converter Copyright (c) 2022 by LucasFonts Build 2022-12-12
47
+
48
+ positional arguments:
49
+ inputpath input file path (.vfb)
50
+ outputpath output file path (.ufo[z])
51
+
52
+ options:
53
+ -h, --help show this help message and exit
54
+ -p PATH, --path PATH output folder
55
+ -fo, --force-overwrite
56
+ force overwrite
57
+ -64, --base64 write GLIF lib 'data' section using base64 (recommended)
58
+ -s, --silent no display (silent mode)
59
+
60
+ Additional options:
61
+
62
+ -m, --minimal parse only minimal amount of data, drop missing glyphs from groups, etc.
63
+ -nops, --no-postscript-hints
64
+ Don't output PostScript hinting
65
+
66
+ Unimplemented options:
67
+
68
+ -ttx, --ttx convert binary OpenType Layout data using TTX-like format
69
+ -z, --zip write UFOZ (compressed UFO)
70
+ ```
71
+
72
+
73
+ ### vfb2json
74
+
75
+ Generate a representation that closely adheres to the VFB structure.
76
+
77
+ ```bash
78
+ $ vfb2json MyFile.vfb
79
+ ```
80
+
81
+ will convert the file to `MyFile.json` in the same directory. Existing files will be overwritten.
82
+
83
+ We expect this to be mostly used for debugging purposes.
84
+
85
+ ```
86
+ vfb2json -h
87
+ usage: vfb2json [-h] [-m] [-p PATH] inputpath
88
+
89
+ VFB2JSON Converter Copyright (c) 2022 by LucasFonts Build 2022-11-08
90
+
91
+ positional arguments:
92
+ inputpath input file path (.vfb)
93
+
94
+ options:
95
+ -h, --help show this help message and exit
96
+ -m, --minimal parse only minimal amount of data
97
+ -p PATH, --path PATH output folder
98
+ ```
99
+
100
+
101
+ ## Copyright
102
+
103
+ © 2022 by [LucasFonts GmbH](https://www.lucasfonts.com/), Berlin
@@ -248,11 +248,12 @@ class VfbToUfoWriter:
248
248
  name = "%s%02i" % (dname, i)
249
249
  i += 1
250
250
  if name in lib:
251
- logger.error(
252
- f"ERROR: Duplicate TrueType stem name '{name}'. "
253
- "Make stem names unique in VFB."
251
+ oldname = name
252
+ name = "%s#%02i" % (oldname, i)
253
+ logger.warning(
254
+ f"Duplicate TrueType stem name '{oldname}', renamed to '{name}'"
255
+ ". Preferably make stem names unique in VFB."
254
256
  )
255
- raise KeyError
256
257
  lib[name] = stem
257
258
  if lib:
258
259
  self.lib[TT_LIB_KEY]["stems"] = lib
@@ -48,17 +48,22 @@ def transform_groups(
48
48
  logger.warning("Not adding empty kerning group to the UFO.")
49
49
  continue
50
50
 
51
- key_glyph = glyphs[0] # Keyglyph is used for group name
52
- if key_glyph in missing:
53
- if num_missing != num_glyphs:
54
- logger.warning(
55
- f"Key glyph '{key_glyph}' for group '{name}' is missing "
56
- "from the font."
57
- )
58
-
59
- # Sort group glyphs by glyphOrder
60
- if not missing:
61
- glyphs.sort(key=lambda n: glyphOrder.index(n))
51
+ if glyphs:
52
+ key_glyph = glyphs[0] # Keyglyph is used for group name
53
+ if key_glyph in missing:
54
+ if num_missing != num_glyphs:
55
+ logger.warning(
56
+ f"Key glyph '{key_glyph}' for group '{name}' is missing "
57
+ "from the font."
58
+ )
59
+
60
+ # Sort group glyphs by glyphOrder
61
+ if not missing:
62
+ glyphs.sort(key=lambda n: glyphOrder.index(n))
63
+ else:
64
+ # The group is empty, use its original name to build the ufo group name
65
+ groups[name] = []
66
+ key_glyph = name
62
67
 
63
68
  if name in kerning_class_flags:
64
69
  flags = kerning_class_flags[name][0]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vfbLib
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: Tools for converting FontLab Studio 5 (VFB) files.
5
5
  Home-page: https://pypi.org/project/vfblib/
6
6
  Author: Jens Kutilek
@@ -1,3 +1,4 @@
1
+ DESCRIPTION.md
1
2
  LICENSE
2
3
  README.md
3
4
  pyproject.toml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vfbLib
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: Tools for converting FontLab Studio 5 (VFB) files.
5
5
  Home-page: https://pypi.org/project/vfblib/
6
6
  Author: Jens Kutilek
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = vfbLib
3
- version = 0.4.2
3
+ version = 0.4.3
4
4
  description = Tools for converting FontLab Studio 5 (VFB) files.
5
5
  long_description = file: DESCRIPTION.md
6
6
  long_description_content_type = text/markdown; charset=UTF-8
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
File without changes
File without changes
File without changes
File without changes