ManimPango 0.4.3__cp311-cp311-win32.whl → 1.0.0a2__cp311-cp311-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.cp311-win32.pyd +0 -0
- manimpango/enums.c +3721 -0
- manimpango/enums.cp311-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.cp311-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.cp311-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.cp311-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.cp311-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.cp311-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.cp311-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.cp311-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
manimpango/enums.cp311-win32.pyd
CHANGED
Binary file
|
manimpango/enums.pyx
CHANGED
@@ -94,19 +94,10 @@ class Variant(Enum):
|
|
94
94
|
NORMAL = PANGO_VARIANT_NORMAL
|
95
95
|
SMALL_CAPS = PANGO_VARIANT_SMALL_CAPS
|
96
96
|
|
97
|
+
|
97
98
|
class Alignment(Enum):
|
98
99
|
"""
|
99
100
|
An enumeration specifying alignment.
|
100
|
-
|
101
|
-
Attributes
|
102
|
-
----------
|
103
|
-
|
104
|
-
NORMAL :
|
105
|
-
A normal font.
|
106
|
-
|
107
|
-
SMALL_CAPS :
|
108
|
-
A font with the lower case characters replaced by smaller variants
|
109
|
-
of the capital characters.
|
110
101
|
"""
|
111
102
|
LEFT = PANGO_ALIGN_LEFT
|
112
103
|
CENTER = PANGO_ALIGN_CENTER
|
manimpango/exceptions.py
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
"""This module contains the definition of :class:`FontDescription`,
|
3
|
+
and other enums related to it.
|
4
|
+
"""
|
5
|
+
from __future__ import annotations
|
6
|
+
|
7
|
+
__all__ = ["FontDescription", "Style", "Weight", "Variant"]
|
8
|
+
from ._font_desc import _FontDescription
|
9
|
+
from .enums import Style, Variant, Weight
|
10
|
+
|
11
|
+
|
12
|
+
class FontDescription:
|
13
|
+
"""A :class:`FontDescription` describes a font.
|
14
|
+
|
15
|
+
This describes the characteristics of a font to load.
|
16
|
+
|
17
|
+
Parameters
|
18
|
+
----------
|
19
|
+
family:
|
20
|
+
Sets :attr:`family`.
|
21
|
+
size:
|
22
|
+
Sets :attr:`size`.
|
23
|
+
style:
|
24
|
+
Sets :attr:`style`.
|
25
|
+
weight:
|
26
|
+
Sets :attr:`weight`.
|
27
|
+
variant:
|
28
|
+
Sets :attr:`variant`.
|
29
|
+
|
30
|
+
Attributes
|
31
|
+
----------
|
32
|
+
_font_desc:
|
33
|
+
Reference to the C-implementation of
|
34
|
+
font description.
|
35
|
+
"""
|
36
|
+
|
37
|
+
_font_desc: _FontDescription
|
38
|
+
|
39
|
+
def __init__(
|
40
|
+
self,
|
41
|
+
family: str = None,
|
42
|
+
size: int = None,
|
43
|
+
style: Style = None,
|
44
|
+
weight: Weight = None,
|
45
|
+
variant: Variant = None,
|
46
|
+
):
|
47
|
+
self._font_desc = _FontDescription(
|
48
|
+
family=family,
|
49
|
+
size=size,
|
50
|
+
style=style,
|
51
|
+
weight=weight,
|
52
|
+
variant=variant,
|
53
|
+
)
|
54
|
+
|
55
|
+
@property
|
56
|
+
def family(self) -> str:
|
57
|
+
"""The family name of the font.
|
58
|
+
|
59
|
+
The family name represents a family of related font styles,
|
60
|
+
and will resolve to a particular family. It is also
|
61
|
+
possible to use a comma separated list of family names for
|
62
|
+
this field.
|
63
|
+
"""
|
64
|
+
return self._font_desc.family
|
65
|
+
|
66
|
+
@family.setter
|
67
|
+
def family(self, family: str) -> None:
|
68
|
+
self._font_desc.family = family
|
69
|
+
|
70
|
+
@property
|
71
|
+
def size(self) -> int:
|
72
|
+
"""The size of the font of the text."""
|
73
|
+
return self._font_desc.size
|
74
|
+
|
75
|
+
@size.setter
|
76
|
+
def size(self, size: int):
|
77
|
+
self._font_desc.size = size
|
78
|
+
|
79
|
+
@property
|
80
|
+
def style(self) -> Style:
|
81
|
+
"""The style of the font of the text.
|
82
|
+
|
83
|
+
It should be one of :class:`.Style`. Most fonts will either have a
|
84
|
+
italic style or an oblique style, but not both, and font matching
|
85
|
+
in Pango will match italic specifications with oblique fonts and
|
86
|
+
vice-versa if an exact match is not found.
|
87
|
+
"""
|
88
|
+
return self._font_desc.style
|
89
|
+
|
90
|
+
@style.setter
|
91
|
+
def style(self, style: Style):
|
92
|
+
self._font_desc.style = style
|
93
|
+
|
94
|
+
@property
|
95
|
+
def weight(self) -> Weight:
|
96
|
+
"""The weight of the font of the text.
|
97
|
+
|
98
|
+
The weight field specifies how bold or light the font should be.
|
99
|
+
Should be one of :class:`.Weight`.
|
100
|
+
"""
|
101
|
+
return self._font_desc.weight
|
102
|
+
|
103
|
+
@weight.setter
|
104
|
+
def weight(self, weight: Weight):
|
105
|
+
self._font_desc.weight = weight
|
106
|
+
|
107
|
+
@property
|
108
|
+
def variant(self):
|
109
|
+
"""The variant of the font of the text.
|
110
|
+
|
111
|
+
Should be one of :class:`.Variant`.
|
112
|
+
"""
|
113
|
+
return self._font_desc.variant
|
114
|
+
|
115
|
+
@variant.setter
|
116
|
+
def variant(self, variant):
|
117
|
+
self._font_desc.variant = variant
|
118
|
+
|
119
|
+
@classmethod
|
120
|
+
def from_string(cls, string: str):
|
121
|
+
"""Parse a string and form :class:`FontDescription` from it.
|
122
|
+
|
123
|
+
See
|
124
|
+
https://docs.gtk.org/Pango/type_func.FontDescription.from_string.html#description
|
125
|
+
for the syntax of the string.
|
126
|
+
|
127
|
+
Parameters
|
128
|
+
----------
|
129
|
+
string : str
|
130
|
+
The string to be parsed.
|
131
|
+
|
132
|
+
Returns
|
133
|
+
-------
|
134
|
+
FontDescription
|
135
|
+
The :class:`FontDescription` that is based on the string.
|
136
|
+
"""
|
137
|
+
_t = FontDescription()
|
138
|
+
_t._font_desc = _FontDescription.from_string(string)
|
139
|
+
return _t
|
140
|
+
|
141
|
+
def __repr__(self):
|
142
|
+
return repr(self._font_desc)
|
143
|
+
|
144
|
+
def __str__(self):
|
145
|
+
return repr(self._font_desc)
|
146
|
+
|
147
|
+
def __eq__(self, other: FontDescription):
|
148
|
+
return self._font_desc == other._font_desc
|
149
|
+
|
150
|
+
def __deepcopy__(self, memo):
|
151
|
+
_a = FontDescription()
|
152
|
+
_a._font_desc = self._font_desc.__deepcopy__(memo)
|
153
|
+
return _a
|