ManimPango 1.0.0a1__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.
Binary file
@@ -17,28 +17,28 @@
17
17
  "C:\\cibw\\vendor\\include\\pango-1.0\\pango\\pangocairo.h"
18
18
  ],
19
19
  "include_dirs": [
20
- "C:/cibw/vendor/include/pango-1.0",
20
+ "C:/cibw/vendor/include/cairo",
21
21
  "C:/cibw/vendor/include/pixman-1",
22
- "C:/cibw/vendor/include/harfbuzz",
23
- "C:/cibw/vendor/include/freetype2",
24
22
  "C:/cibw/vendor/include/glib-2.0",
25
- "C:/cibw/vendor/lib/glib-2.0/include",
26
- "C:/cibw/vendor/include/cairo",
23
+ "C:/cibw/vendor/include/harfbuzz",
24
+ "C:/cibw/vendor/include/pango-1.0",
25
+ "C:/cibw/vendor/include",
27
26
  "C:/cibw/vendor/include/fribidi",
28
- "C:/cibw/vendor/include"
27
+ "C:/cibw/vendor/include/freetype2",
28
+ "C:/cibw/vendor/lib/glib-2.0/include"
29
29
  ],
30
30
  "libraries": [
31
- "glib-2.0",
32
- "intl",
31
+ "Gdi32",
33
32
  "gobject-2.0",
34
- "cairo",
33
+ "glib-2.0",
34
+ "fontconfig",
35
35
  "harfbuzz",
36
+ "pangoft2-1.0",
36
37
  "pangocairo-1.0",
37
- "fontconfig",
38
+ "intl",
38
39
  "freetype",
39
40
  "pango-1.0",
40
- "Gdi32",
41
- "pangoft2-1.0"
41
+ "cairo"
42
42
  ],
43
43
  "library_dirs": [
44
44
  "C:/cibw/vendor/lib"
Binary file
@@ -0,0 +1,52 @@
1
+ cdef pylayout_to_pango_layout(
2
+ PangoLayout* layout,
3
+ object py_layout,
4
+ PangoAttrList* attr_list,
5
+ ):
6
+ if py_layout.text:
7
+ pango_layout_set_text(
8
+ layout,
9
+ py_layout.text.encode('utf-8'),
10
+ -1,
11
+ )
12
+ if py_layout.markup:
13
+ pango_layout_set_markup(
14
+ layout,
15
+ py_layout.markup.encode('utf-8'),
16
+ -1,
17
+ )
18
+ if py_layout.width:
19
+ pango_layout_set_width(
20
+ layout,
21
+ pango_units_from_double(py_layout.width),
22
+ )
23
+ if py_layout.height:
24
+ if py_layout.height > 0:
25
+ pango_layout_set_height(
26
+ layout,
27
+ pango_units_from_double(py_layout.height),
28
+ )
29
+ else:
30
+ pango_layout_set_height(
31
+ layout,
32
+ py_layout.height,
33
+ )
34
+ if py_layout.alignment:
35
+ pango_layout_set_alignment(
36
+ layout,
37
+ py_layout.alignment.value,
38
+ )
39
+ if py_layout.attributes:
40
+ convert_to_pango_attributes(
41
+ py_layout.attributes,
42
+ attr_list,
43
+ )
44
+ pango_layout_set_attributes(
45
+ layout,
46
+ attr_list,
47
+ )
48
+ if py_layout.justify:
49
+ pango_layout_set_justify(
50
+ layout,
51
+ py_layout.justify,
52
+ )
@@ -18,28 +18,28 @@
18
18
  "C:\\cibw\\vendor\\include\\pango-1.0\\pango\\pangocairo.h"
19
19
  ],
20
20
  "include_dirs": [
21
- "C:/cibw/vendor/include/pango-1.0",
21
+ "C:/cibw/vendor/include/cairo",
22
22
  "C:/cibw/vendor/include/pixman-1",
23
- "C:/cibw/vendor/include/harfbuzz",
24
- "C:/cibw/vendor/include/freetype2",
25
23
  "C:/cibw/vendor/include/glib-2.0",
26
- "C:/cibw/vendor/lib/glib-2.0/include",
27
- "C:/cibw/vendor/include/cairo",
24
+ "C:/cibw/vendor/include/harfbuzz",
25
+ "C:/cibw/vendor/include/pango-1.0",
26
+ "C:/cibw/vendor/include",
28
27
  "C:/cibw/vendor/include/fribidi",
29
- "C:/cibw/vendor/include"
28
+ "C:/cibw/vendor/include/freetype2",
29
+ "C:/cibw/vendor/lib/glib-2.0/include"
30
30
  ],
