python-fontbro 0.20.0__tar.gz → 0.22.0__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.
- {python-fontbro-0.20.0/python_fontbro.egg-info → python_fontbro-0.22.0}/PKG-INFO +14 -2
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/README.md +13 -1
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/fontbro/flags.py +12 -2
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/fontbro/font.py +516 -238
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/fontbro/math.py +6 -1
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/fontbro/metadata.py +1 -1
- python_fontbro-0.22.0/fontbro/py.typed +0 -0
- python_fontbro-0.22.0/fontbro/subset.py +29 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/fontbro/utils.py +17 -4
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/pyproject.toml +12 -2
- {python-fontbro-0.20.0 → python_fontbro-0.22.0/python_fontbro.egg-info}/PKG-INFO +14 -2
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/python_fontbro.egg-info/SOURCES.txt +2 -0
- python_fontbro-0.22.0/tests/test_monospace.py +17 -0
- python-fontbro-0.20.0/fontbro/subset.py +0 -22
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/LICENSE.txt +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/MANIFEST.in +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/fontbro/__init__.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/fontbro/data/features.json +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/fontbro/data/unicode-blocks.json +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/fontbro/data/unicode-scripts.json +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/fontbro/exceptions.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/python_fontbro.egg-info/dependency_links.txt +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/python_fontbro.egg-info/requires.txt +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/python_fontbro.egg-info/top_level.txt +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/setup.cfg +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/setup.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_characters.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_clone.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_close.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_collection.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_context_manager.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_family_name.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_features.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_filename.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_fingerprint.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_format.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_glyphs.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_image.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_init.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_instantiation.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_issues.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_italic_angle.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_names.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_rename.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_sanitize.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_save.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_str.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_style_flags.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_style_name.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_subset.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_unicode_blocks_and_scripts.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_update_unicode_data.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_variable.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_version.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_vertical_metrics.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_weight.py +0 -0
- {python-fontbro-0.20.0 → python_fontbro-0.22.0}/tests/test_width.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-fontbro
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.22.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>
|
|
@@ -132,6 +132,7 @@ with open("fonts/MyFont.ttf") as fh:
|
|
|
132
132
|
- [`get_vertical_metrics`](#get_vertical_metrics)
|
|
133
133
|
- [`get_weight`](#get_weight)
|
|
134
134
|
- [`get_width`](#get_width)
|
|
135
|
+
- [`is_monospace`](#is_monospace)
|
|
135
136
|
- [`is_static`](#is_static)
|
|
136
137
|
- [`is_variable`](#is_variable)
|
|
137
138
|
- [`rename`](#rename)
|
|
@@ -619,6 +620,17 @@ Gets the font width value and name.
|
|
|
619
620
|
width = font.get_width()
|
|
620
621
|
```
|
|
621
622
|
|
|
623
|
+
#### `is_monospace`
|
|
624
|
+
```python
|
|
625
|
+
"""
|
|
626
|
+
Determines if the font is a monospace font.
|
|
627
|
+
|
|
628
|
+
:returns: True if monospace font, False otherwise.
|
|
629
|
+
:rtype: bool
|
|
630
|
+
"""
|
|
631
|
+
mono = font.is_monospace()
|
|
632
|
+
```
|
|
633
|
+
|
|
622
634
|
#### `is_static`
|
|
623
635
|
```python
|
|
624
636
|
"""
|
|
@@ -873,7 +885,7 @@ Sets the vertical metrics.
|
|
|
873
885
|
"typo_ascender", "typo_descender", "typo_line_gap", "cap_height", "x_height",
|
|
874
886
|
"win_ascent", "win_descent"
|
|
875
887
|
"""
|
|
876
|
-
font.set_vertical_metrics(ascent=
|
|
888
|
+
font.set_vertical_metrics(units_per_em=2000, y_max=2102, y_min=-533, ascent=1800, descent=-400, line_gap=0, typo_ascender=1800, typo_descender=-400, typo_line_gap=0, cap_height=1400, x_height=1080, win_ascent=2160, win_descent=540)
|
|
877
889
|
```
|
|
878
890
|
|
|
879
891
|
#### `subset`
|
|
@@ -70,6 +70,7 @@ with open("fonts/MyFont.ttf") as fh:
|
|
|
70
70
|
- [`get_vertical_metrics`](#get_vertical_metrics)
|
|
71
71
|
- [`get_weight`](#get_weight)
|
|
72
72
|
- [`get_width`](#get_width)
|
|
73
|
+
- [`is_monospace`](#is_monospace)
|
|
73
74
|
- [`is_static`](#is_static)
|
|
74
75
|
- [`is_variable`](#is_variable)
|
|
75
76
|
- [`rename`](#rename)
|
|
@@ -557,6 +558,17 @@ Gets the font width value and name.
|
|
|
557
558
|
width = font.get_width()
|
|
558
559
|
```
|
|
559
560
|
|
|
561
|
+
#### `is_monospace`
|
|
562
|
+
```python
|
|
563
|
+
"""
|
|
564
|
+
Determines if the font is a monospace font.
|
|
565
|
+
|
|
566
|
+
:returns: True if monospace font, False otherwise.
|
|
567
|
+
:rtype: bool
|
|
568
|
+
"""
|
|
569
|
+
mono = font.is_monospace()
|
|
570
|
+
```
|
|
571
|
+
|
|
560
572
|
#### `is_static`
|
|
561
573
|
```python
|
|
562
574
|
"""
|
|
@@ -811,7 +823,7 @@ Sets the vertical metrics.
|
|
|
811
823
|
"typo_ascender", "typo_descender", "typo_line_gap", "cap_height", "x_height",
|
|
812
824
|
"win_ascent", "win_descent"
|
|
813
825
|
"""
|
|
814
|
-
font.set_vertical_metrics(ascent=
|
|
826
|
+
font.set_vertical_metrics(units_per_em=2000, y_max=2102, y_min=-533, ascent=1800, descent=-400, line_gap=0, typo_ascender=1800, typo_descender=-400, typo_line_gap=0, cap_height=1400, x_height=1080, win_ascent=2160, win_descent=540)
|
|
815
827
|
```
|
|
816
828
|
|
|
817
829
|
#### `subset`
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def get_flag(
|
|
5
|
+
bits: int,
|
|
6
|
+
bit: int,
|
|
7
|
+
) -> bool:
|
|
2
8
|
"""
|
|
3
9
|
Gets the flag value.
|
|
4
10
|
|
|
@@ -13,7 +19,11 @@ def get_flag(bits, bit):
|
|
|
13
19
|
return bool(bits & (1 << bit))
|
|
14
20
|
|
|
15
21
|
|
|
16
|
-
def set_flag(
|
|
22
|
+
def set_flag(
|
|
23
|
+
bits: int,
|
|
24
|
+
bit: int,
|
|
25
|
+
value: bool,
|
|
26
|
+
) -> int:
|
|
17
27
|
"""
|
|
18
28
|
Sets the flag value.
|
|
19
29
|
|