python-fontbro 0.31.0__py3-none-any.whl → 0.32.0__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.
- fontbro/embedding_permissions.py +3 -4
- fontbro/exceptions.py +39 -0
- fontbro/family_classification.py +3 -4
- fontbro/font.py +12 -11
- fontbro/metadata.py +1 -1
- fontbro/monospace.py +3 -1
- fontbro/names.py +6 -3
- fontbro/pixel.py +2 -1
- fontbro/render.py +3 -2
- fontbro/tables.py +15 -0
- fontbro/variable.py +5 -4
- {python_fontbro-0.31.0.dist-info → python_fontbro-0.32.0.dist-info}/METADATA +10 -10
- {python_fontbro-0.31.0.dist-info → python_fontbro-0.32.0.dist-info}/RECORD +16 -16
- {python_fontbro-0.31.0.dist-info → python_fontbro-0.32.0.dist-info}/WHEEL +0 -0
- {python_fontbro-0.31.0.dist-info → python_fontbro-0.32.0.dist-info}/licenses/LICENSE.txt +0 -0
- {python_fontbro-0.31.0.dist-info → python_fontbro-0.32.0.dist-info}/top_level.txt +0 -0
fontbro/embedding_permissions.py
CHANGED
|
@@ -2,8 +2,9 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from fontTools.ttLib import TTFont
|
|
4
4
|
|
|
5
|
-
from fontbro.exceptions import ArgumentError
|
|
5
|
+
from fontbro.exceptions import ArgumentError
|
|
6
6
|
from fontbro.flags import get_flag, set_flag
|
|
7
|
+
from fontbro.tables import get_table_or_raise
|
|
7
8
|
|
|
8
9
|
# Embedding Permissions:
|
|
9
10
|
# https://learn.microsoft.com/en-us/typography/opentype/spec/os2#fstype
|
|
@@ -95,9 +96,7 @@ def set_embedding_permissions(
|
|
|
95
96
|
Sets the embedding permissions in the OS/2 fsType field of the given font,
|
|
96
97
|
the fsType field is left untouched if any argument is invalid.
|
|
97
98
|
"""
|
|
98
|
-
os2 = ttfont
|
|
99
|
-
if not os2:
|
|
100
|
-
raise OperationError("Invalid OS/2 table (doesn't exist).")
|
|
99
|
+
os2 = get_table_or_raise(ttfont, "OS/2")
|
|
101
100
|
|
|
102
101
|
usage_permissions = {
|
|
103
102
|
"installable": installable,
|
fontbro/exceptions.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
class ArgumentError(ValueError):
|
|
2
5
|
pass
|
|
3
6
|
|
|
@@ -10,5 +13,41 @@ class OperationError(TypeError):
|
|
|
10
13
|
pass
|
|
11
14
|
|
|
12
15
|
|
|
16
|
+
class ClosedFontError(OperationError):
|
|
17
|
+
"""
|
|
18
|
+
The operation was called on a closed font.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class MissingTableError(OperationError, KeyError):
|
|
23
|
+
"""
|
|
24
|
+
The operation requires a table the font doesn't have.
|
|
25
|
+
It's also a KeyError, raised before when accessing the missing table.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def __init__(
|
|
29
|
+
self,
|
|
30
|
+
table_tag: str,
|
|
31
|
+
message: str | None = None,
|
|
32
|
+
) -> None:
|
|
33
|
+
self.table_tag = table_tag
|
|
34
|
+
super().__init__(message or f"Invalid {table_tag} table (doesn't exist).")
|
|
35
|
+
|
|
36
|
+
def __reduce__(self) -> tuple[type[MissingTableError], tuple[str, str]]:
|
|
37
|
+
# pickle and copy recreate the exception passing its args (the message
|
|
38
|
+
# only) to __init__, the table tag must be passed too
|
|
39
|
+
return (self.__class__, (self.table_tag, str(self)))
|
|
40
|
+
|
|
41
|
+
def __str__(self) -> str:
|
|
42
|
+
# KeyError wraps the message in quotes
|
|
43
|
+
return str(self.args[0])
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class VariableFontRequiredError(OperationError):
|
|
47
|
+
"""
|
|
48
|
+
The operation requires a variable font.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
|
|
13
52
|
class SanitizationError(Exception):
|
|
14
53
|
pass
|
fontbro/family_classification.py
CHANGED
|
@@ -4,7 +4,8 @@ from typing import Any
|
|
|
4
4
|
|
|
5
5
|
from fontTools.ttLib import TTFont
|
|
6
6
|
|
|
7
|
-
from fontbro.exceptions import ArgumentError
|
|
7
|
+
from fontbro.exceptions import ArgumentError
|
|
8
|
+
from fontbro.tables import get_table_or_raise
|
|
8
9
|
from fontbro.utils import concat_names, find_item, read_json
|
|
9
10
|
|
|
10
11
|
# Family Classification:
|
|
@@ -152,9 +153,7 @@ def set_family_classification(
|
|
|
152
153
|
"""
|
|
153
154
|
Sets the family classification of the given font in the OS/2.sFamilyClass field.
|
|
154
155
|
"""
|
|
155
|
-
os2 = ttfont
|
|
156
|
-
if not os2:
|
|
157
|
-
raise OperationError("Invalid OS/2 table (doesn't exist).")
|
|
156
|
+
os2 = get_table_or_raise(ttfont, "OS/2")
|
|
158
157
|
|
|
159
158
|
# validate class key and subclass key
|
|
160
159
|
class_item, subclass_item = _get_family_classification_items(
|
fontbro/font.py
CHANGED
|
@@ -32,7 +32,8 @@ from fontbro import variable as _variable
|
|
|
32
32
|
from fontbro import version as _version
|
|
33
33
|
from fontbro.exceptions import (
|
|
34
34
|
ArgumentError,
|
|
35
|
-
|
|
35
|
+
ClosedFontError,
|
|
36
|
+
VariableFontRequiredError,
|
|
36
37
|
)
|
|
37
38
|
|
|
38
39
|
|
|
@@ -325,7 +326,7 @@ class Font:
|
|
|
325
326
|
) -> None:
|
|
326
327
|
"""
|
|
327
328
|
Close the wrapped TTFont instance.
|
|
328
|
-
After closing, any operation on the font raises
|
|
329
|
+
After closing, any operation on the font raises ClosedFontError,
|
|
329
330
|
closing an already closed font does nothing.
|
|
330
331
|
"""
|
|
331
332
|
# TTFont.close() is idempotent (it closes the reader and sets it to None)
|
|
@@ -847,13 +848,13 @@ class Font:
|
|
|
847
848
|
:returns: The TTFont instance.
|
|
848
849
|
:rtype: TTFont
|
|
849
850
|
|
|
850
|
-
:raises
|
|
851
|
+
:raises ClosedFontError: If the font has been closed.
|
|
851
852
|
"""
|
|
852
853
|
# all the font operations get the TTFont instance through this method,
|
|
853
854
|
# the TTFont can also be closed directly (bypassing this instance):
|
|
854
855
|
# when closed, fontTools sets its reader to None
|
|
855
856
|
if self._ttfont is None or self._ttfont.reader is None:
|
|
856
|
-
raise
|
|
857
|
+
raise ClosedFontError("Invalid operation, the font is closed.")
|
|
857
858
|
return self._ttfont
|
|
858
859
|
|
|
859
860
|
def get_unicode_block_by_name(
|
|
@@ -1277,7 +1278,7 @@ class Font:
|
|
|
1277
1278
|
(only if the default instance style name is renamed)
|
|
1278
1279
|
:type update_style_flags: bool
|
|
1279
1280
|
|
|
1280
|
-
:raises
|
|
1281
|
+
:raises VariableFontRequiredError: if the font is not a variable font.
|
|
1281
1282
|
:return: None
|
|
1282
1283
|
"""
|
|
1283
1284
|
ttfont = self.get_ttfont()
|
|
@@ -1512,10 +1513,10 @@ class Font:
|
|
|
1512
1513
|
includes 'instance' (containing instance metadata) and 'files' (a dictionary
|
|
1513
1514
|
with file formats as keys and file-paths as values).
|
|
1514
1515
|
|
|
1515
|
-
:raises
|
|
1516
|
+
:raises VariableFontRequiredError: If the font is not a variable font.
|
|
1516
1517
|
"""
|
|
1517
1518
|
if not self.is_variable():
|
|
1518
|
-
raise
|
|
1519
|
+
raise VariableFontRequiredError("Only a variable font can be instantiated.")
|
|
1519
1520
|
|
|
1520
1521
|
fsutil.assert_not_file(dirpath)
|
|
1521
1522
|
fsutil.make_dirs(dirpath)
|
|
@@ -1570,7 +1571,7 @@ class Font:
|
|
|
1570
1571
|
|
|
1571
1572
|
:param class_id: Numeric identifier of the font family class.
|
|
1572
1573
|
:param subclass_id: Optional numeric identifier of the font family subclass (default is 0).
|
|
1573
|
-
:raises
|
|
1574
|
+
:raises MissingTableError: If the OS/2 table is not available in the font.
|
|
1574
1575
|
:raises ArgumentError: If class_id is invalid or subclass_id is specified but invalid.
|
|
1575
1576
|
"""
|
|
1576
1577
|
ttfont = self.get_ttfont()
|
|
@@ -1723,7 +1724,7 @@ class Font:
|
|
|
1723
1724
|
:raises ArgumentError: If a value is not a bool or None, if more than one
|
|
1724
1725
|
of the mutually exclusive usage permissions is set to True, or if
|
|
1725
1726
|
installable is set to False while no other usage permission is in effect.
|
|
1726
|
-
:raises
|
|
1727
|
+
:raises MissingTableError: If the OS/2 table is not available in the font.
|
|
1727
1728
|
"""
|
|
1728
1729
|
ttfont = self.get_ttfont()
|
|
1729
1730
|
_embedding_permissions.set_embedding_permissions(
|
|
@@ -1860,7 +1861,7 @@ class Font:
|
|
|
1860
1861
|
:param options: The options for the fontTools.varLib.instancer
|
|
1861
1862
|
:type options: dictionary
|
|
1862
1863
|
|
|
1863
|
-
:raises
|
|
1864
|
+
:raises VariableFontRequiredError: If the font is not a variable font
|
|
1864
1865
|
:raises ValueError: If the coordinates are not defined (blank)
|
|
1865
1866
|
:raises ValueError: If the coordinates axes are all pinned
|
|
1866
1867
|
"""
|
|
@@ -1900,7 +1901,7 @@ class Font:
|
|
|
1900
1901
|
:param options: The options for the fontTools.varLib.instancer
|
|
1901
1902
|
:type options: dictionary
|
|
1902
1903
|
|
|
1903
|
-
:raises
|
|
1904
|
+
:raises VariableFontRequiredError: If the font is not a variable font
|
|
1904
1905
|
:raises ValueError: If the coordinates axes are not all pinned
|
|
1905
1906
|
"""
|
|
1906
1907
|
ttfont = self.get_ttfont()
|
fontbro/metadata.py
CHANGED
fontbro/monospace.py
CHANGED
|
@@ -6,6 +6,7 @@ from collections import Counter
|
|
|
6
6
|
from fontTools import unicodedata
|
|
7
7
|
from fontTools.ttLib import TTFont
|
|
8
8
|
|
|
9
|
+
from fontbro.tables import get_table_or_raise
|
|
9
10
|
from fontbro.unicode import get_best_cmap
|
|
10
11
|
|
|
11
12
|
# same criteria used by Fontbakery (glyph_metrics_stats condition):
|
|
@@ -36,9 +37,10 @@ def _get_widths(
|
|
|
36
37
|
"""
|
|
37
38
|
Gets the advance widths of the given glyphs, zero widths are ignored.
|
|
38
39
|
"""
|
|
40
|
+
hmtx = get_table_or_raise(ttfont, "hmtx")
|
|
39
41
|
return [
|
|
40
42
|
advance
|
|
41
|
-
for glyph_name, (advance, _) in
|
|
43
|
+
for glyph_name, (advance, _) in hmtx.metrics.items()
|
|
42
44
|
if glyph_name in glyphs_names and advance != 0
|
|
43
45
|
]
|
|
44
46
|
|
fontbro/names.py
CHANGED
|
@@ -6,7 +6,8 @@ from typing import Any
|
|
|
6
6
|
from fontTools.misc.encodingTools import getEncoding
|
|
7
7
|
from fontTools.ttLib import TTFont
|
|
8
8
|
|
|
9
|
-
from fontbro.exceptions import ArgumentError,
|
|
9
|
+
from fontbro.exceptions import ArgumentError, VariableFontRequiredError
|
|
10
|
+
from fontbro.tables import get_table_or_raise
|
|
10
11
|
from fontbro.utils import concat_names, remove_spaces
|
|
11
12
|
|
|
12
13
|
# Names:
|
|
@@ -193,7 +194,7 @@ def set_name(
|
|
|
193
194
|
and unicode flags.
|
|
194
195
|
"""
|
|
195
196
|
name_id = _get_name_id(key)
|
|
196
|
-
name_table = ttfont
|
|
197
|
+
name_table = get_table_or_raise(ttfont, "name")
|
|
197
198
|
if windows:
|
|
198
199
|
# https://github.com/fonttools/fonttools/blob/main/Lib/fontTools/ttLib/tables/_n_a_m_e.py#L568
|
|
199
200
|
# the windows record is always written, it's the one read first by get_name
|
|
@@ -313,7 +314,9 @@ def rename_variable_instances(
|
|
|
313
314
|
so renaming it renames the font style too.
|
|
314
315
|
"""
|
|
315
316
|
if "fvar" not in ttfont:
|
|
316
|
-
raise
|
|
317
|
+
raise VariableFontRequiredError(
|
|
318
|
+
"Only the instances of a variable font can be renamed."
|
|
319
|
+
)
|
|
317
320
|
# style names are matched case-insensitively
|
|
318
321
|
style_names = {key.lower(): value for key, value in (style_names or {}).items()}
|
|
319
322
|
default_style_name = _get_default_instance_style_name(ttfont).lower()
|
fontbro/pixel.py
CHANGED
|
@@ -9,6 +9,7 @@ from fontTools import unicodedata
|
|
|
9
9
|
from fontTools.pens.recordingPen import DecomposingRecordingPen
|
|
10
10
|
from fontTools.ttLib import TTFont
|
|
11
11
|
|
|
12
|
+
from fontbro.tables import get_table_or_raise
|
|
12
13
|
from fontbro.unicode import get_best_cmap
|
|
13
14
|
|
|
14
15
|
Segment = tuple[float, float]
|
|
@@ -219,7 +220,7 @@ def is_pixel(
|
|
|
219
220
|
|
|
220
221
|
# 2nd check: segments aligned to a plausible pixel grid,
|
|
221
222
|
# it excludes squared ("techno") fonts
|
|
222
|
-
units_per_em = ttfont
|
|
223
|
+
units_per_em = get_table_or_raise(ttfont, "head").unitsPerEm
|
|
223
224
|
pixel_width, pixel_height = (
|
|
224
225
|
_get_pixel_dimension(
|
|
225
226
|
orthogonal_glyphs_segments, axis, units_per_em, min_glyphs_count
|
fontbro/render.py
CHANGED
|
@@ -9,6 +9,7 @@ from fontTools.pens.svgPathPen import SVGPathPen
|
|
|
9
9
|
from fontTools.ttLib import TTFont
|
|
10
10
|
from PIL import Image, ImageDraw, ImageFont
|
|
11
11
|
|
|
12
|
+
from fontbro.tables import get_table_or_raise
|
|
12
13
|
from fontbro.unicode import get_best_cmap_or_raise
|
|
13
14
|
|
|
14
15
|
|
|
@@ -51,9 +52,9 @@ def get_svg(
|
|
|
51
52
|
Gets an SVG representation of the given font rendering some text.
|
|
52
53
|
"""
|
|
53
54
|
# get font metrics
|
|
54
|
-
units_per_em = ttfont
|
|
55
|
+
units_per_em = get_table_or_raise(ttfont, "head").unitsPerEm
|
|
55
56
|
scale = size / units_per_em
|
|
56
|
-
hhea = ttfont
|
|
57
|
+
hhea = get_table_or_raise(ttfont, "hhea")
|
|
57
58
|
ascent = hhea.ascent * scale
|
|
58
59
|
descent = hhea.descent * scale
|
|
59
60
|
width = 0
|
fontbro/tables.py
CHANGED
|
@@ -4,6 +4,8 @@ from typing import Any
|
|
|
4
4
|
|
|
5
5
|
from fontTools.ttLib import TTFont
|
|
6
6
|
|
|
7
|
+
from fontbro.exceptions import MissingTableError
|
|
8
|
+
|
|
7
9
|
# https://learn.microsoft.com/en-us/typography/opentype/spec/otff#font-tables
|
|
8
10
|
_TABLE_NAMES_BY_TAG: dict[str, str] = {
|
|
9
11
|
# required tables
|
|
@@ -95,6 +97,19 @@ _TABLE_NAMES_BY_TAG: dict[str, str] = {
|
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
|
|
100
|
+
def get_table_or_raise(
|
|
101
|
+
ttfont: TTFont,
|
|
102
|
+
tag: str,
|
|
103
|
+
) -> Any:
|
|
104
|
+
"""
|
|
105
|
+
Gets the table with the given tag of the given font,
|
|
106
|
+
MissingTableError is raised if the font has no table with the given tag.
|
|
107
|
+
"""
|
|
108
|
+
if tag not in ttfont:
|
|
109
|
+
raise MissingTableError(tag)
|
|
110
|
+
return ttfont[tag]
|
|
111
|
+
|
|
112
|
+
|
|
98
113
|
def get_tables_tags(
|
|
99
114
|
ttfont: TTFont,
|
|
100
115
|
*,
|
fontbro/variable.py
CHANGED
|
@@ -9,8 +9,9 @@ from fontTools.varLib.instancer import OverlapMode
|
|
|
9
9
|
|
|
10
10
|
from fontbro import names as _names
|
|
11
11
|
from fontbro import style_flags as _style_flags
|
|
12
|
-
from fontbro.exceptions import ArgumentError,
|
|
12
|
+
from fontbro.exceptions import ArgumentError, VariableFontRequiredError
|
|
13
13
|
from fontbro.math import get_euclidean_distance
|
|
14
|
+
from fontbro.tables import get_table_or_raise
|
|
14
15
|
from fontbro.utils import slugify
|
|
15
16
|
|
|
16
17
|
# Variable Axes:
|
|
@@ -159,7 +160,7 @@ def get_variable_instances(
|
|
|
159
160
|
"""
|
|
160
161
|
if not is_variable(ttfont):
|
|
161
162
|
return None
|
|
162
|
-
name_table = ttfont
|
|
163
|
+
name_table = get_table_or_raise(ttfont, "name")
|
|
163
164
|
return [
|
|
164
165
|
{
|
|
165
166
|
"coordinates": instance.coordinates,
|
|
@@ -320,7 +321,7 @@ def to_sliced_variable(
|
|
|
320
321
|
the variable axes at the given coordinates.
|
|
321
322
|
"""
|
|
322
323
|
if not is_variable(ttfont):
|
|
323
|
-
raise
|
|
324
|
+
raise VariableFontRequiredError("Only a variable font can be sliced.")
|
|
324
325
|
|
|
325
326
|
coordinates = get_sliced_coordinates(ttfont, coordinates)
|
|
326
327
|
|
|
@@ -364,7 +365,7 @@ def to_static(
|
|
|
364
365
|
the variable axes at the given coordinates.
|
|
365
366
|
"""
|
|
366
367
|
if not is_variable(ttfont):
|
|
367
|
-
raise
|
|
368
|
+
raise VariableFontRequiredError("Only a variable font can be made static.")
|
|
368
369
|
|
|
369
370
|
coordinates = get_static_coordinates(
|
|
370
371
|
ttfont,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-fontbro
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.32.0
|
|
4
4
|
Summary: friendly font operations on top of fontTools.
|
|
5
5
|
Author-email: Fabio Caccamo <fabio.caccamo@gmail.com>
|
|
6
6
|
Maintainer-email: Fabio Caccamo <fabio.caccamo@gmail.com>
|
|
@@ -43,7 +43,6 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
43
43
|
Classifier: Natural Language :: English
|
|
44
44
|
Classifier: Operating System :: OS Independent
|
|
45
45
|
Classifier: Programming Language :: Python :: 3
|
|
46
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
47
46
|
Classifier: Programming Language :: Python :: 3.11
|
|
48
47
|
Classifier: Programming Language :: Python :: 3.12
|
|
49
48
|
Classifier: Programming Language :: Python :: 3.13
|
|
@@ -52,6 +51,7 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
|
52
51
|
Classifier: Topic :: Text Processing :: Fonts
|
|
53
52
|
Classifier: Topic :: Multimedia :: Graphics
|
|
54
53
|
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
|
|
54
|
+
Requires-Python: >=3.11
|
|
55
55
|
Description-Content-Type: text/markdown
|
|
56
56
|
License-File: LICENSE.txt
|
|
57
57
|
Requires-Dist: fonttools[lxml,pathops,unicode,woff]<5.0,>=4.43.0
|
|
@@ -184,7 +184,7 @@ font_clone = font.clone()
|
|
|
184
184
|
```python
|
|
185
185
|
"""
|
|
186
186
|
Close the wrapped TTFont instance.
|
|
187
|
-
After closing, any operation on the font raises
|
|
187
|
+
After closing, any operation on the font raises ClosedFontError,
|
|
188
188
|
closing an already closed font does nothing.
|
|
189
189
|
"""
|
|
190
190
|
|
|
@@ -631,7 +631,7 @@ Gets the wrapped TTFont instance.
|
|
|
631
631
|
:returns: The TTFont instance.
|
|
632
632
|
:rtype: TTFont
|
|
633
633
|
|
|
634
|
-
:raises
|
|
634
|
+
:raises ClosedFontError: If the font has been closed.
|
|
635
635
|
"""
|
|
636
636
|
|
|
637
637
|
ttfont = font.get_ttfont()
|
|
@@ -1011,7 +1011,7 @@ If family_name is not defined it will be auto-detected.
|
|
|
1011
1011
|
(only if the default instance style name is renamed)
|
|
1012
1012
|
:type update_style_flags: bool
|
|
1013
1013
|
|
|
1014
|
-
:raises
|
|
1014
|
+
:raises VariableFontRequiredError: if the font is not a variable font.
|
|
1015
1015
|
"""
|
|
1016
1016
|
|
|
1017
1017
|
font.rename_variable_instances(
|
|
@@ -1131,7 +1131,7 @@ Save all instances of a variable font to specified directory in one or more form
|
|
|
1131
1131
|
includes 'instance' (containing instance metadata) and 'files' (a dictionary
|
|
1132
1132
|
with file formats as keys and file-paths as values).
|
|
1133
1133
|
|
|
1134
|
-
:raises
|
|
1134
|
+
:raises VariableFontRequiredError: If the font is not a variable font.
|
|
1135
1135
|
"""
|
|
1136
1136
|
|
|
1137
1137
|
saved_fonts = font.save_variable_instances(
|
|
@@ -1167,7 +1167,7 @@ The fsType field is left untouched if any argument is invalid.
|
|
|
1167
1167
|
:raises ArgumentError: If a value is not a bool or None, if more than one
|
|
1168
1168
|
of the mutually exclusive usage permissions is set to True, or if
|
|
1169
1169
|
installable is set to False while no other usage permission is in effect.
|
|
1170
|
-
:raises
|
|
1170
|
+
:raises MissingTableError: If the OS/2 table is not available in the font.
|
|
1171
1171
|
"""
|
|
1172
1172
|
|
|
1173
1173
|
font.set_embedding_permissions(
|
|
@@ -1187,7 +1187,7 @@ based on provided class_id and subclass_id.
|
|
|
1187
1187
|
|
|
1188
1188
|
:param class_id: Numeric identifier of the font family class.
|
|
1189
1189
|
:param subclass_id: Optional numeric identifier of the font family subclass (default is 0).
|
|
1190
|
-
:raises
|
|
1190
|
+
:raises MissingTableError: If the OS/2 table is not available in the font.
|
|
1191
1191
|
:raises ArgumentError: If class_id is invalid or subclass_id is specified but invalid.
|
|
1192
1192
|
"""
|
|
1193
1193
|
|
|
@@ -1405,7 +1405,7 @@ If an axis min and max values are equal, the axis will be pinned.
|
|
|
1405
1405
|
:param options: The options for the fontTools.varLib.instancer
|
|
1406
1406
|
:type options: dictionary
|
|
1407
1407
|
|
|
1408
|
-
:raises
|
|
1408
|
+
:raises VariableFontRequiredError: If the font is not a variable font
|
|
1409
1409
|
:raises ValueError: If the coordinates are not defined (empty)
|
|
1410
1410
|
:raises ValueError: If the coordinates axes are all pinned
|
|
1411
1411
|
"""
|
|
@@ -1438,7 +1438,7 @@ If coordinates are not specified each axis will be pinned at its default value.
|
|
|
1438
1438
|
:param options: The options for the fontTools.varLib.instancer
|
|
1439
1439
|
:type options: dictionary
|
|
1440
1440
|
|
|
1441
|
-
:raises
|
|
1441
|
+
:raises VariableFontRequiredError: If the font is not a variable font
|
|
1442
1442
|
:raises ValueError: If the coordinates axes are not all pinned
|
|
1443
1443
|
"""
|
|
1444
1444
|
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
fontbro/__init__.py,sha256=Jk5jOWcH6_nDZAz4VDK8flZTxI6dZVjkB7STfOtWwq4,344
|
|
2
2
|
fontbro/bitmap.py,sha256=VOzJ7_z3VDY967EtRS08EMoNfkLGPJ-gU-YOWATOYco,1480
|
|
3
3
|
fontbro/color.py,sha256=l8Cn7DckiSwJcDfQsHTvA9r9l1ze8Gi8Ps85CSbiMds,358
|
|
4
|
-
fontbro/embedding_permissions.py,sha256=
|
|
5
|
-
fontbro/exceptions.py,sha256=
|
|
6
|
-
fontbro/family_classification.py,sha256=
|
|
4
|
+
fontbro/embedding_permissions.py,sha256=onB4N_ug5yOKbkEIlk9Utl2ZnqP_kHVxZsjTWmpflQA,4282
|
|
5
|
+
fontbro/exceptions.py,sha256=Nw-VBSOMgZ_a9l9sxHF3q2xYUpXoUXeHj1CyQivjGJ0,1243
|
|
6
|
+
fontbro/family_classification.py,sha256=R9IoVEEUMOSpS80p_2fF6QC1E-PaIhI04P3AXsnJ9BY,10352
|
|
7
7
|
fontbro/features.py,sha256=KNcaP-bfQ1kn_2tGWOofooxwtmU_aM0jk6hmw8y8ebw,4076
|
|
8
8
|
fontbro/files.py,sha256=RS5f_XX3Fn8iXqbWMlFNtL8kAiXq-h7ZKWvM915qNjY,3355
|
|
9
9
|
fontbro/fingerprint.py,sha256=feDMpc0JAZqcOZ0ntH3lglbp-awg0nltpXOxcpbuZlg,1508
|
|
10
10
|
fontbro/flags.py,sha256=NIdKvelHytLpcbwzx-3s4aeNQKefU-7hlDV5XbBj3Oo,683
|
|
11
|
-
fontbro/font.py,sha256=
|
|
11
|
+
fontbro/font.py,sha256=iCQH-5xNqO4IWz2xUkx9jA_iKrWwrg0ERadbcMNXCLQ,73994
|
|
12
12
|
fontbro/glyphs.py,sha256=E4xyKLx8w1BeIPelMXOOqYt6-Z7ebu0foEIKo3FYEIg,1947
|
|
13
13
|
fontbro/math.py,sha256=DZOiXmGu2g_1lBiEaSifWCWf1VeSYv9ijuWDZYy6xUQ,349
|
|
14
|
-
fontbro/metadata.py,sha256=
|
|
14
|
+
fontbro/metadata.py,sha256=gBl5L9ynAMTLT-77xQ9MFJ41Rf1qh5IyC85_Y4-tXFA,264
|
|
15
15
|
fontbro/metrics.py,sha256=JUt-u65dDMXHekYKGxo_254Xk4W87UjEDLZFwuzkh8M,6401
|
|
16
|
-
fontbro/monospace.py,sha256=
|
|
17
|
-
fontbro/names.py,sha256=
|
|
18
|
-
fontbro/pixel.py,sha256=
|
|
16
|
+
fontbro/monospace.py,sha256=hjmjOGBwTt_qMDVNc0hlareMD2v6gi8oZ_aYhB_hcus,2988
|
|
17
|
+
fontbro/names.py,sha256=NPtN1Ycd9ZqhBBJUqhTsZr-laTx2PIrihwmcluQb4mc,21949
|
|
18
|
+
fontbro/pixel.py,sha256=8wa0vJ5CAhPHPSjIfBaaIIhJJClu25tbL71PZr5WcVE,7834
|
|
19
19
|
fontbro/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
fontbro/render.py,sha256=
|
|
20
|
+
fontbro/render.py,sha256=iVUzD0bFIVcKbYMX0BdcWrWv2BYTWZ16_8EC0YJH19Q,2762
|
|
21
21
|
fontbro/sanitize.py,sha256=nt1Ki1rWnnXEt5t4W4EbLRHl8K_HD57agYNtW_pEiVI,1265
|
|
22
22
|
fontbro/style_flags.py,sha256=2FD--5t6hkA-htP2Wuwi8fMe9NuQ23XWUKaCmOStFlY,4712
|
|
23
23
|
fontbro/subset.py,sha256=TJPaUri8Hax9orZXBv-zFjPQsKyLEUzGj0oDWUDcjv8,2476
|
|
24
24
|
fontbro/support.py,sha256=-hHc7C_AxRl7eK0sSwkkSv4eOqHJtFNNZRpVp8c1KPQ,9905
|
|
25
|
-
fontbro/tables.py,sha256
|
|
25
|
+
fontbro/tables.py,sha256=-SoAJl2yAabHj1ko8l26GuUYDgkKYuMz6L40Qsx6CwE,4619
|
|
26
26
|
fontbro/unicode.py,sha256=kmDUCfxeMD-B6TQZa6EnXkdFTLpD9qnZ9YzLldRM6jc,6432
|
|
27
27
|
fontbro/utils.py,sha256=iodvxg9rzSKGuLdOacPxH5G9LZw1qGMUaYH4eZbnkik,996
|
|
28
|
-
fontbro/variable.py,sha256=
|
|
28
|
+
fontbro/variable.py,sha256=llOw5T91FYiGCzSVvXag-d9R8T4v1bsfzAV0F1ks2ZM,14065
|
|
29
29
|
fontbro/version.py,sha256=3_m26Gpu6wfSE7WNnTEXENiP2hsYrBZjM_DS1awDqjU,9336
|
|
30
30
|
fontbro/data/family-classifications.json,sha256=2aj7AXVqwqQDSvGUOLIso3GrxH3motsa6a1SPxU4hZ4,24173
|
|
31
31
|
fontbro/data/features.json,sha256=QS539T_e0U8M-_m125ZvgNDpN_geKjAM1raDi90vqIM,30367
|
|
32
32
|
fontbro/data/unicode-blocks.json,sha256=F2qA46RN3X-__n9T8_VVdKr77Tj9iy2N4tUnnQOBmPI,28353
|
|
33
33
|
fontbro/data/unicode-scripts.json,sha256=XDiyXLN2TB6Oo8AjVODuV72Y1_kkCwL6-GrosdeprsU,17069
|
|
34
|
-
python_fontbro-0.
|
|
35
|
-
python_fontbro-0.
|
|
36
|
-
python_fontbro-0.
|
|
37
|
-
python_fontbro-0.
|
|
38
|
-
python_fontbro-0.
|
|
34
|
+
python_fontbro-0.32.0.dist-info/licenses/LICENSE.txt,sha256=NOGOw1tmp315ex224Or-4PWS9W5jbVWxcqbf2KW-EK8,1078
|
|
35
|
+
python_fontbro-0.32.0.dist-info/METADATA,sha256=zV6nZwGAbQD8Q6ZiLX9LRE-qs-vwbKfuPt18jbCXAss,43403
|
|
36
|
+
python_fontbro-0.32.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
37
|
+
python_fontbro-0.32.0.dist-info/top_level.txt,sha256=RPG3vBzvn6LKU2E_FNPBPuKlygx9aodErAYJNeyV3Jc,8
|
|
38
|
+
python_fontbro-0.32.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|