ManimPango 1.0.0a1__cp38-cp38-win_amd64.whl → 1.0.0a2__cp38-cp38-win_amd64.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 (30) hide show
  1. {ManimPango-1.0.0a1.dist-info → ManimPango-1.0.0a2.dist-info}/METADATA +1 -1
  2. {ManimPango-1.0.0a1.dist-info → ManimPango-1.0.0a2.dist-info}/RECORD +30 -26
  3. manimpango/_version.py +1 -1
  4. manimpango/attributes/attributes.pxi +219 -0
  5. manimpango/buffer.pxi +15 -0
  6. manimpango/cmanimpango.c +12 -12
  7. manimpango/cmanimpango.cp38-win_amd64.pyd +0 -0
  8. manimpango/enums.c +12 -12
  9. manimpango/enums.cp38-win_amd64.pyd +0 -0
  10. manimpango/fonts/_font_desc.c +135 -72
  11. manimpango/fonts/_font_desc.cp38-win_amd64.pyd +0 -0
  12. manimpango/fonts/_font_desc.pyx +3 -0
  13. manimpango/fonts/enums.c +12 -12
  14. manimpango/fonts/enums.cp38-win_amd64.pyd +0 -0
  15. manimpango/layout/_layout.c +12 -12
  16. manimpango/layout/_layout.cp38-win_amd64.pyd +0 -0
  17. manimpango/layout/layout.pxi +52 -0
  18. manimpango/register_font.c +12 -12
  19. manimpango/register_font.cp38-win_amd64.pyd +0 -0
  20. manimpango/renderer/cairo_utils.pxi +72 -0
  21. manimpango/renderer/image_renderer.c +12 -12
  22. manimpango/renderer/image_renderer.cp38-win_amd64.pyd +0 -0
  23. manimpango/renderer/svg_renderer.c +12 -12
  24. manimpango/renderer/svg_renderer.cp38-win_amd64.pyd +0 -0
  25. manimpango/utils/_utils.cp38-win_amd64.pyd +0 -0
  26. manimpango/utils/utils.c +12 -12
  27. {ManimPango-1.0.0a1.dist-info → ManimPango-1.0.0a2.dist-info}/LICENSE +0 -0
  28. {ManimPango-1.0.0a1.dist-info → ManimPango-1.0.0a2.dist-info}/LICENSE.win32 +0 -0
  29. {ManimPango-1.0.0a1.dist-info → ManimPango-1.0.0a2.dist-info}/WHEEL +0 -0
  30. {ManimPango-1.0.0a1.dist-info → ManimPango-1.0.0a2.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ManimPango
3
- Version: 1.0.0a1
3
+ Version: 1.0.0a2
4
4
  Summary: Bindings for Pango for using with Manim.
5
5
  Home-page: https://manimpango.manim.community/
6
6
  Author: Naveen M K
@@ -1,16 +1,17 @@
1
1
  manimpango/__init__.py,sha256=ELRxGogKS5uPGatJzGmPAaj068ZOO-Sze88nenz4RE8,1153
2
2
  manimpango/_distributor_init.py,sha256=z3NAjz5oUeNo6Pbk6zuA9Lfi71rB3ucus0XDpZ3nSrk,1233
3
- manimpango/_version.py,sha256=wfWJ_x4xe7V-sIPQUxZbSdL5DGb3cVdMelnmMCz9qpc,50
4
- manimpango/cmanimpango.c,sha256=4cpEASJwln_fe4c6vwGolhJ2NWlKJxdur6cPd28Q7bI,418073
5
- manimpango/cmanimpango.cp38-win_amd64.pyd,sha256=yLySr8r6K_N3A6DIW7tnzB_eNsqFEUAYeWhjwEbWdUg,73728
3
+ manimpango/_version.py,sha256=Vq7ueDz68EUGVviee7EKuGy1u4lkrTzFM_-KtqwbrfY,50
4
+ manimpango/buffer.pxi,sha256=NklqLNZ0462IL9CpZc9AFG8c1N2ULr6JAURJdhegQng,419
5
+ manimpango/cmanimpango.c,sha256=63UNUSD2u4AFXxdIYsNK9PLzRCJXlclnUk3MDlHCFjc,418073
6
+ manimpango/cmanimpango.cp38-win_amd64.pyd,sha256=03mNmBWuIcRjo3fC0ZGP1Ho504yr3teJg1nrgD3Y_Ns,73728
6
7
  manimpango/cmanimpango.pxd,sha256=Apb6qZMqtkL9ldE_nMxVtdsnTH2tkmYt94lrhsB0Qwc,65
7
8
  manimpango/cmanimpango.pyx,sha256=f3wr3BpOmIsr1yi7jQsaKv9ntyKyzRWJmbNo8JPLqig,10744
8
- manimpango/enums.c,sha256=MO4xY2YFY2uTZKPZe3Ulfm9jQdDIxw_IEWUfL12pE_0,149445
9
- manimpango/enums.cp38-win_amd64.pyd,sha256=AM8kC7qz4U6yMxPeHeUzoNBI-QIidkDUyh3OgLv5Dto,26112
9
+ manimpango/enums.c,sha256=25snfoX1sJVBRVmbaWSNzMI-aGAw5GHXBaLwIPA4Iz8,149445
10
+ manimpango/enums.cp38-win_amd64.pyd,sha256=UOzZ2YUdfedRimP_J8PfG9VuIiy18klutEMoWaWb4DQ,26112
10
11
  manimpango/enums.pyx,sha256=5qEKGgt3ueVXJkDKo5f_gyfOcuYCQ_j3sHKuXXkrO14,2370
11
12
  manimpango/exceptions.py,sha256=sg8znK3Yr_Qw_BoACd4sS3ZiWLXgsStAi1tmK-9549o,146
12
- manimpango/register_font.c,sha256=1xAO-NRW5rNuryvLUSxB5DxRwHgzR4GXZ2Ohxjiv2RY,199324
13
- manimpango/register_font.cp38-win_amd64.pyd,sha256=7HmyXgog0L2y5Ktru8tVC3sy4Oo5xjs4GHA9Fn84pic,36864
13
+ manimpango/register_font.c,sha256=YvUK6gK2tR-dCTgvhikBqapUuHZoy5w3gbEDnG9BNNw,199324
14
+ manimpango/register_font.cp38-win_amd64.pyd,sha256=oFaYqAJpsIFJbgGQFJMrYluT-Ta1N0K8ZTuP1MIiuRk,36864
14
15
  manimpango/register_font.pxd,sha256=8iZpMnQenfTdUUxhNdesi21GeGjHX07pvIWiQom6Jio,1653
15
16
  manimpango/register_font.pyx,sha256=H_fe5SLNue6H3vpB01aindxxNQEbtG7jiDhXCk0PZTo,7548
16
17
  manimpango/.libs/CORE_MANIM_cairo-2.dll,sha256=lttR5-2wVg3Y66a3wa-xOVB8gMPD3Vi1jMT0v7yEXhE,906240
@@ -38,14 +39,15 @@ manimpango/.libs/CORE_MANIM_pixman-1-0.dll,sha256=UBZ080EGrc4NYRzRRwwKbzmfGxykSG
38
39
  manimpango/.libs/CORE_MANIM_png16-16.dll,sha256=3doABQ79VhdEmLh71UQbhhfdjWJmQN9YTz_BSkXlihc,195072
39
40
  manimpango/.libs/CORE_MANIM_z.dll,sha256=gFJNdWYIKc5V8MCHCYIK-Z95st0LEQuvDFH_z1F8edE,86528
40
41
  manimpango/attributes/__init__.py,sha256=IqbS6YvnX_5YBcvhhh-jOuqsG26hywrwWxO7rf2eMH4,10777
42
+ manimpango/attributes/attributes.pxi,sha256=o_EAkxTXVQa-GKXmjqjRpyl3rRM2oxqI2B8nGsCPxoY,6298
41
43
  manimpango/fonts/__init__.py,sha256=ijgoYEfA6oETMQZlb613YSGc7cAuWPyM9-jxgKMMznA,4142
42
- manimpango/fonts/_font_desc.c,sha256=AIrXv0NWxOVn2km6qHg1pe2bCiEHnWOO5qUoUMvfd1w,302995
43
- manimpango/fonts/_font_desc.cp38-win_amd64.pyd,sha256=w2nTwqz0D6eRrGhz07yEHXVNYIUloo_clq6v3JHhW3Q,41984
44
+ manimpango/fonts/_font_desc.c,sha256=TM7YBRCxaua213KTVFHoxqeQfZdP2Zm6-8pUZAWTEAo,306216
45
+ manimpango/fonts/_font_desc.cp38-win_amd64.pyd,sha256=-QbgJ2vfr8yww83x8Furgng5WxMXysrvsEDNQy0PO58,41984
44
46
  manimpango/fonts/_font_desc.pxd,sha256=f7L1fDqWEqeANGliVzPLAabpsNf_S5hYZfYAHbA0Qjw,104
45
47
  manimpango/fonts/_font_desc.pyi,sha256=5K3qwRygAb6Am9B7I7mg3HhzxSw66UJR_eAnXTc1hBM,670
46
- manimpango/fonts/_font_desc.pyx,sha256=Asrjra3bMHi8ZA7JGJZxnSoO56RKrNaxxzNv9uynZ3o,3209
47
- manimpango/fonts/enums.c,sha256=YCsEvzYGeJf6uxV0UAIIY4Y7vteyN5K1Sw5w3o4oci0,145914
48
- manimpango/fonts/enums.cp38-win_amd64.pyd,sha256=gEorzWzUnGIaJ5D_5hrijK1xKVtc-8MxCtk7wqWbRkc,25600
48
+ manimpango/fonts/_font_desc.pyx,sha256=XWCfWLoWm3v7RHvfC3cmwj6neD89-40KyiKO9FjCpFM,3386
49
+ manimpango/fonts/enums.c,sha256=m4MsJl-YHIw8pmgDTDRuM1srxTdDnmGyC7rzVL9CsgY,145914
50
+ manimpango/fonts/enums.cp38-win_amd64.pyd,sha256=HLkEPGdvf5vgQdsroFdGhJL8q6Y9X0UVzSk3QqA_8K0,25600
49
51
  manimpango/fonts/enums.pyi,sha256=F39pBJVtL7i74PkPcMScAWTNsprWg421XzBwrcEMR24,390
50
52
  manimpango/fonts/enums.pyx,sha256=3tpHGD28albK5_xrKMxf4xndyCggGGfBZAgtw9umh-E,2305
51
53
  manimpango/include/cairo.pxd,sha256=IhCmKOEvR8xc36M5Q7SzuQpdv1obgoXO9VjASi5QG3E,1369
@@ -53,29 +55,31 @@ manimpango/include/glib.pxd,sha256=-rd7ww83I3unntJ7ZI1NbT25QaoGr7786DqFe5RrY8M,9
53
55
  manimpango/include/pango.pxd,sha256=ZEg-P74BE4nEvcafDldeacEpUUpGt33-QF3ZWbidAMQ,6201
54
56
  manimpango/include/pango_attributes.pxd,sha256=cJwiACUQmIAEk-26d-sKpO28Q4Fbd7V8WKJF44tfm4o,5240
55
57
  manimpango/layout/__init__.py,sha256=TPHpFluM2m8WwmBotcI5Ve6uYx3Y3Z_IvYYmnFlo8FY,7841
56
- manimpango/layout/_layout.c,sha256=qyvn3L-QFQa1cxC7EecQi9JIQMhk3Qv7c3fp0_eZ0V8,360782
57
- manimpango/layout/_layout.cp38-win_amd64.pyd,sha256=lzTCuJ1Wi8VbCpabjeiUw07Yle2SPKDvXQUPd4EidW4,45568
58
+ manimpango/layout/_layout.c,sha256=hFgmtI6Vy0NaelCyt1x84Bq1w8h9bdMwAP9ncxgWZhc,360782
59
+ manimpango/layout/_layout.cp38-win_amd64.pyd,sha256=kaBzHLSjgXbH2rQ_7o911vHNx6EX5C2rIze7xz1_r8I,45568
58
60
  manimpango/layout/_layout.pyx,sha256=BYkon6U7KNmWgkvyxB9HfxncjhyPG2xGGLU0VsbfKd8,1784
61
+ manimpango/layout/layout.pxi,sha256=N902NZq0ILyUnTY43yhP84WBSvQjM3bbCDwMDwStSgE,1389
59
62
  manimpango/renderer/__init__.py,sha256=krRnN0pgAQiyvnabo2Q2dHJgNK9ZpGebW6Al8TD4FIQ,191
60
- manimpango/renderer/image_renderer.c,sha256=e727kH-9CkmE4zcHyuitbfDTkbDinpOc0wfy1k_-yZk,521783
61
- manimpango/renderer/image_renderer.cp38-win_amd64.pyd,sha256=nbHQB1y0Yoj6CmO65iYrh5K9n1miMD5uGemZ5i3qJ84,72704
63
+ manimpango/renderer/cairo_utils.pxi,sha256=J-L17N5tiz87fUthMq-RBFFSU9V0_r2w8XepeFOgK0Q,2603
64
+ manimpango/renderer/image_renderer.c,sha256=a7SxpZuV6MzIxpWEZkKgnfxBCYnOJenyOstlFFUwQ74,521783
65
+ manimpango/renderer/image_renderer.cp38-win_amd64.pyd,sha256=xOmJYTPNMcRyO1oHGlgNvRAnUvhah8BN6NmAuG7wVq0,72704
62
66
  manimpango/renderer/image_renderer.pxd,sha256=vLbnxD-KYaChrXY1w_FB-iiCJ6cE6U2ArpZHkyjuWCQ,560
63
67
  manimpango/renderer/image_renderer.pyi,sha256=zFir_N8OoPaH6Vn7Eov_E-j0J2eJCt50Icw4deC2Mcc,521
64
68
  manimpango/renderer/image_renderer.pyx,sha256=qRzHCSC8QEQFd16yMo9gOTdwiVP4LJjkX7AFXyyWosc,6757
65
- manimpango/renderer/svg_renderer.c,sha256=BhHSEnZ87XTJqaJ6QSOsT-L8tTPMCoF6c7oawdQKh-w,448017
66
- manimpango/renderer/svg_renderer.cp38-win_amd64.pyd,sha256=8a-dKe7Is_ZdTmvvV8DaivYuFLU0oVGleMbEz53JF7Y,61440
69
+ manimpango/renderer/svg_renderer.c,sha256=dSSInF7nYaRqSp-NJ2fZcy5coD6ZClGr4apgkg2V6lU,448017
70
+ manimpango/renderer/svg_renderer.cp38-win_amd64.pyd,sha256=DoHUqJKyzXLxpAFKrcHiU7sMGTbkgLvaFrD8vdDT-0o,61440
67
71
  manimpango/renderer/svg_renderer.pxd,sha256=LcVuCOc4x-8ZR8GLimFLvGG-dxhhcQ3Xx7bFk6wIy1o,562
68
72
  manimpango/renderer/svg_renderer.pyi,sha256=n6NN90qhGQun7Vu1xDgUmYW7rH8PIZ5m-DZHfv4uHBo,418
69
73
  manimpango/renderer/svg_renderer.pyx,sha256=5vf8x88bDDOmlSy62EqO_Dx_dMziujhuv9JtKuIVkic,5284
70
74
  manimpango/utils/__init__.py,sha256=w3VK15PRAEtSnedU9IzOosOi18rCCLDBDs2NPP9_0d0,110
71
- manimpango/utils/_utils.cp38-win_amd64.pyd,sha256=91gYmp--e3veWFggjLmzjizIq6uq_Scvvo3NjsgOda0,21504
75
+ manimpango/utils/_utils.cp38-win_amd64.pyd,sha256=46LGQogyRhJvzfy5JamJ7f2IQ658ol1xyDdsEg1gRk4,21504
72
76
  manimpango/utils/_utils.pyi,sha256=L4bczjAKJTKbq4FZercUiQEnuVOqTXbfePmp8FWbkrc,112
73
- manimpango/utils/utils.c,sha256=oYxip3ikW3Bc5zNEePalxrTgMOKVel4Drdcxh-5jpfU,136649
77
+ manimpango/utils/utils.c,sha256=HWDlkhzD2l0xeNnHSA8E_i4sccYBxjQiQtw3aK1fg9o,136649
74
78
  manimpango/utils/utils.py,sha256=mYBmmr0bLk72bjcPBoD10q5dIBWdI06m9Tm2J-dEXrc,1699
75
79
  manimpango/utils/utils.pyx,sha256=ydDxtOMbqNexX-IzD6ZuFLfwamsmGqSxGKyRkvZ0nsA,658
76
- ManimPango-1.0.0a1.dist-info/LICENSE,sha256=ZB7Op1KnTg-rYuSNFk6dIaWt5fwrfsSWTuJW8Ql55ok,1088
77
- ManimPango-1.0.0a1.dist-info/LICENSE.win32,sha256=XJh88_PtJqmEAfFqLLztbIcxPCJaccrFbz1w6ux-9Zg,163586
78
- ManimPango-1.0.0a1.dist-info/METADATA,sha256=KzdMyTW4h5QJIf9rcxHldKXYTKiCLPrQxPTnvHCVv7c,8600
79
- ManimPango-1.0.0a1.dist-info/WHEEL,sha256=F2aDWtWrilNM3-px1vBtJOEd7aRVTetQfFuDYmYbAUQ,100
80
- ManimPango-1.0.0a1.dist-info/top_level.txt,sha256=_7RXNU2cbck8IbstWHzYv6YV58wtKUDBX-pmUjE6SKs,11
81
- ManimPango-1.0.0a1.dist-info/RECORD,,
80
+ ManimPango-1.0.0a2.dist-info/LICENSE,sha256=ZB7Op1KnTg-rYuSNFk6dIaWt5fwrfsSWTuJW8Ql55ok,1088
81
+ ManimPango-1.0.0a2.dist-info/LICENSE.win32,sha256=XJh88_PtJqmEAfFqLLztbIcxPCJaccrFbz1w6ux-9Zg,163586
82
+ ManimPango-1.0.0a2.dist-info/METADATA,sha256=jpQ6EtG_iXvb9kPdS32XbE2oNGFaf2p06Ds3Zk_JTlk,8600
83
+ ManimPango-1.0.0a2.dist-info/WHEEL,sha256=F2aDWtWrilNM3-px1vBtJOEd7aRVTetQfFuDYmYbAUQ,100
84
+ ManimPango-1.0.0a2.dist-info/top_level.txt,sha256=_7RXNU2cbck8IbstWHzYv6YV58wtKUDBX-pmUjE6SKs,11
85
+ ManimPango-1.0.0a2.dist-info/RECORD,,
manimpango/_version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = "1.0.0a1"
2
+ __version__ = "1.0.0a2"
@@ -0,0 +1,219 @@
1
+ from pango cimport *
2
+ from pango_attributes cimport *
3
+
4
+ from manimpango.attributes import TextAttribute
5
+
6
+
7
+ cdef PangoAttribute* raise_on_null_attr(PangoAttribute* ptr):
8
+ if not ptr:
9
+ raise MemoryError("Could not allocate memory for attribute")
10
+ return ptr
11
+
12
+ cdef set_indexes(PangoAttribute* attr, start_index: int, end_index: int):
13
+ """Sets the start and end indexes of a PangoAttribute.
14
+
15
+ Parameters
16
+ ----------
17
+ attr
18
+ The PangoAttribute to set the indexes for.
19
+ start_index
20
+ The start index.
21
+ end_index
22
+ The end index.
23
+ """
24
+ if start_index is not None:
25
+ attr.start_index = start_index
26
+ if end_index != -1:
27
+ attr.end_index = end_index
28
+
29
+ cdef insert_into_queue(
30
+ GQueue* queue,
31
+ PangoAttribute* attr,
32
+ start_index: int,
33
+ end_index: int,
34
+ ):
35
+ """Inserts a PangoAttribute into a PangoAttrList.
36
+
37
+ Parameters
38
+ ----------
39
+ queue
40
+ The GQueue to insert the attribute into.
41
+ attr
42
+ The PangoAttribute to insert.
43
+ """
44
+ set_indexes(attr, start_index, end_index)
45
+ g_queue_push_tail(queue, attr)
46
+
47
+ cdef GQueue* create_attr_list_for_attribute (
48
+ attr: TextAttribute,
49
+ ):
50
+ """Creates a GQueue from a TextAttribute. The Queue will contain a list
51
+ of PangoAttributes.
52
+
53
+ Multiple PangoAttributes are to be created for a single TextAttribute. That's
54
+ because for a given `start` and `end` index value, the user can set various
55
+ attributes like `color`, `font`, `size`, etc. So, we need to create a
56
+ PangoAttribute for each of these attributes. Finally, we add all these
57
+ PangoAttributes to a Queue and return it.
58
+
59
+ Note: the caller is responsible for freeing the returned GQueue as well as
60
+ the created attributes.
61
+
62
+ Parameters
63
+ ----------
64
+ attr
65
+ The TextAttribute to convert.
66
+ """
67
+ cdef PangoAttribute* pango_attr = NULL
68
+ cdef GQueue* queue = g_queue_new()
69
+ if not queue:
70
+ raise MemoryError("Could not allocate memory for GQueue.")
71
+
72
+ # allow_breaks
73
+ if attr.allow_breaks is not None:
74
+ pango_attr = raise_on_null_attr(
75
+ pango_attr_allow_breaks_new(attr.allow_breaks))
76
+ insert_into_queue(
77
+ queue,
78
+ pango_attr,
79
+ attr.start_index,
80
+ attr.end_index,
81
+ )
82
+
83
+ # background_alpha
84
+ if attr.background_alpha is not None:
85
+ pango_attr = raise_on_null_attr(
86
+ pango_attr_background_alpha_new(attr.background_alpha))
87
+ insert_into_queue(
88
+ queue,
89
+ pango_attr,
90
+ attr.start_index,
91
+ attr.end_index,
92
+ )
93
+
94
+ # background_color
95
+ if attr.background_color is not None:
96
+ pango_attr = raise_on_null_attr(
97
+ pango_attr_background_new(
98
+ attr.background_color[0],
99
+ attr.background_color[1],
100
+ attr.background_color[2],
101
+ ),
102
+ )
103
+ insert_into_queue(
104
+ queue,
105
+ pango_attr,
106
+ attr.start_index,
107
+ attr.end_index,
108
+ )
109
+
110
+ # foreground_alpha
111
+ if attr.foreground_alpha is not None:
112
+ pango_attr = raise_on_null_attr(
113
+ pango_attr_foreground_alpha_new(attr.foreground_alpha))
114
+ insert_into_queue(
115
+ queue,
116
+ pango_attr,
117
+ attr.start_index,
118
+ attr.end_index,
119
+ )
120
+
121
+ # foreground_color
122
+ if attr.foreground_color is not None:
123
+ pango_attr = raise_on_null_attr(
124
+ pango_attr_foreground_new(
125
+ attr.foreground_color[0],
126
+ attr.foreground_color[1],
127
+ attr.foreground_color[2],
128
+ ),
129
+ )
130
+ insert_into_queue(
131
+ queue,
132
+ pango_attr,
133
+ attr.start_index,
134
+ attr.end_index,
135
+ )
136
+
137
+ # fallback
138
+ if attr.fallback is not None:
139
+ pango_attr = raise_on_null_attr(
140
+ pango_attr_fallback_new(attr.fallback))
141
+ insert_into_queue(
142
+ queue,
143
+ pango_attr,
144
+ attr.start_index,
145
+ attr.end_index,
146
+ )
147
+
148
+ # family
149
+ if attr.family is not None:
150
+ pango_attr = raise_on_null_attr(
151
+ pango_attr_family_new(
152
+ attr.family.encode("utf-8")
153
+ ))
154
+ insert_into_queue(
155
+ queue,
156
+ pango_attr,
157
+ attr.start_index,
158
+ attr.end_index,
159
+ )
160
+
161
+ # weight
162
+ if attr.weight is not None:
163
+ pango_attr = raise_on_null_attr(
164
+ pango_attr_weight_new(attr.weight.value))
165
+ insert_into_queue(
166
+ queue,
167
+ pango_attr,
168
+ attr.start_index,
169
+ attr.end_index,
170
+ )
171
+
172
+ # line height
173
+ if attr.line_height is not None:
174
+ pango_attr = raise_on_null_attr(
175
+ pango_attr_line_height_new(attr.line_height))
176
+ insert_into_queue(
177
+ queue,
178
+ pango_attr,
179
+ attr.start_index,
180
+ attr.end_index,
181
+ )
182
+
183
+ return queue
184
+
185
+
186
+ cdef convert_to_pango_attributes(
187
+ attrs: list[TextAttribute],
188
+ PangoAttrList* pango_attr_list
189
+ ):
190
+ """Converts a list of TextAttributes to a PangoAttribute.
191
+
192
+ Note: the caller owns pango_attrlist and is responsible for freeing it.
193
+
194
+ Parameters
195
+ ----------
196
+ attrs
197
+ The list of TextAttributes to convert.
198
+ pango_attrlist
199
+ The PangoAttrList to add the attributes to.
200
+ """
201
+ cdef GQueue* temp_queue = NULL;
202
+ cdef PangoAttribute* temp_attr = NULL;
203
+
204
+ if not pango_attr_list:
205
+ raise ValueError("pango_attr_list must not be NULL.")
206
+
207
+ # Use pango_attr_list_change() to add the attributes to the list.
208
+ for attr in attrs:
209
+ temp_queue = create_attr_list_for_attribute(attr)
210
+ if not temp_queue:
211
+ raise MemoryError("holy shit")
212
+ while not g_queue_is_empty(temp_queue):
213
+ temp_attr = <PangoAttribute*>g_queue_pop_head(temp_queue)
214
+ pango_attr_list_insert(
215
+ pango_attr_list,
216
+ temp_attr
217
+ )
218
+ # Don't free the attribute
219
+ g_queue_free (temp_queue)
manimpango/buffer.pxi ADDED
@@ -0,0 +1,15 @@
1
+ cdef class ImageBuffer:
2
+ cdef unsigned char * data
3
+ cdef int height
4
+ cdef int stride
5
+
6
+ def __getbuffer__(self, Py_buffer *buffer, int flags):
7
+ buffer.buf = self.data
8
+ buffer.format = 'B'
9
+ buffer.len = self.height * self.stride
10
+ buffer.obj = self
11
+ buffer.ndim = 1
12
+ buffer.readonly = 1
13
+
14
+ def __releasebuffer__(self, Py_buffer *buffer):
15
+ pass
manimpango/cmanimpango.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/glib-2.0",
20
+ "C:/cibw/vendor/include/freetype2",
21
21
  "C:/cibw/vendor/include/harfbuzz",
22
- "C:/cibw/vendor/include/pango-1.0",
23
- "C:/cibw/vendor/include",
24
- "C:/cibw/vendor/lib/glib-2.0/include",
25
22
  "C:/cibw/vendor/include/fribidi",
26
- "C:/cibw/vendor/include/freetype2",
23
+ "C:/cibw/vendor/include/glib-2.0",
24
+ "C:/cibw/vendor/lib/glib-2.0/include",
25
+ "C:/cibw/vendor/include/pixman-1",
26
+ "C:/cibw/vendor/include",
27
27
  "C:/cibw/vendor/include/cairo",
28
- "C:/cibw/vendor/include/pixman-1"
28
+ "C:/cibw/vendor/include/pango-1.0"
29
29
  ],