31
31
  "libraries": [
32
- "glib-2.0",
33
- "intl",
32
+ "Gdi32",
34
33
  "gobject-2.0",
35
- "cairo",
34
+ "glib-2.0",
35
+ "fontconfig",
36
36
  "harfbuzz",
37
+ "pangoft2-1.0",
37
38
  "pangocairo-1.0",
38
- "fontconfig",
39
+ "intl",
39
40
  "freetype",
40
41
  "pango-1.0",
41
- "Gdi32",
42
- "pangoft2-1.0"
42
+ "cairo"
43
43
  ],
44
44
  "library_dirs": [
45
45
  "C:/cibw/vendor/lib"
Binary file
@@ -0,0 +1,72 @@
1
+ from cairo cimport *
2
+ from pango cimport *
3
+
4
+ from ..layout import Layout
5
+
6
+ include "../attributes/attributes.pxi"
7
+ include "../layout/layout.pxi"
8
+
9
+ cdef str is_context_fine(cairo_t* context):
10
+ cdef cairo_status_t status
11
+ status = cairo_status(context)
12
+ if status == CAIRO_STATUS_NO_MEMORY:
13
+ cairo_destroy(context)
14
+ raise MemoryError("Cairo returned memory error")
15
+ elif status != CAIRO_STATUS_SUCCESS:
16
+ temp_bytes = <bytes>cairo_status_to_string(status)
17
+ return temp_bytes.decode('utf-8')
18
+ return ""
19
+
20
+ cdef cairo_t* create_cairo_context_from_surface(cairo_surface_t* surface):
21
+ cr = cairo_create(surface)
22
+ status = cairo_status(cr)
23
+
24
+ if cr is NULL or status == CAIRO_STATUS_NO_MEMORY:
25
+ cairo_destroy(cr)
26
+ cairo_surface_destroy(surface)
27
+ raise MemoryError("Cairo.Context can't be created.")
28
+ elif status != CAIRO_STATUS_SUCCESS:
29
+ cairo_destroy(cr)
30
+ cairo_surface_destroy(surface)
31
+ # TODO: raise specific excpetions
32
+ raise Exception(cairo_status_to_string(status))
33
+
34
+ return cr
35
+
36
+ cdef PangoLayout* create_pango_layout(cairo_t* context):
37
+ # the resulting layout should be freed seperately
38
+ cdef PangoLayout* layout = pango_cairo_create_layout(context)
39
+ if layout is NULL:
40
+ cairo_destroy(context)
41
+ raise MemoryError("Pango.Layout can't be created from Cairo Context.")
42
+ return layout
43
+
44
+ cdef PangoFontDescription* create_font_desc():
45
+ # the resulting font_desc should be freed seperately
46
+ pango_font_desc = pango_font_description_new()
47
+ if pango_font_desc is NULL:
48
+ raise MemoryError("pango_font_description_new() returned NULL")
49
+
50
+ return pango_font_desc
51
+
52
+ cdef PangoAttrList* create_attr_list():
53
+ # the resulting attr_list should be freed seperately
54
+ attr_list = pango_attr_list_new()
55
+ if attr_list is NULL:
56
+ raise MemoryError("pango_attr_list_new() returned NULL")
57
+
58
+ return attr_list
59
+
60
+ cdef pyfontdesc_to_pango_font_desc(PangoFontDescription* font_desc, object py_font_desc):
61
+ if py_font_desc.family:
62
+ pango_font_description_set_family(
63
+ font_desc, py_font_desc.family.encode())
64
+ if py_font_desc.size:
65
+ pango_font_description_set_size(font_desc,
66
+ py_font_desc.size * PANGO_SCALE)
67
+ pango_font_description_set_style(font_desc,
68
+ py_font_desc.style.value)
69
+ pango_font_description_set_weight(font_desc,
70
+ py_font_desc.weight.value)
71
+ pango_font_description_set_variant(font_desc,
72
+ py_font_desc.variant.value)
@@ -17,28 +17,28 @@
17
17
  "C:\\cibw\\vendor\\include\\pango-1.0\\pango\\pangocairo.h"
18
18
  ],
19
19
  "include_dirs": [
20
- "C:/cibw/vendor/include/pango-1.0",
20
+ "C:/cibw/vendor/include/cairo",
21
21
  "C:/cibw/vendor/include/pixman-1",
22
- "C:/cibw/vendor/include/harfbuzz",
23
- "C:/cibw/vendor/include/freetype2",
24
22
  "C:/cibw/vendor/include/glib-2.0",
25
- "C:/cibw/vendor/lib/glib-2.0/include",
26
- "C:/cibw/vendor/include/cairo",
23
+ "C:/cibw/vendor/include/harfbuzz",
24
+ "C:/cibw/vendor/include/pango-1.0",
25
+ "C:/cibw/vendor/include",
27
26
  "C:/cibw/vendor/include/fribidi",
28
- "C:/cibw/vendor/include"
27
+ "C:/cibw/vendor/include/freetype2",
28
+ "C:/cibw/vendor/lib/glib-2.0/include"
29
29
  ],
