python-fontbro 0.24.0__tar.gz → 0.25.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.
Files changed (60) hide show
  1. {python_fontbro-0.24.0/python_fontbro.egg-info → python_fontbro-0.25.0}/PKG-INFO +6 -6
  2. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/README.md +2 -2
  3. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/data/unicode-blocks.json +44 -0
  4. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/data/unicode-scripts.json +46 -11
  5. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/font.py +13 -10
  6. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/metadata.py +1 -1
  7. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/subset.py +1 -2
  8. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/utils.py +3 -1
  9. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/pyproject.toml +2 -3
  10. {python_fontbro-0.24.0 → python_fontbro-0.25.0/python_fontbro.egg-info}/PKG-INFO +6 -6
  11. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_family_classification.py +1 -2
  12. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_save.py +2 -0
  13. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_unicode_blocks_and_scripts.py +8 -8
  14. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/LICENSE.txt +0 -0
  15. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/MANIFEST.in +0 -0
  16. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/__init__.py +0 -0
  17. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/data/family-classifications.json +0 -0
  18. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/data/features.json +0 -0
  19. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/exceptions.py +0 -0
  20. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/flags.py +0 -0
  21. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/math.py +0 -0
  22. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/fontbro/py.typed +0 -0
  23. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/python_fontbro.egg-info/SOURCES.txt +0 -0
  24. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/python_fontbro.egg-info/dependency_links.txt +0 -0
  25. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/python_fontbro.egg-info/requires.txt +0 -0
  26. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/python_fontbro.egg-info/top_level.txt +0 -0
  27. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/setup.cfg +0 -0
  28. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/setup.py +0 -0
  29. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_characters.py +0 -0
  30. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_clone.py +0 -0
  31. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_close.py +0 -0
  32. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_collection.py +0 -0
  33. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_color.py +0 -0
  34. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_context_manager.py +0 -0
  35. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_family_name.py +0 -0
  36. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_features.py +0 -0
  37. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_filename.py +0 -0
  38. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_fingerprint.py +0 -0
  39. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_format.py +0 -0
  40. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_glyphs.py +0 -0
  41. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_image.py +0 -0
  42. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_init.py +0 -0
  43. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_instantiation.py +0 -0
  44. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_issues.py +0 -0
  45. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_italic_angle.py +0 -0
  46. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_monospace.py +0 -0
  47. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_names.py +0 -0
  48. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_rename.py +0 -0
  49. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_sanitize.py +0 -0
  50. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_str.py +0 -0
  51. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_style_flags.py +0 -0
  52. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_style_name.py +0 -0
  53. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_subset.py +0 -0
  54. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_svg.py +0 -0
  55. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_update_unicode_data.py +0 -0
  56. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_variable.py +0 -0
  57. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_version.py +0 -0
  58. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_vertical_metrics.py +0 -0
  59. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_weight.py +0 -0
  60. {python_fontbro-0.24.0 → python_fontbro-0.25.0}/tests/test_width.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: python-fontbro
3
- Version: 0.24.0
3
+ Version: 0.25.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,11 +43,10 @@ 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.8
47
- Classifier: Programming Language :: Python :: 3.9
48
46
  Classifier: Programming Language :: Python :: 3.10
49
47
  Classifier: Programming Language :: Python :: 3.11
50
48
  Classifier: Programming Language :: Python :: 3.12
49
+ Classifier: Programming Language :: Python :: 3.13
51
50
  Classifier: Programming Language :: Python :: Implementation :: PyPy
52
51
  Classifier: Topic :: Text Processing :: Fonts
53
52
  Classifier: Topic :: Multimedia :: Graphics
@@ -59,6 +58,7 @@ Requires-Dist: imagehash<5.0.0,>=4.2.1
59
58
  Requires-Dist: opentype-sanitizer<10.0.0,>=9.1.0
60
59
  Requires-Dist: pillow<11.0.0,>=8.4.0
