ManimPango 0.4.3__cp310-cp310-win32.whl → 1.0.0a2__cp310-cp310-win32.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.
Files changed (83) hide show
  1. {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/METADATA +2 -2
  2. ManimPango-1.0.0a2.dist-info/RECORD +85 -0
  3. {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/WHEEL +1 -1
  4. manimpango/__init__.py +5 -7
  5. manimpango/_distributor_init.py +36 -0
  6. manimpango/_version.py +1 -1
  7. manimpango/attributes/__init__.py +324 -0
  8. manimpango/attributes/attributes.pxi +219 -0
  9. manimpango/buffer.pxi +15 -0
  10. manimpango/cmanimpango.c +10025 -0
  11. manimpango/cmanimpango.cp310-win32.pyd +0 -0
  12. manimpango/enums.c +3721 -0
  13. manimpango/enums.cp310-win32.pyd +0 -0
  14. manimpango/enums.pyx +1 -10
  15. manimpango/exceptions.py +5 -0
  16. manimpango/fonts/__init__.py +153 -0
  17. manimpango/fonts/_font_desc.c +7576 -0
  18. manimpango/fonts/_font_desc.cp310-win32.pyd +0 -0
  19. manimpango/fonts/_font_desc.pxd +5 -0
  20. manimpango/fonts/_font_desc.pyi +25 -0
  21. manimpango/fonts/_font_desc.pyx +114 -0
  22. manimpango/fonts/enums.c +3628 -0
  23. manimpango/fonts/enums.cp310-win32.pyd +0 -0
  24. manimpango/fonts/enums.pyi +23 -0
  25. manimpango/fonts/enums.pyx +84 -0
  26. manimpango/{cairo.pxd → include/cairo.pxd} +21 -0
  27. manimpango/include/glib.pxd +36 -0
  28. manimpango/{pango.pxd → include/pango.pxd} +61 -0
  29. manimpango/include/pango_attributes.pxd +184 -0
  30. manimpango/layout/__init__.py +266 -0
  31. manimpango/layout/_layout.c +8630 -0
  32. manimpango/layout/_layout.cp310-win32.pyd +0 -0
  33. manimpango/layout/_layout.pyx +60 -0
  34. manimpango/layout/layout.pxi +52 -0
  35. manimpango/register_font.c +5016 -0
  36. manimpango/register_font.cp310-win32.pyd +0 -0
  37. manimpango/renderer/__init__.py +5 -0
  38. manimpango/renderer/cairo_utils.pxi +72 -0
  39. manimpango/renderer/image_renderer.c +12319 -0
  40. manimpango/renderer/image_renderer.cp310-win32.pyd +0 -0
  41. manimpango/renderer/image_renderer.pxd +23 -0
  42. manimpango/renderer/image_renderer.pyi +21 -0
  43. manimpango/renderer/image_renderer.pyx +219 -0
  44. manimpango/renderer/svg_renderer.c +10671 -0
  45. manimpango/renderer/svg_renderer.cp310-win32.pyd +0 -0
  46. manimpango/renderer/svg_renderer.pxd +23 -0
  47. manimpango/renderer/svg_renderer.pyi +17 -0
  48. manimpango/renderer/svg_renderer.pyx +174 -0
  49. manimpango/utils/__init__.py +3 -0
  50. manimpango/utils/_utils.cp310-win32.pyd +0 -0
  51. manimpango/utils/_utils.pyi +2 -0
  52. manimpango/utils/utils.c +3533 -0
  53. manimpango/{utils.py → utils/utils.py} +3 -1
  54. manimpango/utils/utils.pyx +27 -0
  55. ManimPango-0.4.3.dist-info/RECORD +0 -44
  56. manimpango/glib.pxd +0 -13
  57. {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/LICENSE +0 -0
  58. {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/LICENSE.win32 +0 -0
  59. {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/top_level.txt +0 -0
  60. /manimpango/{CORE_MANIM_cairo-2.dll → .libs/CORE_MANIM_cairo-2.dll} +0 -0
  61. /manimpango/{CORE_MANIM_cairo-gobject-2.dll → .libs/CORE_MANIM_cairo-gobject-2.dll} +0 -0
  62. /manimpango/{CORE_MANIM_cairo-script-interpreter-2.dll → .libs/CORE_MANIM_cairo-script-interpreter-2.dll} +0 -0
  63. /manimpango/{CORE_MANIM_expat.dll → .libs/CORE_MANIM_expat.dll} +0 -0
  64. /manimpango/{CORE_MANIM_ffi-7.dll → .libs/CORE_MANIM_ffi-7.dll} +0 -0
  65. /manimpango/{CORE_MANIM_fontconfig-1.dll → .libs/CORE_MANIM_fontconfig-1.dll} +0 -0
  66. /manimpango/{CORE_MANIM_freetype-6.dll → .libs/CORE_MANIM_freetype-6.dll} +0 -0
  67. /manimpango/{CORE_MANIM_fribidi-0.dll → .libs/CORE_MANIM_fribidi-0.dll} +0 -0
  68. /manimpango/{CORE_MANIM_gio-2.0-0.dll → .libs/CORE_MANIM_gio-2.0-0.dll} +0 -0
  69. /manimpango/{CORE_MANIM_glib-2.0-0.dll → .libs/CORE_MANIM_glib-2.0-0.dll} +0 -0
  70. /manimpango/{CORE_MANIM_gmodule-2.0-0.dll → .libs/CORE_MANIM_gmodule-2.0-0.dll} +0 -0
  71. /manimpango/{CORE_MANIM_gobject-2.0-0.dll → .libs/CORE_MANIM_gobject-2.0-0.dll} +0 -0
  72. /manimpango/{CORE_MANIM_gthread-2.0-0.dll → .libs/CORE_MANIM_gthread-2.0-0.dll} +0 -0
  73. /manimpango/{CORE_MANIM_harfbuzz-gobject.dll → .libs/CORE_MANIM_harfbuzz-gobject.dll} +0 -0
  74. /manimpango/{CORE_MANIM_harfbuzz-subset.dll → .libs/CORE_MANIM_harfbuzz-subset.dll} +0 -0
  75. /manimpango/{CORE_MANIM_harfbuzz.dll → .libs/CORE_MANIM_harfbuzz.dll} +0 -0
  76. /manimpango/{CORE_MANIM_intl-8.dll → .libs/CORE_MANIM_intl-8.dll} +0 -0
  77. /manimpango/{CORE_MANIM_pango-1.0-0.dll → .libs/CORE_MANIM_pango-1.0-0.dll} +0 -0
  78. /manimpango/{CORE_MANIM_pangocairo-1.0-0.dll → .libs/CORE_MANIM_pangocairo-1.0-0.dll} +0 -0
  79. /manimpango/{CORE_MANIM_pangoft2-1.0-0.dll → .libs/CORE_MANIM_pangoft2-1.0-0.dll} +0 -0
  80. /manimpango/{CORE_MANIM_pangowin32-1.0-0.dll → .libs/CORE_MANIM_pangowin32-1.0-0.dll} +0 -0
  81. /manimpango/{CORE_MANIM_pixman-1-0.dll → .libs/CORE_MANIM_pixman-1-0.dll} +0 -0
  82. /manimpango/{CORE_MANIM_png16-16.dll → .libs/CORE_MANIM_png16-16.dll} +0 -0
  83. /manimpango/{CORE_MANIM_z.dll → .libs/CORE_MANIM_z.dll} +0 -0
@@ -0,0 +1,5 @@
1
+ from pango cimport *
2
+
3
+
4
+ cdef class _FontDescription:
5
+ cdef PangoFontDescription* pango_font_desc
@@ -0,0 +1,25 @@
1
+ from __future__ import annotations
2
+
3
+ from manimpango.fonts.enums import Style, Variant, Weight
4
+
5
+ class _FontDescription:
6
+ def __init__(
7
+ self,
8
+ family: str = None,
9
+ size: int = None,
10
+ style: Style = None,
11
+ weight: Weight = None,
12
+ variant: Variant = None,
13
+ ) -> None: ...
14
+ @property
15
+ def family(self) -> str | None: ...
16
+ @property
17
+ def size(self) -> int: ...
18
+ @property
19
+ def style(self) -> Style: ...
20
+ @property
21
+ def weight(self) -> Weight: ...
22
+ @property
23
+ def variant(self) -> Variant: ...
24
+ @classmethod
25
+ def from_string(cls, string: str) -> FontDescription: ...
@@ -0,0 +1,114 @@
1
+ from .enums import Style, Variant, Weight
2
+
3
+
4
+ cdef class _FontDescription:
5
+ def __cinit__(self):
6
+ self.pango_font_desc = pango_font_description_new()
7
+ if self.pango_font_desc is NULL:
8
+ raise MemoryError("pango_font_description_new() returned NULL")
9
+
10
+ def __init__(
11
+ self,
12
+ family=None,
13
+ size=None,
14
+ style=None,
15
+ weight=None,
16
+ variant=None
17
+ ):
18
+ if family:
19
+ self.family = family
20
+ if size:
21
+ self.size = size
22
+ if style:
23
+ self.style = style
24
+ if weight:
25
+ self.weight = weight
26
+ if variant:
27
+ self.variant = variant
28
+
29
+ @property
30
+ def family(self):
31
+ cdef const char* _family = \
32
+ pango_font_description_get_family(self.pango_font_desc)
33
+ if _family is NULL:
34
+ return None
35
+ return _family.decode()
36
+
37
+ @family.setter
38
+ def family(self, family: str):
39
+ pango_font_description_set_family(
40
+ self.pango_font_desc, family.encode())
41
+
42
+ @property
43
+ def size(self):
44
+ return pango_font_description_get_size(self.pango_font_desc) // PANGO_SCALE
45
+
46
+ @size.setter
47
+ def size(self, size: int):
48
+ pango_font_description_set_size(self.pango_font_desc, size * PANGO_SCALE)
49
+
50
+ @property
51
+ def style(self):
52
+ return Style(
53
+ pango_font_description_get_style(self.pango_font_desc))
54
+
55
+ @style.setter
56
+ def style(self, style: Style):
57
+ pango_font_description_set_style(self.pango_font_desc, style.value)
58
+
59
+ @property
60
+ def weight(self):
61
+ return Weight(
62
+ pango_font_description_get_weight(self.pango_font_desc))
63
+
64
+ @weight.setter
65
+ def weight(self, weight: Weight):
66
+ pango_font_description_set_weight(
67
+ self.pango_font_desc, weight.value)
68
+
69
+ @property
70
+ def variant(self):
71
+ return Variant(
72
+ pango_font_description_get_variant(self.pango_font_desc))
73
+
74
+ @variant.setter
75
+ def variant(self, variant):
76
+ pango_font_description_set_variant(
77
+ self.pango_font_desc, variant.value)
78
+
79
+ @classmethod
80
+ def from_string(cls, string: str):
81
+ _t = _FontDescription()
82
+ cdef PangoFontDescription* font_desc = NULL
83
+ _t.pango_font_desc = \
84
+ pango_font_description_from_string(string.encode())
85
+ if _t.pango_font_desc is NULL:
86
+ raise ValueError("pango_font_description_from_string() returned NULL")
87
+ return _t
88
+
89
+ def __repr__(self):
90
+ cdef char* desc = \
91
+ pango_font_description_to_string(self.pango_font_desc)
92
+ p_desc = <bytes>desc
93
+ g_free(desc)
94
+ return p_desc.decode()
95
+
96
+ def __str__(self):
97
+ return self.__repr__()
98
+
99
+ def __eq__(self, other: _FontDescription):
100
+ return bool(pango_font_description_equal(
101
+ self.pango_font_desc, other.pango_font_desc))
102
+
103
+ def __copy__(self):
104
+ _t = _FontDescription()
105
+ pango_font_description_free(_t.pango_font_desc)
106
+ _t.pango_font_desc = \
107
+ pango_font_description_copy(self.pango_font_desc)
108
+ return _t
109
+
110
+ def __deepcopy__(self, memo):
111
+ return self.__copy__()
112
+
113
+ def __dealloc__(self):
114
+ pango_font_description_free(self.pango_font_desc)