30
30
  "libraries": [
31
- "glib-2.0",
32
- "intl",
31
+ "Gdi32",
33
32
  "gobject-2.0",
34
- "cairo",
33
+ "glib-2.0",
34
+ "fontconfig",
35
35
  "harfbuzz",
36
+ "pangoft2-1.0",
36
37
  "pangocairo-1.0",
37
- "fontconfig",
38
+ "intl",
38
39
  "freetype",
39
40
  "pango-1.0",
40
- "Gdi32",
41
- "pangoft2-1.0"
41
+ "cairo"
42
42
  ],
43
43
  "library_dirs": [
44
44
  "C:/cibw/vendor/lib"
@@ -17,28 +17,28 @@
17
17
  "C:\\cibw\\vendor\\include\\pango-1.0\\pango\\pangocairo.h"
18
18
  ],
19
19
  "include_dirs": [
20
- "C:/cibw/vendor/include/pango-1.0",
20
+ "C:/cibw/vendor/include/cairo",
21
21
  "C:/cibw/vendor/include/pixman-1",
22
- "C:/cibw/vendor/include/harfbuzz",
23
- "C:/cibw/vendor/include/freetype2",
24
22
  "C:/cibw/vendor/include/glib-2.0",
25
- "C:/cibw/vendor/lib/glib-2.0/include",
26
- "C:/cibw/vendor/include/cairo",
23
+ "C:/cibw/vendor/include/harfbuzz",
24
+ "C:/cibw/vendor/include/pango-1.0",
25
+ "C:/cibw/vendor/include",
27
26
  "C:/cibw/vendor/include/fribidi",
28
- "C:/cibw/vendor/include"
27
+ "C:/cibw/vendor/include/freetype2",
28
+ "C:/cibw/vendor/lib/glib-2.0/include"
29
29
  ],
30
30
  "libraries": [
31
- "glib-2.0",
32
- "intl",
31
+ "Gdi32",
33
32
  "gobject-2.0",
34
- "cairo",
33
+ "glib-2.0",
34
+ "fontconfig",
35
35
  "harfbuzz",
36
+ "pangoft2-1.0",
36
37
  "pangocairo-1.0",
37
- "fontconfig",
38
+ "intl",
38
39
  "freetype",
39
40
  "pango-1.0",
40
- "Gdi32",
41
- "pangoft2-1.0"
41
+ "cairo"
42
42
  ],
43
43
  "library_dirs": [
44
44
  "C:/cibw/vendor/lib"
Binary file
manimpango/utils/utils.c CHANGED
@@ -17,28 +17,28 @@
17
17
  "C:\\cibw\\vendor\\include\\pango-1.0\\pango\\pangocairo.h"
18
18
  ],
19
19
  "include_dirs": [
20
- "C:/cibw/vendor/include/pango-1.0",
20
+ "C:/cibw/vendor/include/cairo",
21
21
  "C:/cibw/vendor/include/pixman-1",
22
- "C:/cibw/vendor/include/harfbuzz",
23
- "C:/cibw/vendor/include/freetype2",
24
22
  "C:/cibw/vendor/include/glib-2.0",
25
- "C:/cibw/vendor/lib/glib-2.0/include",
26
- "C:/cibw/vendor/include/cairo",
23
+ "C:/cibw/vendor/include/harfbuzz",
24
+ "C:/cibw/vendor/include/pango-1.0",
25
+ "C:/cibw/vendor/include",
27
26
  "C:/cibw/vendor/include/fribidi",
28
- "C:/cibw/vendor/include"
27
+ "C:/cibw/vendor/include/freetype2",
28
+ "C:/cibw/vendor/lib/glib-2.0/include"
29
29
  ],
30
30
  "libraries": [
31
- "glib-2.0",
32
- "intl",
31
+ "Gdi32",
33
32
  "gobject-2.0",
34
- "cairo",
33
+ "glib-2.0",
34
+ "fontconfig",
35
35
  "harfbuzz",
36
+ "pangoft2-1.0",
36
37
  "pangocairo-1.0",
37
- "fontconfig",
38
+ "intl",
38
39
  "freetype",
39
40
  "pango-1.0",
40
- "Gdi32",
41
- "pangoft2-1.0"
41
+ "cairo"
42
42
  ],
43
43
  "library_dirs": [
44
44
  "C:/cibw/vendor/lib"