ManimPango 0.4.3__cp39-cp39-win32.whl → 1.0.0a2__cp39-cp39-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.cp39-win32.pyd +0 -0
  12. manimpango/enums.c +3721 -0
  13. manimpango/enums.cp39-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.cp39-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.cp39-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.cp39-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.cp39-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.cp39-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.cp39-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.cp39-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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ManimPango
3
- Version: 0.4.3
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
@@ -24,7 +24,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
24
24
  Classifier: License :: OSI Approved :: MIT License
25
25
  Classifier: Operating System :: OS Independent
26
26
  Classifier: Programming Language :: Cython
27
- Requires-Python: >=3.7
27
+ Requires-Python: >=3.8
28
28
  Description-Content-Type: text/markdown
29
29
  License-File: LICENSE
30
30
  License-File: LICENSE.win32
@@ -0,0 +1,85 @@
1
+ manimpango/__init__.py,sha256=ELRxGogKS5uPGatJzGmPAaj068ZOO-Sze88nenz4RE8,1153
2
+ manimpango/_distributor_init.py,sha256=z3NAjz5oUeNo6Pbk6zuA9Lfi71rB3ucus0XDpZ3nSrk,1233
3
+ manimpango/_version.py,sha256=Vq7ueDz68EUGVviee7EKuGy1u4lkrTzFM_-KtqwbrfY,50
4
+ manimpango/buffer.pxi,sha256=NklqLNZ0462IL9CpZc9AFG8c1N2ULr6JAURJdhegQng,419
5
+ manimpango/cmanimpango.c,sha256=I70k5es0wpKk27irx7rANAaNUdeVm7L1dQvWWFxCxVs,418073
6
+ manimpango/cmanimpango.cp39-win32.pyd,sha256=fnodAVOFTUTX3q1UpK5kivYgjhVDeM82aLEW3WcqaH4,61440
7
+ manimpango/cmanimpango.pxd,sha256=Apb6qZMqtkL9ldE_nMxVtdsnTH2tkmYt94lrhsB0Qwc,65
8
+ manimpango/cmanimpango.pyx,sha256=f3wr3BpOmIsr1yi7jQsaKv9ntyKyzRWJmbNo8JPLqig,10744
9
+ manimpango/enums.c,sha256=oioIF1_bIhVCfgwMzxU8uWUqUQLb2KagidBxsfgViU4,149445
10
+ manimpango/enums.cp39-win32.pyd,sha256=bkvRKCJgtADJVt6lVHnui36JiCpm0yIo5-ByzLL3BBc,23040
11
+ manimpango/enums.pyx,sha256=5qEKGgt3ueVXJkDKo5f_gyfOcuYCQ_j3sHKuXXkrO14,2370
12
+ manimpango/exceptions.py,sha256=sg8znK3Yr_Qw_BoACd4sS3ZiWLXgsStAi1tmK-9549o,146
13
+ manimpango/register_font.c,sha256=hJ4G1WlNZ1bD-Y7jYOYKsk7MVltjwDzaFa0fLMFM_6w,199324
14
+ manimpango/register_font.cp39-win32.pyd,sha256=pOCautzNcBzkGw5wCDBMShve0c4YsJWioc9YoDSRvDI,31232
15
+ manimpango/register_font.pxd,sha256=8iZpMnQenfTdUUxhNdesi21GeGjHX07pvIWiQom6Jio,1653
16
+ manimpango/register_font.pyx,sha256=H_fe5SLNue6H3vpB01aindxxNQEbtG7jiDhXCk0PZTo,7548
17
+ manimpango/.libs/CORE_MANIM_cairo-2.dll,sha256=gcguaZqS7ELKV1ge1at322p4BtOe3_1Un8xlO70yC9U,753664
18
+ manimpango/.libs/CORE_MANIM_cairo-gobject-2.dll,sha256=wJNHV_0I0hfQI6ejLH68Nx3V4TsoBFLU1XY-OTQZpbA,23040
19
+ manimpango/.libs/CORE_MANIM_cairo-script-interpreter-2.dll,sha256=dpOR0Afc6O89rf8A-vwXz9ByXTqR1vJYTxs-_eThi6k,91136
20
+ manimpango/.libs/CORE_MANIM_expat.dll,sha256=_VAIS-Rv5ktQlv3KheRgIkk8fnL15DKNb_4e6EJLyqU,115712
21
+ manimpango/.libs/CORE_MANIM_ffi-7.dll,sha256=lXk1Gs2PbEsVaQIqOQMG9znfCld7eNIXs8NSo1pwP3A,22016
22
+ manimpango/.libs/CORE_MANIM_fontconfig-1.dll,sha256=hy07QUGCuS32o5AMQoy7yNGxPU1dJ9oYYwG4hp3k2qI,225792
23
+ manimpango/.libs/CORE_MANIM_freetype-6.dll,sha256=5na9-CLo9bXpLnRmhlMg7fvqqMiBaaqZs8P6wY4ueKU,517120
24
+ manimpango/.libs/CORE_MANIM_fribidi-0.dll,sha256=94B9vV9arcywUqF6KF2RvbCaj-lqqOWXn8mp6pJzItI,111616
25
+ manimpango/.libs/CORE_MANIM_gio-2.0-0.dll,sha256=f_hjRyG-TGA7SXX4V5iYdhPcuCheyeMUIbfL-2xsrFU,1235968
26
+ manimpango/.libs/CORE_MANIM_glib-2.0-0.dll,sha256=8P8KAOi4aKsNetE43HyTfx1R9TUOf5r9cFbvT9lWH9Q,1291776
27
+ manimpango/.libs/CORE_MANIM_gmodule-2.0-0.dll,sha256=LLijZJu5D6zRM_O_r0ZRUegu9KLNLIiVtBNCEw_C8Yk,15360
28
+ manimpango/.libs/CORE_MANIM_gobject-2.0-0.dll,sha256=kz_sEFfNBIAzL-oiZ_6vdtxA2pdlVSXMY4FSnSv6eIE,244736
29
+ manimpango/.libs/CORE_MANIM_gthread-2.0-0.dll,sha256=toRgniPdGG8WjlsPUeMGtSXt-gE30Bm6qqIQzwl-INs,9216
30
+ manimpango/.libs/CORE_MANIM_harfbuzz-gobject.dll,sha256=2KtVy4pBEf7KQtor321nT6lTsHoY8QCrD--q-wgXDko,68096
31
+ manimpango/.libs/CORE_MANIM_harfbuzz-subset.dll,sha256=-OQjaM0pofUZENnoVnK7gVtamzoEd_XfWF4IYeXnQCA,585728
32
+ manimpango/.libs/CORE_MANIM_harfbuzz.dll,sha256=DS4kze2N-hIwDQ-ziI1ZAPKK4YWlCCnv3qczDiGPDoA,809984
33
+ manimpango/.libs/CORE_MANIM_intl-8.dll,sha256=hq1CpigY9R_C15GtaE165xUw4Ak7f_gkAFY4FM6yATM,8704
34
+ manimpango/.libs/CORE_MANIM_pango-1.0-0.dll,sha256=uWyw9AJXHs1ALm5FEu2OeaWsvK5LTO7D1tlH6SqEV64,297984
35
+ manimpango/.libs/CORE_MANIM_pangocairo-1.0-0.dll,sha256=l42D4t3U2foWwnZvdfex-hRaskIvsSxYSlYmtuv6WtM,46080
36
+ manimpango/.libs/CORE_MANIM_pangoft2-1.0-0.dll,sha256=IdlSTStPZVtcJcrf3nWJtnwFIw58SVXwaWani2uN1NM,61952
37
+ manimpango/.libs/CORE_MANIM_pangowin32-1.0-0.dll,sha256=AoIotEryhwlIMrE7-hwyPPnhfy5R7WtU6oY3mBDilFM,43520
38
+ manimpango/.libs/CORE_MANIM_pixman-1-0.dll,sha256=81A_FOT4VAjuYqjQD7GKhWXgJwf5k8t_XltiA1SLNJI,570368
39
+ manimpango/.libs/CORE_MANIM_png16-16.dll,sha256=EK-X1ON8Bm4gZvRqgBAMGr6euNEUWmH64UtQvarkOhs,163840
40
+ manimpango/.libs/CORE_MANIM_z.dll,sha256=YuxBjO59t-sQ0-jPE-R8ixNHGXcDghbRxObZ1zd9IIA,74752
41
+ manimpango/attributes/__init__.py,sha256=IqbS6YvnX_5YBcvhhh-jOuqsG26hywrwWxO7rf2eMH4,10777
42
+ manimpango/attributes/attributes.pxi,sha256=o_EAkxTXVQa-GKXmjqjRpyl3rRM2oxqI2B8nGsCPxoY,6298
43
+ manimpango/fonts/__init__.py,sha256=ijgoYEfA6oETMQZlb613YSGc7cAuWPyM9-jxgKMMznA,4142
44
+ manimpango/fonts/_font_desc.c,sha256=JBWffxqT0OSelbMv4dXZgUMwXRG2fCxn3gj_3-0e_ls,306216
45
+ manimpango/fonts/_font_desc.cp39-win32.pyd,sha256=DiAy0Cs5GATuC22ezSD3v5FSiC02mykn0N8V4eftqD4,33792
46
+ manimpango/fonts/_font_desc.pxd,sha256=f7L1fDqWEqeANGliVzPLAabpsNf_S5hYZfYAHbA0Qjw,104
47
+ manimpango/fonts/_font_desc.pyi,sha256=5K3qwRygAb6Am9B7I7mg3HhzxSw66UJR_eAnXTc1hBM,670
48
+ manimpango/fonts/_font_desc.pyx,sha256=XWCfWLoWm3v7RHvfC3cmwj6neD89-40KyiKO9FjCpFM,3386
49
+ manimpango/fonts/enums.c,sha256=yryvG-ZT6qHSDVjw8cm1ij4PiXMQOBeIPjffHJ1X1Ug,145914
50
+ manimpango/fonts/enums.cp39-win32.pyd,sha256=WTegIWc1IcjTdSZlqtX4yZrFx_Z8MpnpkD6GK95-8fc,22016
51
+ manimpango/fonts/enums.pyi,sha256=F39pBJVtL7i74PkPcMScAWTNsprWg421XzBwrcEMR24,390
52
+ manimpango/fonts/enums.pyx,sha256=3tpHGD28albK5_xrKMxf4xndyCggGGfBZAgtw9umh-E,2305
53
+ manimpango/include/cairo.pxd,sha256=IhCmKOEvR8xc36M5Q7SzuQpdv1obgoXO9VjASi5QG3E,1369
54
+ manimpango/include/glib.pxd,sha256=-rd7ww83I3unntJ7ZI1NbT25QaoGr7786DqFe5RrY8M,907
55
+ manimpango/include/pango.pxd,sha256=ZEg-P74BE4nEvcafDldeacEpUUpGt33-QF3ZWbidAMQ,6201
56
+ manimpango/include/pango_attributes.pxd,sha256=cJwiACUQmIAEk-26d-sKpO28Q4Fbd7V8WKJF44tfm4o,5240
57
+ manimpango/layout/__init__.py,sha256=TPHpFluM2m8WwmBotcI5Ve6uYx3Y3Z_IvYYmnFlo8FY,7841
58
+ manimpango/layout/_layout.c,sha256=ecy4ebf5uxiYwzFDc0h3mc6qz4nNC6WMpCzW2TrCxWQ,360782
59
+ manimpango/layout/_layout.cp39-win32.pyd,sha256=kwU9U-P1fJB7SJPYUnUpdTUYbiVPd56EbhbH-8NZc_g,37376
60
+ manimpango/layout/_layout.pyx,sha256=BYkon6U7KNmWgkvyxB9HfxncjhyPG2xGGLU0VsbfKd8,1784
61
+ manimpango/layout/layout.pxi,sha256=N902NZq0ILyUnTY43yhP84WBSvQjM3bbCDwMDwStSgE,1389
62
+ manimpango/renderer/__init__.py,sha256=krRnN0pgAQiyvnabo2Q2dHJgNK9ZpGebW6Al8TD4FIQ,191
63
+ manimpango/renderer/cairo_utils.pxi,sha256=J-L17N5tiz87fUthMq-RBFFSU9V0_r2w8XepeFOgK0Q,2603
64
+ manimpango/renderer/image_renderer.c,sha256=CBEYd4zeh_oU30MCalkPESgjQbBc_32MGlYMveQeN_U,521783
65
+ manimpango/renderer/image_renderer.cp39-win32.pyd,sha256=OCiIVCTdidMPCly95r6MIjomo-qOZqIbFjwwoCTNpnI,60416
66
+ manimpango/renderer/image_renderer.pxd,sha256=vLbnxD-KYaChrXY1w_FB-iiCJ6cE6U2ArpZHkyjuWCQ,560
67
+ manimpango/renderer/image_renderer.pyi,sha256=zFir_N8OoPaH6Vn7Eov_E-j0J2eJCt50Icw4deC2Mcc,521
68
+ manimpango/renderer/image_renderer.pyx,sha256=qRzHCSC8QEQFd16yMo9gOTdwiVP4LJjkX7AFXyyWosc,6757
69
+ manimpango/renderer/svg_renderer.c,sha256=yHIhhJIRcS5W6X6tlvDOG6y5Syyl8Of9amq_jsdQ3LQ,448017
70
+ manimpango/renderer/svg_renderer.cp39-win32.pyd,sha256=GQeFk8xmh1JW5Azlcqlf0ciwS7GgGDhSMmU_HEcFxhk,51712
71
+ manimpango/renderer/svg_renderer.pxd,sha256=LcVuCOc4x-8ZR8GLimFLvGG-dxhhcQ3Xx7bFk6wIy1o,562
72
+ manimpango/renderer/svg_renderer.pyi,sha256=n6NN90qhGQun7Vu1xDgUmYW7rH8PIZ5m-DZHfv4uHBo,418
73
+ manimpango/renderer/svg_renderer.pyx,sha256=5vf8x88bDDOmlSy62EqO_Dx_dMziujhuv9JtKuIVkic,5284
74
+ manimpango/utils/__init__.py,sha256=w3VK15PRAEtSnedU9IzOosOi18rCCLDBDs2NPP9_0d0,110
75
+ manimpango/utils/_utils.cp39-win32.pyd,sha256=ZNDbMYPwtykGyHVCODc5hM4PFtJPjixxYApliKDFpAY,16896
76
+ manimpango/utils/_utils.pyi,sha256=L4bczjAKJTKbq4FZercUiQEnuVOqTXbfePmp8FWbkrc,112
77
+ manimpango/utils/utils.c,sha256=6vFOGF3PXPxhjZWsZFZcoBqLUCKJ09Ko-2TjLbjQZro,136649
78
+ manimpango/utils/utils.py,sha256=mYBmmr0bLk72bjcPBoD10q5dIBWdI06m9Tm2J-dEXrc,1699
79
+ manimpango/utils/utils.pyx,sha256=ydDxtOMbqNexX-IzD6ZuFLfwamsmGqSxGKyRkvZ0nsA,658
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=1aMbN4t2zTDfBHuhuWzAfIzzQesiKpXOWwJmQwUBD2M,96
84
+ ManimPango-1.0.0a2.dist-info/top_level.txt,sha256=_7RXNU2cbck8IbstWHzYv6YV58wtKUDBX-pmUjE6SKs,11
85
+ ManimPango-1.0.0a2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.38.4)
2
+ Generator: bdist_wheel (0.40.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp39-cp39-win32
5
5
 
manimpango/__init__.py CHANGED
@@ -1,19 +1,17 @@
1
1
  # -*- coding: utf-8 -*-
2
- import os
3
2
  import sys
4
3
 
4
+ from . import _distributor_init # noqa: F401
5
5
  from ._version import __version__ # noqa: F403,F401
6
6
 
7
- if os.name == "nt": # pragma: no cover
8
- os.environ["PATH"] = (
9
- f"{os.path.abspath(os.path.dirname(__file__))}"
10
- f"{os.pathsep}"
11
- f"{os.environ['PATH']}"
12
- )
13
7
  try:
8
+ from .attributes import * # noqa: F403,F401
14
9
  from .cmanimpango import * # noqa: F403,F401
15
10
  from .enums import * # noqa: F403,F401
11
+ from .fonts import * # noqa: F403,F401
12
+ from .layout import * # noqa: F403,F401
16
13
  from .register_font import * # noqa: F403,F401
14
+ from .renderer import * # noqa: F403,F401
17
15
  except ImportError as ie: # pragma: no cover
18
16
  py_ver = ".".join(map(str, sys.version_info[:3]))
19
17
  msg = f"""
@@ -0,0 +1,36 @@
1
+ """
2
+ Helper to preload windows dlls to prevent dll not found errors.
3
+ Once a DLL is preloaded, its namespace is made available to any
4
+ subsequent DLL. This file is created as part of the scripts that
5
+ build the wheel.
6
+ """
7
+ import glob
8
+ import os
9
+
10
+ if os.name == "nt":
11
+ # convention for storing / loading the DLL from
12
+ # ManimPango/.libs/, if present
13
+ basedir = os.path.dirname(__file__)
14
+ libs_dir = os.path.abspath(os.path.join(basedir, ".libs"))
15
+
16
+ # first add them to os.add_dll_directory
17
+ try:
18
+ if hasattr(os, "add_dll_directory"):
19
+ libs_dir = os.path.abspath(os.path.join(basedir, ".libs"))
20
+ if os.path.isdir(libs_dir):
21
+ os.add_dll_directory(libs_dir)
22
+ except Exception:
23
+ pass
24
+
25
+ try:
26
+ from ctypes import WinDLL
27
+ except Exception:
28
+ pass
29
+ else:
30
+ DLL_filenames = []
31
+ if os.path.isdir(libs_dir):
32
+ for filename in glob.glob(os.path.join(libs_dir, "*openblas*dll")):
33
+ # NOTE: would it change behavior to load ALL
34
+ # DLLs at this path vs. the name restriction?
35
+ WinDLL(os.path.abspath(filename))
36
+ DLL_filenames.append(filename)
manimpango/_version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = "0.4.3"
2
+ __version__ = "1.0.0a2"
@@ -0,0 +1,324 @@
1
+ # -*- coding: utf-8 -*-
2
+ from __future__ import annotations
3
+
4
+ import typing as T
5
+
6
+ from ..fonts.enums import Weight
7
+ from ..utils import covert_hex_to_rbg
8
+
9
+ __all__ = ["TextAttribute"]
10
+
11
+
12
+ def _parse_color_output(val: T.Union[str, T.Iterable[int]]):
13
+ color_hex = None
14
+ red, green, blue = None, None, None
15
+ if isinstance(val, str):
16
+ color_hex = val
17
+ else:
18
+ if len(val) != 3:
19
+ raise ValueError("Either a Iterable of 3 items or a string must be passed.")
20
+ red, green, blue = val
21
+ if color_hex:
22
+ red, green, blue = covert_hex_to_rbg(color_hex)
23
+ if not ((0 <= red <= 65535) and (0 <= green <= 65535) and (0 <= blue <= 65535)):
24
+ raise ValueError("red, green, blue should be between 0 and 65535.")
25
+ return (red, green, blue)
26
+
27
+
28
+ class TextAttribute:
29
+ """:class:`TextAttribute` defines the properties/attributes of the
30
+ text within a specific range of the text.
31
+
32
+
33
+ A :class:`TextAttribute` object can define multiple properties at
34
+ the same time, for example, it can change the :attr:`background_color`,
35
+ as well as, :attr:`foreground_color`. Also, a :class:`TextAttribute` can
36
+ be used for multiple times for different texts.
37
+ By default, an attribute has an inclusive range from ``0`` to the
38
+ end of the text ``-1``, ie. ``[0, -1]``.
39
+ """
40
+
41
+ def __init__(
42
+ self,
43
+ start_index: int = 0,
44
+ end_index: int = -1,
45
+ *,
46
+ allow_breaks: bool | None = None,
47
+ background_alpha: float | None = None,
48
+ background_color: T.Union[str, T.Iterable[int]] | None = None,
49
+ foreground_alpha: float | None = None,
50
+ foreground_color: T.Union[str, T.Iterable[int]] | None = None,
51
+ fallback: bool | None = None,
52
+ family: str | None = None,
53
+ weight: Weight | None = None,
54
+ line_height: float | None = None,
55
+ ) -> None:
56
+ """Initialize :class:`TextAttribute`.
57
+
58
+ Parameters
59
+ ----------
60
+ start_index : int, optional
61
+ The start index of the range, by default 0 (start of the string).
62
+ end_index : int, optional
63
+ End index of the range. The character at this index is not included
64
+ in the range, by default -1 (end of the string).
65
+ """
66
+ self.start_index = start_index
67
+ self.end_index = end_index
68
+ if allow_breaks:
69
+ self.allow_breaks = allow_breaks
70
+ if background_alpha:
71
+ self.background_alpha = background_alpha
72
+ if background_color:
73
+ self.background_color = background_color
74
+ if foreground_alpha:
75
+ self.foreground_alpha = foreground_alpha
76
+ if foreground_color:
77
+ self.foreground_color = foreground_color
78
+ if fallback:
79
+ self.fallback = fallback
80
+ if family:
81
+ self.family = family
82
+ if weight:
83
+ self.weight = weight
84
+ if line_height:
85
+ self.line_height = line_height
86
+
87
+ @property
88
+ def start_index(self) -> int:
89
+ """It is the end index of the range.
90
+
91
+ Raises
92
+ ------
93
+ ValueError
94
+ If the value is not an :class:`int`.
95
+ """
96
+ return self._start_index
97
+
98
+ @start_index.setter
99
+ def start_index(self, val: int) -> None:
100
+ if not isinstance(val, int):
101
+ raise ValueError("'start_index' should be an int")
102
+ # check if the value is negative
103
+ if val < 0:
104
+ raise ValueError("'start_index' should be a positive int")
105
+ self._start_index = val
106
+
107
+ @property
108
+ def end_index(self) -> int:
109
+ """It is the start of the range. The character at this index is not
110
+ included in the range.
111
+
112
+ Raises
113
+ ------
114
+ ValueError
115
+ If the value is not an :class:`int`.
116
+ """
117
+ return self._end_index
118
+
119
+ @end_index.setter
120
+ def end_index(self, val: int) -> None:
121
+ if not isinstance(val, int):
122
+ raise ValueError("'end_index' should be an int")
123
+ # check if the value is negative
124
+ if val < 0 and val != -1:
125
+ raise ValueError("'end_index' should be a positive int")
126
+ self._end_index = val
127
+
128
+ @property
129
+ def allow_breaks(self) -> T.Union[bool, None]:
130
+ """Whether to break text or not.
131
+
132
+ If breaks are disabled, the range will be kept in a single run,
133
+ as far as possible.
134
+ """
135
+ if hasattr(self, "_allow_breaks"):
136
+ return self._allow_breaks
137
+ return None
138
+
139
+ @allow_breaks.setter
140
+ def allow_breaks(self, val: bool) -> None:
141
+ self._allow_breaks = bool(val)
142
+
143
+ @property
144
+ def background_alpha(self) -> T.Union[float, None]:
145
+ """The background_alpha of the text.
146
+
147
+ Raises
148
+ ------
149
+ ValueError
150
+ If the value is not between 0 and 1.
151
+ """
152
+ if hasattr(self, "_background_alpha"):
153
+ return self._background_alpha
154
+ return None
155
+
156
+ @background_alpha.setter
157
+ def background_alpha(self, val: float) -> None:
158
+ if not (0 <= val <= 1):
159
+ raise ValueError("'val' should be between 0 and 1")
160
+ self._background_alpha = val
161
+
162
+ @property
163
+ def background_color(self) -> T.Union[T.Tuple[int], None]:
164
+ """The background color of the region.
165
+
166
+ If the input is a :class:`str` the value is considered as
167
+ string representation of color from
168
+ `CSS Specification <https://www.w3.org/TR/css-color-4/#named-colors>`_.
169
+ The color is then parsed and :class:`ValueError` is raised
170
+ if the color is invalid.
171
+
172
+ If the input is a :class:`collections.abc.Iterable` then the items
173
+ in them are parsed in the order of ``red, green, blue`` and checked
174
+ whether they are valid (between 0 and 65535).
175
+
176
+
177
+ Returns either ``None`` or a :class:`tuple` with 3 elements
178
+ representing red, green, blue respectively. The value of each
179
+ items in that tuple ranges from 0 to 65535.
180
+
181
+ Raises
182
+ ------
183
+ ValueError
184
+ If the value passed isn't a :class:`collections.abc.Iterable` of 3
185
+ elements or a string. Another condition when `ValueError` is
186
+ raised is when the color passed is invalid.
187
+
188
+ """
189
+ if hasattr(self, "_background_color"):
190
+ return self._background_color
191
+ return None
192
+
193
+ @background_color.setter
194
+ def background_color(self, val: T.Union[str, T.Iterable[int]]) -> None:
195
+ self._background_color = _parse_color_output(val)
196
+
197
+ @property
198
+ def foreground_alpha(self) -> T.Union[float, None]:
199
+ """The foreground_alpha of the text.
200
+
201
+ Raises
202
+ ------
203
+ ValueError
204
+ If the value is not between 0 and 1.
205
+ """
206
+ if hasattr(self, "_foreground_alpha"):
207
+ return self._foreground_alpha
208
+ return None
209
+
210
+ @foreground_alpha.setter
211
+ def foreground_alpha(self, val: float) -> None:
212
+ if not (0 <= val <= 1):
213
+ raise ValueError("'val' should be between 0 and 1")
214
+ self._foreground_alpha = val
215
+
216
+ @property
217
+ def foreground_color(self) -> T.Union[T.Tuple[int], None]:
218
+ """The foreground color attribute.
219
+
220
+ If the input is a :class:`str` the value is considered as
221
+ string representation of color from
222
+ `CSS Specification <https://www.w3.org/TR/css-color-4/#named-colors>`_.
223
+ The color is then parsed and :class:`ValueError` is raised
224
+ if the color is invalid.
225
+
226
+ If the input is a :class:`collections.abc.Iterable` then the items
227
+ in them are parsed in the order of ``red, green, blue`` and checked
228
+ whether they are valid (between 0 and 65535).
229
+
230
+
231
+ Returns either ``None`` or a :class:`tuple` with 3 elements
232
+ representing red, green, blue respectively. The value of each
233
+ items in that tuple ranges from 0 to 65535.
234
+
235
+ Raises
236
+ ------
237
+ ValueError
238
+ If the value passed isn't a :class:`collections.abc.Iterable` of 3
239
+ elements or a string. Another condition when `ValueError` is
240
+ raised is when the color passed is invalid.
241
+
242
+ """
243
+ if hasattr(self, "_foreground_color"):
244
+ return self._foreground_color
245
+ return None
246
+
247
+ @foreground_color.setter
248
+ def foreground_color(self, val: T.Union[str, T.Iterable[int]]) -> None:
249
+ self._foreground_color = _parse_color_output(val)
250
+
251
+ @property
252
+ def fallback(self) -> bool:
253
+ """Enable or disable fallbacks.
254
+
255
+ If fallback is disabled, characters will only be used from the
256
+ closest matching font on the system. No fallback will be done to
257
+ other fonts on the system that might contain the characters in
258
+ the text.
259
+ """
260
+ if hasattr(self, "_fallback"):
261
+ return self._fallback
262
+ return None
263
+
264
+ @fallback.setter
265
+ def fallback(self, val: bool) -> None:
266
+ self._fallback = bool(val)
267
+
268
+ @property
269
+ def family(self) -> T.Union[str, None]:
270
+ """The font family the text should render. Can be a comma seperated
271
+ list of fonts in a string.
272
+
273
+ Raises
274
+ ------
275
+ ValueError
276
+ If value isn't a str.
277
+ """
278
+ if hasattr(self, "_family"):
279
+ return self._family
280
+ return None
281
+
282
+ @family.setter
283
+ def family(self, val: str) -> None:
284
+ if not isinstance(val, str):
285
+ raise ValueError("'family' must be a string")
286
+ self._family = val
287
+
288
+ @property
289
+ def weight(self) -> T.Union[Weight, None]:
290
+ """The font weight of the text.
291
+
292
+ Raises
293
+ ------
294
+ ValueError
295
+ If value isn't a str.
296
+ """
297
+ if hasattr(self, "_weight"):
298
+ return self._weight
299
+ return None
300
+
301
+ @weight.setter
302
+ def weight(self, val: Weight) -> None:
303
+ if not isinstance(val, Weight):
304
+ raise ValueError("'weight' must be a Weight")
305
+ self._weight = val
306
+
307
+ @property
308
+ def line_height(self) -> T.Union[float, None]:
309
+ """The line height of the text.
310
+
311
+ Raises
312
+ ------
313
+ ValueError
314
+ If value isn't a float.
315
+ """
316
+ if hasattr(self, "_line_height"):
317
+ return self._line_height
318
+ return None
319
+
320
+ @line_height.setter
321
+ def line_height(self, val: float) -> None:
322
+ if not isinstance(val, float):
323
+ raise ValueError("'line_height' must be a float")
324
+ self._line_height = val