61
60
  Requires-Dist: python-fsutil<1.0.0,>=0.9.3
61
+ Dynamic: license-file
62
62
 
63
63
  [![](https://img.shields.io/pypi/pyversions/python-fontbro.svg?color=blue&logo=python&logoColor=white)](https://www.python.org/)
64
64
  [![](https://img.shields.io/pypi/v/python-fontbro.svg?color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/python-fontbro/)
@@ -683,7 +683,7 @@ Determines if the font is a monospace font.
683
683
  :returns: True if monospace font, False otherwise.
684
684
  :rtype: bool
685
685
  """
686
- mono = font.is_monospace()
686
+ mono = font.is_monospace(threshold=0.85)
687
687
  ```
688
688
 
689
689
  #### `is_static`
@@ -1060,7 +1060,7 @@ Special thanks to [Jérémie Hornus](https://github.com/JeremieHornus) and [Just
1060
1060
  ## Supporting
1061
1061
  - :star: Star this project on [GitHub](https://github.com/fabiocaccamo/python-fontbro)
1062
1062
  - :octocat: Follow me on [GitHub](https://github.com/fabiocaccamo)
1063
- - :blue_heart: Follow me on [Twitter](https://twitter.com/fabiocaccamo)
1063
+ - :blue_heart: Follow me on [Bluesky](https://bsky.app/profile/fabiocaccamo.bsky.social)
1064
1064
  - :moneybag: Sponsor me on [Github](https://github.com/sponsors/fabiocaccamo)
1065
1065
 
1066
1066
  ## See also
@@ -621,7 +621,7 @@ Determines if the font is a monospace font.
621
621
  :returns: True if monospace font, False otherwise.
622
622
  :rtype: bool
623
623
  """
624
- mono = font.is_monospace()
624
+ mono = font.is_monospace(threshold=0.85)
625
625
  ```
626
626
 
627
627
  #### `is_static`
@@ -998,7 +998,7 @@ Special thanks to [Jérémie Hornus](https://github.com/JeremieHornus) and [Just
998
998
  ## Supporting
999
999
  - :star: Star this project on [GitHub](https://github.com/fabiocaccamo/python-fontbro)
1000
1000
  - :octocat: Follow me on [GitHub](https://github.com/fabiocaccamo)
1001
- - :blue_heart: Follow me on [Twitter](https://twitter.com/fabiocaccamo)
1001
+ - :blue_heart: Follow me on [Bluesky](https://bsky.app/profile/fabiocaccamo.bsky.social)
1002
1002
  - :moneybag: Sponsor me on [Github](https://github.com/sponsors/fabiocaccamo)
1003
1003
 
1004
1004
  ## See also
@@ -739,6 +739,10 @@
739
739
  "characters_total": 80,
740
740
  "name": "Vithkuqi"
741
741
  },
742
+ {
743
+ "characters_total": 64,
744
+ "name": "Todhri"
745
+ },
742
746
  {
743
747
  "characters_total": 384,
744
748
  "name": "Linear A"
@@ -827,6 +831,10 @@
827
831
  "characters_total": 64,
828
832
  "name": "Hanifi Rohingya"
829
833
  },
834
+ {
835
+ "characters_total": 80,
836
+ "name": "Garay"
837
+ },
830
838
  {
831
839
  "characters_total": 32,
832
840
  "name": "Rumi Numeral Symbols"
@@ -903,6 +911,10 @@
903
911
  "characters_total": 128,
904
912
  "name": "Grantha"
905
913
  },
914
+ {
915
+ "characters_total": 128,
916
+ "name": "Tulu-Tigalari"
917
+ },
906
918
  {
907
919
  "characters_total": 128,
908
920
  "name": "Newa"
@@ -927,6 +939,10 @@
927
939
  "characters_total": 80,
928
940
  "name": "Takri"
929
941
  },
942
+ {
943
+ "characters_total": 48,
944
+ "name": "Myanmar Extended-C"
945
+ },
930
946
  {
931
947
  "characters_total": 80,
932
948
  "name": "Ahom"
@@ -967,6 +983,10 @@
967
983
  "characters_total": 96,
968
984
  "name": "Devanagari Extended-A"
969
985
  },
986
+ {
987
+ "characters_total": 64,
988
+ "name": "Sunuwar"
989
+ },
970
990
  {
971
991
  "characters_total": 112,
972
992
  "name": "Bhaiksuki"
@@ -1023,10 +1043,18 @@
1023
1043
  "characters_total": 48,
1024
1044
  "name": "Egyptian Hieroglyph Format Controls"
1025
1045
  },
1046
+ {
1047
+ "characters_total": 4000,
1048
+ "name": "Egyptian Hieroglyphs Extended-A"
1049
+ },
1026
1050
  {
1027
1051
  "characters_total": 640,
1028
1052
  "name": "Anatolian Hieroglyphs"
1029
1053
  },
1054
+ {
1055
+ "characters_total": 64,
1056
+ "name": "Gurung Khema"
1057
+ },
1030
1058
  {
1031
1059
  "characters_total": 576,
1032
1060
  "name": "Bamum Supplement"
@@ -1047,6 +1075,10 @@
1047
1075
  "characters_total": 144,
1048
1076
  "name": "Pahawh Hmong"
1049
1077
  },
1078
+ {
1079
+ "characters_total": 64,
1080
+ "name": "Kirat Rai"
1081
+ },
1050
1082
  {
1051
1083
  "characters_total": 96,
1052
1084
  "name": "Medefaidrin"
@@ -1103,6 +1135,10 @@
1103
1135
  "characters_total": 16,
1104
1136
  "name": "Shorthand Format Controls"
1105
1137
  },
1138
+ {
1139
+ "characters_total": 704,
1140
+ "name": "Symbols for Legacy Computing Supplement"
1141
+ },
1106
1142
  {
1107
1143
  "characters_total": 208,
1108
1144
  "name": "Znamenny Musical Notation"
@@ -1171,6 +1207,10 @@
1171
1207
  "characters_total": 48,
1172
1208
  "name": "Nag Mundari"
1173
1209
  },
1210
+ {
1211
+ "characters_total": 48,
1212
+ "name": "Ol Onal"
1213
+ },
1174
1214
  {
1175
1215
  "characters_total": 32,
1176
1216
  "name": "Ethiopic Extended-B"
@@ -1279,6 +1319,10 @@
1279
1319
  "characters_total": 7488,
1280
1320
  "name": "CJK Unified Ideographs Extension F"
1281
1321
  },
1322
+ {
1323
+ "characters_total": 624,
1324
+ "name": "CJK Unified Ideographs Extension I"
1325
+ },
1282
1326
  {
1283
1327
  "characters_total": 544,
1284
1328
  "name": "CJK Compatibility Ideographs Supplement"
@@ -1,11 +1,11 @@
1
1
  [
2
2
  {
3
- "characters_total": 8301,
3
+ "characters_total": 9053,
4
4
  "name": "Common",
5
5
  "tag": "Zyyy"
6
6
  },
7
7
  {
8
- "characters_total": 1481,
8
+ "characters_total": 1487,
9
9
  "name": "Latin",
10
10
  "tag": "Latn"
11
11
  },
@@ -25,7 +25,7 @@
25
25
  "tag": "Grek"
26
26
  },
27
27
  {
28
- "characters_total": 143917,
28
+ "characters_total": 143993,
29
29
  "name": "Unknown",
30
30
  "tag": "Zzzz"
31
31
  },
@@ -35,7 +35,7 @@
35
35
  "tag": "Copt"
36
36
  },
37
37
  {
38
- "characters_total": 506,
38
+ "characters_total": 508,
39
39
  "name": "Cyrillic",
40
40
  "tag": "Cyrl"
41
41
  },
@@ -50,7 +50,7 @@
50
50
  "tag": "Hebr"
51
51
  },
52
52
  {
53
- "characters_total": 1368,
53
+ "characters_total": 1373,
54
54
  "name": "Arabic",
55
55
  "tag": "Arab"
56
56
  },
@@ -145,7 +145,7 @@
145
145
  "tag": "Tibt"
146
146
  },
147
147
  {
148
- "characters_total": 223,
148
+ "characters_total": 243,
149
149
  "name": "Myanmar",
150
150
  "tag": "Mymr"
151
151
  },
@@ -240,7 +240,7 @@
240
240
  "tag": "Lana"
241
241
  },
242
242
  {
243
- "characters_total": 124,
243
+ "characters_total": 127,
244
244
  "name": "Balinese",
245
245
  "tag": "Bali"
246
246
  },
@@ -280,7 +280,7 @@
280
280
  "tag": "Tfng"
281
281
  },
282
282
  {
283
- "characters_total": 98408,
283
+ "characters_total": 99030,
284
284
  "name": "Han",
285
285
  "tag": "Hani"
286
286
  },
@@ -434,6 +434,11 @@
434
434
  "name": "Vithkuqi",
435
435
  "tag": "Vith"
436
436
  },
437
+ {
438
+ "characters_total": 52,
439
+ "name": "Todhri",
440
+ "tag": "Todr"
441
+ },
437
442
  {
438
443
  "characters_total": 341,
439
444
  "name": "Linear A",
@@ -539,6 +544,11 @@
539
544
  "name": "Hanifi Rohingya",
540
545
  "tag": "Rohg"
541
546
  },
547
+ {
548
+ "characters_total": 69,
549
+ "name": "Garay",
550
+ "tag": "Gara"
551
+ },
542
552
  {
543
553
  "characters_total": 47,
544
554
  "name": "Yezidi",
@@ -619,6 +629,11 @@
619
629
  "name": "Grantha",
620
630
  "tag": "Gran"
621
631
  },
632
+ {
633
+ "characters_total": 80,
634
+ "name": "Tulu Tigalari",
635
+ "tag": "Tutg"
636
+ },
622
637
  {
623
638
  "characters_total": 97,
624
639
  "name": "Newa",
@@ -684,6 +699,11 @@
684
699
  "name": "Pau Cin Hau",
685
700
  "tag": "Pauc"
686
701
  },
702
+ {
703
+ "characters_total": 44,
704
+ "name": "Sunuwar",
705
+ "tag": "Sunu"
706
+ },
687
707
  {
688
708
  "characters_total": 97,
689
709
  "name": "Bhaiksuki",
@@ -710,7 +730,7 @@
710
730
  "tag": "Maka"
711
731
  },
712
732
  {
713
- "characters_total": 86,
733
+ "characters_total": 87,
714
734
  "name": "Kawi",
715
735
  "tag": "Kawi"
716
736
  },
@@ -725,7 +745,7 @@
725
745
  "tag": "Cpmn"
726
746
  },
727
747
  {
728
- "characters_total": 1110,
748
+ "characters_total": 5105,
729
749
  "name": "Egyptian Hieroglyphs",
730
750
  "tag": "Egyp"
731
751
  },
@@ -734,6 +754,11 @@
734
754
  "name": "Anatolian Hieroglyphs",
735
755
  "tag": "Hluw"
736
756
  },
757
+ {
758
+ "characters_total": 58,
759
+ "name": "Gurung Khema",
760
+ "tag": "Gukh"
761
+ },
737
762
  {
738
763
  "characters_total": 43,
739
764
  "name": "Mro",
@@ -754,6 +779,11 @@
754
779
  "name": "Pahawh Hmong",
755
780
  "tag": "Hmng"
756
781
  },
782
+ {
783
+ "characters_total": 58,
784
+ "name": "Kirat Rai",
785
+ "tag": "Krai"
786
+ },
757
787
  {
758
788
  "characters_total": 91,
759
789
  "name": "Medefaidrin",
@@ -775,7 +805,7 @@
775
805
  "tag": "Nshu"
776
806
  },
777
807
  {
778
- "characters_total": 471,
808
+ "characters_total": 472,
779
809
  "name": "Khitan Small Script",
780
810
  "tag": "Kits"
781
811
  },
@@ -809,6 +839,11 @@
809
839
  "name": "Nag Mundari",
810
840
  "tag": "Nagm"
811
841
  },
842
+ {
843
+ "characters_total": 44,
844
+ "name": "Ol Onal",
845
+ "tag": "Onao"
846
+ },
812
847
  {
813
848
  "characters_total": 213,
814
849
  "name": "Mende Kikakui",
@@ -7,11 +7,12 @@ import re
7
7
  import sys
8
8
  import tempfile
9
9
  from collections import Counter
10
+ from collections.abc import Generator
10
11
  from curses import ascii
11
12
  from io import BytesIO
12
13
  from pathlib import Path
13
- from typing import Any, Generator
14
- from typing.io import IO
14
+ from typing import IO, Any, cast
15
+
15
16
  import fsutil
16
17
  import ots
17
18
  from fontTools import unicodedata
@@ -350,7 +351,7 @@ class Font:
350
351
 
351
352
  def __init__(
352
353
  self,
353
- filepath: str | Path | IO | TTFont | Font,
354
+ filepath: str | Path | IO[Any] | TTFont | Font,
354
355
  **kwargs: Any,
355
356
  ) -> None:
356
357
  """
@@ -364,14 +365,14 @@ class Font:
364
365
  super().__init__()
365
366
 
366
367
  self._filepath: str | Path | None = None
367
- self._fileobject: IO | None = None
368
+ self._fileobject: IO[Any] | None = None
368
369
  self._ttfont: TTFont | None = None
369
370
  self._kwargs: dict[str, Any] = {}
370
371
 
371
372
  if isinstance(filepath, (Path, str)):
372
373
  self._init_with_filepath(str(filepath), **kwargs)
373
374
  elif hasattr(filepath, "read"):
374
- self._init_with_fileobject(filepath, **kwargs)
375
+ self._init_with_fileobject(cast(IO[Any], filepath), **kwargs)
375
376
  elif isinstance(filepath, Font):
376
377
  self._init_with_font(filepath, **kwargs)
377
378
  elif isinstance(filepath, TTFont):
@@ -399,7 +400,7 @@ class Font:
399
400
 
400
401
  def _init_with_fileobject(
401
402
  self,
402
- fileobject: IO,
403
+ fileobject: IO[Any],
403
404
  **kwargs: Any,
404
405
  ) -> None:
405
406
  try:
@@ -426,6 +427,7 @@ class Font:
426
427
  ) -> None:
427
428
  self._fileobject = BytesIO()
428
429
  ttfont.save(self._fileobject)
430
+ self._fileobject.seek(0)
429
431
  self._ttfont = TTFont(self._fileobject, **kwargs)
430
432
  self._kwargs = kwargs
431
433
 
@@ -484,7 +486,7 @@ class Font:
484
486
  self,
485
487
  *,
486
488
  ignore_blank: bool = False,
487
- ) -> Generator[dict[str, Any], None, None]:
489
+ ) -> Generator[dict[str, Any]]:
488
490
  """
489
491
  Gets the font characters.
490
492
 
@@ -829,7 +831,7 @@ class Font:
829
831
 
830
832
  def get_glyphs(
831
833
  self,
832
- ) -> Generator[dict[str, Any], None, None]:
834
+ ) -> Generator[dict[str, Any]]:
833
835
  """
834
836
  Gets the font glyphs and their own composition.
835
837
 
@@ -1781,8 +1783,8 @@ class Font:
1781
1783
 
1782
1784
  def save_to_fileobject(
1783
1785
  self,
1784
- fileobject: IO | None = None,
1785
- ) -> IO:
1786
+ fileobject: IO[Any] | None = None,
1787
+ ) -> IO[Any]:
1786
1788
  """
1787
1789
  Writes the font to a file-like object. If no file-object is passed, an
1788
1790
  instance of `BytesIO` is created for the user.
@@ -1796,6 +1798,7 @@ class Font:
1796
1798
  if fileobject is None:
1797
1799
  fileobject = BytesIO()
1798
1800
  font.save(fileobject)
1801
+ fileobject.seek(0)
1799
1802
  return fileobject
1800
1803
 
1801
1804
  def save_variable_instances(
@@ -4,4 +4,4 @@ __description__ = "friendly font operations on top of fontTools."
4
4
  __email__ = "fabio.caccamo@gmail.com"
5
5
  __license__ = "MIT"
6
6
  __title__ = "python-fontbro"
7
- __version__ = "0.24.0"
7
+ __version__ = "0.25.0"
@@ -1,7 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import re
4
-
5
4
  from collections.abc import Iterable
6
5
 
7
6
  from fontTools.subset import parse_unicodes as _parse_unicodes
@@ -25,5 +24,5 @@ def parse_unicodes(
25
24
  unicodes_str = re.sub(r"[\—\‐\−]", "-", unicodes_str)
26
25
  # remove U+, \u, u if present
27
26
  unicodes_str = re.sub(r"(U\+)|(\\u)|(u)", "", unicodes_str, flags=re.I)
28
- unicodes_list = _parse_unicodes(unicodes_str)
27
+ unicodes_list = list(_parse_unicodes(unicodes_str))
29
28
  return unicodes_list
@@ -1,7 +1,9 @@
1
1
  from __future__ import annotations
2
+
2
3
  import re
3
4
  import unicodedata
4
- from typing import Any, Callable
5
+ from collections.abc import Callable
6
+ from typing import Any
5
7
 
6
8
  import fsutil
7
9
 
@@ -40,11 +40,10 @@ classifiers = [
40
40
  "Natural Language :: English",
41
41
  "Operating System :: OS Independent",
42
42
  "Programming Language :: Python :: 3",
43
- "Programming Language :: Python :: 3.8",
44
- "Programming Language :: Python :: 3.9",
45
43
  "Programming Language :: Python :: 3.10",
46
44
  "Programming Language :: Python :: 3.11",
47
45
  "Programming Language :: Python :: 3.12",
46
+ "Programming Language :: Python :: 3.13",
48
47
  "Programming Language :: Python :: Implementation :: PyPy",
49
48
  "Topic :: Text Processing :: Fonts",
50
49
  "Topic :: Multimedia :: Graphics",
@@ -109,7 +108,7 @@ line-length = 88
109
108
 
110
109
  [tool.ruff.lint]
111
110
  ignore = ["E501"]
112
- select = ["B", "B9", "C", "E", "F", "W"]
111
+ select = ["B", "B9", "C", "E", "F", "I", "W"]
113
112
 
114
113
  [tool.ruff.lint.mccabe]
115
114
  max-complexity = 11
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: python-fontbro
3
- Version: 0.24.0
3
+ Version: 0.25.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,11 +43,10 @@ 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.8
47
- Classifier: Programming Language :: Python :: 3.9
48
46
  Classifier: Programming Language :: Python :: 3.10
49
47
  Classifier: Programming Language :: Python :: 3.11
50
48
  Classifier: Programming Language :: Python :: 3.12
49
+ Classifier: Programming Language :: Python :: 3.13
51
50
  Classifier: Programming Language :: Python :: Implementation :: PyPy
52
51
  Classifier: Topic :: Text Processing :: Fonts
53
52
  Classifier: Topic :: Multimedia :: Graphics
@@ -59,6 +58,7 @@ Requires-Dist: imagehash<5.0.0,>=4.2.1
59
58
  Requires-Dist: opentype-sanitizer<10.0.0,>=9.1.0
60
59
  Requires-Dist: pillow<11.0.0,>=8.4.0
61
60
  Requires-Dist: python-fsutil<1.0.0,>=0.9.3
61
+ Dynamic: license-file
62
62
 
63
63
  [![](https://img.shields.io/pypi/pyversions/python-fontbro.svg?color=blue&logo=python&logoColor=white)](https://www.python.org/)
64
64
  [![](https://img.shields.io/pypi/v/python-fontbro.svg?color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/python-fontbro/)
@@ -683,7 +683,7 @@ Determines if the font is a monospace font.
683
683
  :returns: True if monospace font, False otherwise.
684
684
  :rtype: bool
685
685
  """
686
- mono = font.is_monospace()
686
+ mono = font.is_monospace(threshold=0.85)
687
687
  ```
688
688
 
689
689
  #### `is_static`
@@ -1060,7 +1060,7 @@ Special thanks to [Jérémie Hornus](https://github.com/JeremieHornus) and [Just
1060
1060
  ## Supporting
1061
1061
  - :star: Star this project on [GitHub](https://github.com/fabiocaccamo/python-fontbro)
1062
1062
  - :octocat: Follow me on [GitHub](https://github.com/fabiocaccamo)
1063
- - :blue_heart: Follow me on [Twitter](https://twitter.com/fabiocaccamo)
1063
+ - :blue_heart: Follow me on [Bluesky](https://bsky.app/profile/fabiocaccamo.bsky.social)
1064
1064
  - :moneybag: Sponsor me on [Github](https://github.com/sponsors/fabiocaccamo)
1065
1065
 
1066
1066
  ## See also
@@ -1,7 +1,6 @@
1
- from tests import AbstractTestCase
2
-
3
1
  # import fsutil
4
2
  from fontbro.exceptions import ArgumentError
3
+ from tests import AbstractTestCase
5
4
 
6
5
 
7
6
  class FamilyClassificationTestCase(AbstractTestCase):
@@ -1,5 +1,7 @@
1
1
  from io import BytesIO
2
+
2
3
  import fsutil
4
+
3
5
  from fontbro import Font
4
6
  from tests import AbstractTestCase
5
7
 
@@ -140,15 +140,15 @@ class UnicodeBlocksAndScriptsTestCase(AbstractTestCase):
140
140
  expected_scripts = [
141
141
  {
142
142
  "characters_count": 1505,
143
- "characters_total": 8301,
144
- "coverage": 0.1813034574147693,
143
+ "characters_total": 9053,
144
+ "coverage": 0.16624323428697668,
145
145
  "name": "Common",
146
146
  "tag": "Zyyy",
147
147
  },
148
148
  {
149
149
  "characters_count": 345,
150
- "characters_total": 1481,
151
- "coverage": 0.23295070898041864,
150
+ "characters_total": 1487,
151
+ "coverage": 0.23201075991930062,
152
152
  "name": "Latin",
153
153
  "tag": "Latn",
154
154
  },
@@ -175,8 +175,8 @@ class UnicodeBlocksAndScriptsTestCase(AbstractTestCase):
175
175
  },
176
176
  {
177
177
  "characters_count": 66,
178
- "characters_total": 506,
179
- "coverage": 0.13043478260869565,
178
+ "characters_total": 508,
179
+ "coverage": 0.12992125984251968,
180
180
  "name": "Cyrillic",
181
181
  "tag": "Cyrl",
182
182
  },
@@ -189,8 +189,8 @@ class UnicodeBlocksAndScriptsTestCase(AbstractTestCase):
189
189
  },
190
190
  {
191
191
  "characters_count": 18100,
192
- "characters_total": 98408,
193
- "coverage": 0.18392813592390864,
192
+ "characters_total": 99030,
193
+ "coverage": 0.18277289710188832,
194
194
  "name": "Han",
195
195
  "tag": "Hani",
196
196
  },