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
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
@@ -0,0 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+ class MarkupParseError(Exception):
3
+ """MarkupParseError is raised when the markup passed in invalid."""
4
+
5
+ pass
@@ -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