ManimPango 0.4.3__cp39-cp39-win_amd64.whl → 1.0.0a2__cp39-cp39-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 (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-win_amd64.pyd +0 -0
  12. manimpango/enums.c +3721 -0
  13. manimpango/enums.cp39-win_amd64.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-win_amd64.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-win_amd64.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-win_amd64.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-win_amd64.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-win_amd64.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-win_amd64.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-win_amd64.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=63UNUSD2u4AFXxdIYsNK9PLzRCJXlclnUk3MDlHCFjc,418073
6
+ manimpango/cmanimpango.cp39-win_amd64.pyd,sha256=aNMvuHHe8OCKM78Qjdu5OXPwXJRbmC4_KHCNo89du6A,73728
7
+ manimpango/cmanimpango.pxd,sha256=Apb6qZMqtkL9ldE_nMxVtdsnTH2tkmYt94lrhsB0Qwc,65
8
+ manimpango/cmanimpango.pyx,sha256=f3wr3BpOmIsr1yi7jQsaKv9ntyKyzRWJmbNo8JPLqig,10744
9
+ manimpango/enums.c,sha256=25snfoX1sJVBRVmbaWSNzMI-aGAw5GHXBaLwIPA4Iz8,149445
10
+ manimpango/enums.cp39-win_amd64.pyd,sha256=YjF865G4pqpNTcBsPUXMEkejKdPP_4JzDEjKQpgsLwk,26112
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=YvUK6gK2tR-dCTgvhikBqapUuHZoy5w3gbEDnG9BNNw,199324
14
+ manimpango/register_font.cp39-win_amd64.pyd,sha256=L1kmgdeWFWAPJSSOH5ODRXRwZPe2bxl9jCwjZyM7u7g,36352
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=lttR5-2wVg3Y66a3wa-xOVB8gMPD3Vi1jMT0v7yEXhE,906240
18
+ manimpango/.libs/CORE_MANIM_cairo-gobject-2.dll,sha256=TtDtutnPozNTT2uzhL40jnSzTXTwQTT1jMywiVdVlzY,27136
19
+ manimpango/.libs/CORE_MANIM_cairo-script-interpreter-2.dll,sha256=KnfNrOIt9l7jhs1QdxwKR8I-ugBVmg7Cq18Z9cobnB8,132608
20
+ manimpango/.libs/CORE_MANIM_expat.dll,sha256=caYNgwGfvmPdRf70408MgSfspUKHqZlJXA0qLup6gKk,139776
21
+ manimpango/.libs/CORE_MANIM_ffi-7.dll,sha256=-AR4rzhVy4_omlrrDC_c_mxaAsj286a2_2qRpz4NF88,27136
22
+ manimpango/.libs/CORE_MANIM_fontconfig-1.dll,sha256=cyYH5II1gEyAA8UXjokHvvjB6XsoHxUGRPgccciZSIU,280576
23
+ manimpango/.libs/CORE_MANIM_freetype-6.dll,sha256=8wRw5DsluMR6qHuCjL-2UCBWnXjI6c72DgaAgrnwK6U,634368
24
+ manimpango/.libs/CORE_MANIM_fribidi-0.dll,sha256=wh0pMSYG85i0so1zYcKBxrvCE5Mb5wVxdbnyBEk5qbI,117760
25
+ manimpango/.libs/CORE_MANIM_gio-2.0-0.dll,sha256=VdsvhRL1qBOX8BGxcJ6X4uPbwyw-LIy1fh16hmVCaz8,1587712
26
+ manimpango/.libs/CORE_MANIM_glib-2.0-0.dll,sha256=vH1rnJXFTarQVoHEpBk7B1HBYwZhJ0did3Ce-Y-Qbl0,1501696
27
+ manimpango/.libs/CORE_MANIM_gmodule-2.0-0.dll,sha256=rFkuuKqoHHjDNUOvIxXTgnpMdLqX1x3I_cQ2QtcqFmE,18432
28
+ manimpango/.libs/CORE_MANIM_gobject-2.0-0.dll,sha256=yORytG1ldqLOxHDH1O-pfNIyj21giXgdmfbbXgSuQeo,301056
29
+ manimpango/.libs/CORE_MANIM_gthread-2.0-0.dll,sha256=uX7L-UUZ7NFBORorYsx806n7Lo4JvXeuiW2Xp2z8fxE,10752
30
+ manimpango/.libs/CORE_MANIM_harfbuzz-gobject.dll,sha256=G_-KeQ40hg1TePxKe0QF8FPO8AWe4H3chVjD_aSKJmk,81920
31
+ manimpango/.libs/CORE_MANIM_harfbuzz-subset.dll,sha256=ugpKOB9wTg8r3eDshdqRw4ZJe3UuIU6LI4uLnpsGARQ,711680
32
+ manimpango/.libs/CORE_MANIM_harfbuzz.dll,sha256=se0KeSQ_Au9jq1lxuOoAQNFM_SMmiUKTMMtSnQVKxxk,904192
33
+ manimpango/.libs/CORE_MANIM_intl-8.dll,sha256=WHJBXbqfjBKCjhbUv6kbqMfUbJkGhjRM8MRklfjpQ_0,10240
34
+ manimpango/.libs/CORE_MANIM_pango-1.0-0.dll,sha256=vULIkx2V0loztNrRCgFzyD5AkgB0SV65-kaUq9onKy8,357376
35
+ manimpango/.libs/CORE_MANIM_pangocairo-1.0-0.dll,sha256=mLuUzIIUeVPh6PSVIYVaG2RlODeXF_V7rddhZHGiaX4,53760
36
+ manimpango/.libs/CORE_MANIM_pangoft2-1.0-0.dll,sha256=VNnK5EvPFYIh92iKCzy07SjxkhhQv2SV2PZ4-Epag1c,76800
37
+ manimpango/.libs/CORE_MANIM_pangowin32-1.0-0.dll,sha256=dZBf-P9twhp7otB-TauGS36MnnDAj-w4Rl-SUfQQmxo,54272
38
+ manimpango/.libs/CORE_MANIM_pixman-1-0.dll,sha256=UBZ080EGrc4NYRzRRwwKbzmfGxykSGfKnmjYtJ2jm9k,586752
39
+ manimpango/.libs/CORE_MANIM_png16-16.dll,sha256=3doABQ79VhdEmLh71UQbhhfdjWJmQN9YTz_BSkXlihc,195072
40
+ manimpango/.libs/CORE_MANIM_z.dll,sha256=gFJNdWYIKc5V8MCHCYIK-Z95st0LEQuvDFH_z1F8edE,86528
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=TM7YBRCxaua213KTVFHoxqeQfZdP2Zm6-8pUZAWTEAo,306216
45
+ manimpango/fonts/_font_desc.cp39-win_amd64.pyd,sha256=2IkKgCxS-_lg5wO-BFvyLQZaM_9X_9vhdZVTBe7jehA,41984
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=m4MsJl-YHIw8pmgDTDRuM1srxTdDnmGyC7rzVL9CsgY,145914
50
+ manimpango/fonts/enums.cp39-win_amd64.pyd,sha256=ChiG1aHxFz_7LCjIT7bzibHNwhPvb-GrTL-xo1kNi_g,25600
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=hFgmtI6Vy0NaelCyt1x84Bq1w8h9bdMwAP9ncxgWZhc,360782
59
+ manimpango/layout/_layout.cp39-win_amd64.pyd,sha256=StLWXVbmnA6n6QCfnMO7_cG6HqqWbI9XLLMf5MeMjTA,45568
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=a7SxpZuV6MzIxpWEZkKgnfxBCYnOJenyOstlFFUwQ74,521783
65
+ manimpango/renderer/image_renderer.cp39-win_amd64.pyd,sha256=d4K2DQnvseDx53gICZCccZbcoAcd90E-4QrCnACOmfY,72704
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=dSSInF7nYaRqSp-NJ2fZcy5coD6ZClGr4apgkg2V6lU,448017
70
+ manimpango/renderer/svg_renderer.cp39-win_amd64.pyd,sha256=iSl65hBOtdQd63vF8m7Nl5qhOY3EGlVutLyz6Lz1G8A,61440
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-win_amd64.pyd,sha256=ytUjwRWy44jHtyJPPLaz8AyK-dI7Rykh19t3ZV1sA80,21504
76
+ manimpango/utils/_utils.pyi,sha256=L4bczjAKJTKbq4FZercUiQEnuVOqTXbfePmp8FWbkrc,112
77
+ manimpango/utils/utils.c,sha256=HWDlkhzD2l0xeNnHSA8E_i4sccYBxjQiQtw3aK1fg9o,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=eep6QWEFiQfg2wcclssb_WY-D33AnLYLnEKGA9Rn-VU,100
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-win_amd64
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