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.
- {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/METADATA +2 -2
- ManimPango-1.0.0a2.dist-info/RECORD +85 -0
- {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/WHEEL +1 -1
- manimpango/__init__.py +5 -7
- manimpango/_distributor_init.py +36 -0
- manimpango/_version.py +1 -1
- manimpango/attributes/__init__.py +324 -0
- manimpango/attributes/attributes.pxi +219 -0
- manimpango/buffer.pxi +15 -0
- manimpango/cmanimpango.c +10025 -0
- manimpango/cmanimpango.cp310-win32.pyd +0 -0
- manimpango/enums.c +3721 -0
- manimpango/enums.cp310-win32.pyd +0 -0
- manimpango/enums.pyx +1 -10
- manimpango/exceptions.py +5 -0
- manimpango/fonts/__init__.py +153 -0
- manimpango/fonts/_font_desc.c +7576 -0
- manimpango/fonts/_font_desc.cp310-win32.pyd +0 -0
- manimpango/fonts/_font_desc.pxd +5 -0
- manimpango/fonts/_font_desc.pyi +25 -0
- manimpango/fonts/_font_desc.pyx +114 -0
- manimpango/fonts/enums.c +3628 -0
- manimpango/fonts/enums.cp310-win32.pyd +0 -0
- manimpango/fonts/enums.pyi +23 -0
- manimpango/fonts/enums.pyx +84 -0
- manimpango/{cairo.pxd → include/cairo.pxd} +21 -0
- manimpango/include/glib.pxd +36 -0
- manimpango/{pango.pxd → include/pango.pxd} +61 -0
- manimpango/include/pango_attributes.pxd +184 -0
- manimpango/layout/__init__.py +266 -0
- manimpango/layout/_layout.c +8630 -0
- manimpango/layout/_layout.cp310-win32.pyd +0 -0
- manimpango/layout/_layout.pyx +60 -0
- manimpango/layout/layout.pxi +52 -0
- manimpango/register_font.c +5016 -0
- manimpango/register_font.cp310-win32.pyd +0 -0
- manimpango/renderer/__init__.py +5 -0
- manimpango/renderer/cairo_utils.pxi +72 -0
- manimpango/renderer/image_renderer.c +12319 -0
- manimpango/renderer/image_renderer.cp310-win32.pyd +0 -0
- manimpango/renderer/image_renderer.pxd +23 -0
- manimpango/renderer/image_renderer.pyi +21 -0
- manimpango/renderer/image_renderer.pyx +219 -0
- manimpango/renderer/svg_renderer.c +10671 -0
- manimpango/renderer/svg_renderer.cp310-win32.pyd +0 -0
- manimpango/renderer/svg_renderer.pxd +23 -0
- manimpango/renderer/svg_renderer.pyi +17 -0
- manimpango/renderer/svg_renderer.pyx +174 -0
- manimpango/utils/__init__.py +3 -0
- manimpango/utils/_utils.cp310-win32.pyd +0 -0
- manimpango/utils/_utils.pyi +2 -0
- manimpango/utils/utils.c +3533 -0
- manimpango/{utils.py → utils/utils.py} +3 -1
- manimpango/utils/utils.pyx +27 -0
- ManimPango-0.4.3.dist-info/RECORD +0 -44
- manimpango/glib.pxd +0 -13
- {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/LICENSE +0 -0
- {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/LICENSE.win32 +0 -0
- {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/top_level.txt +0 -0
- /manimpango/{CORE_MANIM_cairo-2.dll → .libs/CORE_MANIM_cairo-2.dll} +0 -0
- /manimpango/{CORE_MANIM_cairo-gobject-2.dll → .libs/CORE_MANIM_cairo-gobject-2.dll} +0 -0
- /manimpango/{CORE_MANIM_cairo-script-interpreter-2.dll → .libs/CORE_MANIM_cairo-script-interpreter-2.dll} +0 -0
- /manimpango/{CORE_MANIM_expat.dll → .libs/CORE_MANIM_expat.dll} +0 -0
- /manimpango/{CORE_MANIM_ffi-7.dll → .libs/CORE_MANIM_ffi-7.dll} +0 -0
- /manimpango/{CORE_MANIM_fontconfig-1.dll → .libs/CORE_MANIM_fontconfig-1.dll} +0 -0
- /manimpango/{CORE_MANIM_freetype-6.dll → .libs/CORE_MANIM_freetype-6.dll} +0 -0
- /manimpango/{CORE_MANIM_fribidi-0.dll → .libs/CORE_MANIM_fribidi-0.dll} +0 -0
- /manimpango/{CORE_MANIM_gio-2.0-0.dll → .libs/CORE_MANIM_gio-2.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_glib-2.0-0.dll → .libs/CORE_MANIM_glib-2.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_gmodule-2.0-0.dll → .libs/CORE_MANIM_gmodule-2.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_gobject-2.0-0.dll → .libs/CORE_MANIM_gobject-2.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_gthread-2.0-0.dll → .libs/CORE_MANIM_gthread-2.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_harfbuzz-gobject.dll → .libs/CORE_MANIM_harfbuzz-gobject.dll} +0 -0
- /manimpango/{CORE_MANIM_harfbuzz-subset.dll → .libs/CORE_MANIM_harfbuzz-subset.dll} +0 -0
- /manimpango/{CORE_MANIM_harfbuzz.dll → .libs/CORE_MANIM_harfbuzz.dll} +0 -0
- /manimpango/{CORE_MANIM_intl-8.dll → .libs/CORE_MANIM_intl-8.dll} +0 -0
- /manimpango/{CORE_MANIM_pango-1.0-0.dll → .libs/CORE_MANIM_pango-1.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_pangocairo-1.0-0.dll → .libs/CORE_MANIM_pangocairo-1.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_pangoft2-1.0-0.dll → .libs/CORE_MANIM_pangoft2-1.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_pangowin32-1.0-0.dll → .libs/CORE_MANIM_pangowin32-1.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_pixman-1-0.dll → .libs/CORE_MANIM_pixman-1-0.dll} +0 -0
- /manimpango/{CORE_MANIM_png16-16.dll → .libs/CORE_MANIM_png16-16.dll} +0 -0
- /manimpango/{CORE_MANIM_z.dll → .libs/CORE_MANIM_z.dll} +0 -0
Binary file
|
@@ -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)
|