30
30
  "libraries": [
31
+ "pangoft2-1.0",
32
+ "pango-1.0",
31
33
  "harfbuzz",
32
- "Gdi32",
33
- "cairo",
34
34
  "pangocairo-1.0",
35
35
  "gobject-2.0",
36
36
  "glib-2.0",
37
+ "Gdi32",
38
+ "intl",
39
+ "cairo",
37
40
  "freetype",
38
- "fontconfig",
39
- "pangoft2-1.0",
40
- "pango-1.0",
41
- "intl"
41
+ "fontconfig"
42
42
  ],
43
43
  "library_dirs": [
44
44
  "C:/cibw/vendor/lib"
Binary file
manimpango/enums.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/glib-2.0",
20
+ "C:/cibw/vendor/include/freetype2",
21
21
  "C:/cibw/vendor/include/harfbuzz",
22
- "C:/cibw/vendor/include/pango-1.0",
23
- "C:/cibw/vendor/include",
24
- "C:/cibw/vendor/lib/glib-2.0/include",
25
22
  "C:/cibw/vendor/include/fribidi",
26
- "C:/cibw/vendor/include/freetype2",
23
+ "C:/cibw/vendor/include/glib-2.0",
24
+ "C:/cibw/vendor/lib/glib-2.0/include",
25
+ "C:/cibw/vendor/include/pixman-1",
26
+ "C:/cibw/vendor/include",
27
27
  "C:/cibw/vendor/include/cairo",
28
- "C:/cibw/vendor/include/pixman-1"
28
+ "C:/cibw/vendor/include/pango-1.0"
29
29
  ],
30
30
  "libraries": [
31
+ "pangoft2-1.0",
32
+ "pango-1.0",
31
33
  "harfbuzz",
32
- "Gdi32",
33
- "cairo",
34
34
  "pangocairo-1.0",
35
35
  "gobject-2.0",
36
36
  "glib-2.0",
37
+ "Gdi32",
38
+ "intl",
39
+ "cairo",
37
40
  "freetype",
38
- "fontconfig",
39
- "pangoft2-1.0",
40
- "pango-1.0",
41
- "intl"
41
+ "fontconfig"
42
42
  ],
43
43
  "library_dirs": [
44
44
  "C:/cibw/vendor/lib"
Binary file