ManimPango 0.5.0__tar.gz → 0.6.1__tar.gz

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 (58) hide show
  1. {ManimPango-0.5.0 → manimpango-0.6.1}/MANIFEST.in +3 -2
  2. manimpango-0.6.1/ManimPango.egg-info/PKG-INFO +218 -0
  3. {ManimPango-0.5.0 → manimpango-0.6.1}/ManimPango.egg-info/SOURCES.txt +10 -2
  4. manimpango-0.6.1/PKG-INFO +218 -0
  5. {ManimPango-0.5.0 → manimpango-0.6.1}/README.md +3 -10
  6. {ManimPango-0.5.0 → manimpango-0.6.1}/docs/reference.rst +2 -0
  7. {ManimPango-0.5.0 → manimpango-0.6.1}/manimpango/__init__.py +1 -1
  8. ManimPango-0.5.0/manimpango/register_font.pxd → manimpango-0.6.1/manimpango/_register_font.pxd +8 -1
  9. manimpango-0.6.1/manimpango/_register_font.pyx +160 -0
  10. {ManimPango-0.5.0 → manimpango-0.6.1}/manimpango/_version.py +1 -1
  11. {ManimPango-0.5.0 → manimpango-0.6.1}/manimpango/cmanimpango.pyx +15 -0
  12. {ManimPango-0.5.0 → manimpango-0.6.1}/manimpango/pango.pxd +33 -0
  13. manimpango-0.6.1/manimpango/register_font.py +156 -0
  14. manimpango-0.6.1/manimpango/utils.pxi +23 -0
  15. {ManimPango-0.5.0 → manimpango-0.6.1}/pyproject.toml +1 -1
  16. {ManimPango-0.5.0 → manimpango-0.6.1}/requirements-dev.txt +2 -2
  17. {ManimPango-0.5.0 → manimpango-0.6.1}/setup.py +12 -8
  18. manimpango-0.6.1/tests/cases/color_red.svg +31 -0
  19. manimpango-0.6.1/tests/cases/hello_blue_world_green.svg +47 -0
  20. manimpango-0.6.1/tests/cases/hello_blue_world_green_space.svg +53 -0
  21. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/test_fonts.py +9 -3
  22. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/test_version.py +2 -2
  23. ManimPango-0.5.0/ManimPango.egg-info/PKG-INFO +0 -211
  24. ManimPango-0.5.0/PKG-INFO +0 -211
  25. ManimPango-0.5.0/manimpango/register_font.pyx +0 -241
  26. {ManimPango-0.5.0 → manimpango-0.6.1}/.coveragerc +0 -0
  27. {ManimPango-0.5.0 → manimpango-0.6.1}/CODE_OF_CONDUCT.md +0 -0
  28. {ManimPango-0.5.0 → manimpango-0.6.1}/LICENSE +0 -0
  29. {ManimPango-0.5.0 → manimpango-0.6.1}/ManimPango.egg-info/dependency_links.txt +0 -0
  30. {ManimPango-0.5.0 → manimpango-0.6.1}/ManimPango.egg-info/not-zip-safe +0 -0
  31. {ManimPango-0.5.0 → manimpango-0.6.1}/ManimPango.egg-info/top_level.txt +0 -0
  32. {ManimPango-0.5.0 → manimpango-0.6.1}/docs/RELEASE.rst +0 -0
  33. {ManimPango-0.5.0 → manimpango-0.6.1}/docs/_static/favicon.ico +0 -0
  34. {ManimPango-0.5.0 → manimpango-0.6.1}/docs/_templates/autosummary/class.rst +0 -0
  35. {ManimPango-0.5.0 → manimpango-0.6.1}/docs/_templates/autosummary/module.rst +0 -0
  36. {ManimPango-0.5.0 → manimpango-0.6.1}/docs/conf.py +0 -0
  37. {ManimPango-0.5.0 → manimpango-0.6.1}/docs/index.rst +0 -0
  38. {ManimPango-0.5.0 → manimpango-0.6.1}/docs/make.bat +0 -0
  39. {ManimPango-0.5.0 → manimpango-0.6.1}/manimpango/cairo.pxd +0 -0
  40. {ManimPango-0.5.0 → manimpango-0.6.1}/manimpango/cmanimpango.pxd +0 -0
  41. {ManimPango-0.5.0 → manimpango-0.6.1}/manimpango/enums.pyx +0 -0
  42. {ManimPango-0.5.0 → manimpango-0.6.1}/manimpango/glib.pxd +0 -0
  43. {ManimPango-0.5.0 → manimpango-0.6.1}/manimpango/utils.py +0 -0
  44. {ManimPango-0.5.0 → manimpango-0.6.1}/setup.cfg +0 -0
  45. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/__init__.py +0 -0
  46. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/_manim.py +0 -0
  47. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/conftest.py +0 -0
  48. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/fonts/AdobeVFPrototype.ttf +0 -0
  49. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/fonts/BungeeColor-Regular_colr_Windows.ttf +0 -0
  50. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/fonts/BungeeOutline-Regular.ttf +0 -0
  51. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/fonts/LICENSE.txt +0 -0
  52. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/fonts/MaShanZheng-Regular.ttf +0 -0
  53. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/svg_tester.py +0 -0
  54. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/test_colors.py +0 -0
  55. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/test_list_fonts.py +0 -0
  56. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/test_markup.py +0 -0
  57. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/test_utils.py +0 -0
  58. {ManimPango-0.5.0 → manimpango-0.6.1}/tests/test_valid_svg.py +0 -0
@@ -1,8 +1,9 @@
1
- global-include *.pyx *.pxd
2
- recursive-include tests *.py *.ttf LICENSE.txt
1
+ global-include *.pyx *.pxd *.pxi
2
+ recursive-include tests *.py *.ttf LICENSE.txt *.svg
3
3
  recursive-include docs *.rst *.py make* _*/*
4
4
  prune docs/_build
5
5
  include *.md
6
6
  include *.txt
7
7
  include .coveragerc
8
8
  include LICENSE*
9
+ prune *env*/
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.4
2
+ Name: ManimPango
3
+ Version: 0.6.1
4
+ Summary: Bindings for Pango for using with Manim.
5
+ Home-page: https://manimpango.manim.community/
6
+ Author: Naveen M K
7
+ Author-email: naveen@manim.community
8
+ Maintainer: The Manim Community Developers
9
+ License: MIT
10
+ Project-URL: Documentation, https://manimpango.manim.community/
11
+ Project-URL: Source, https://github.com/ManimCommunity/manimpango
12
+ Project-URL: Release notes, https://github.com/ManimCommunity/ManimPango/releases/
13
+ Keywords: cython,pango,cairo,manim
14
+ Platform: Linux
15
+ Platform: macOS
16
+ Platform: Windows
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Development Status :: 4 - Beta
25
+ Classifier: Programming Language :: Python :: 3 :: Only
26
+ Classifier: Programming Language :: Cython
27
+ Requires-Python: >=3.8
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Dynamic: author
31
+ Dynamic: author-email
32
+ Dynamic: classifier
33
+ Dynamic: description
34
+ Dynamic: description-content-type
35
+ Dynamic: home-page
36
+ Dynamic: keywords
37
+ Dynamic: license
38
+ Dynamic: license-file
39
+ Dynamic: maintainer
40
+ Dynamic: platform
41
+ Dynamic: project-url
42
+ Dynamic: requires-python
43
+ Dynamic: summary
44
+
45
+ # ManimPango
46
+
47
+ <p align="center">
48
+ <a href="https://pypi.org/project/manimpango/"><img src="https://img.shields.io/pypi/v/manimpango.svg?style=flat&logo=pypi" alt="PyPI Latest Release"></a>
49
+ <a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Wheel" src="https://img.shields.io/pypi/wheel/manimpango"></a>
50
+ <a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/manimpango"></a>
51
+ <a href="https://choosealicense.com/licenses/mit/"><img alt="PyPI - License" src="https://img.shields.io/pypi/l/manimpango"></a>
52
+ <a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/ManimPango.svg?style=flat"></a>
53
+ <a href='https://manimpango.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/manimpango/badge/?version=latest' alt='Documentation Status' /></a>
54
+ <br>
55
+ <img src="https://github.com/ManimCommunity/manimpango/workflows/Build%20Wheels/badge.svg">
56
+ </p>
57
+
58
+ **ManimPango** is a C binding for [Pango](https://pango.gnome.org/) using [Cython](https://cython.org/), which is internally used in [Manim](https://www.manim.community) to render (non-LaTeX) text.
59
+
60
+
61
+
62
+ ## INSTALL
63
+
64
+ Installing **ManimPango** is super easy, just use `pip`. It is [`manimpango`](https://pypi.org/project/manimpango/) in PyPi.
65
+
66
+ ```sh
67
+ pip install manimpango
68
+ ```
69
+
70
+ For **Linux Users**, there are no Wheels. You must have a C compiler as well as **Pango** and its dependencies along with the **Pango** development headers. See [BUILDING](#BUILDING) for more information.
71
+
72
+ ## WORKFLOW SETUP / CONTRIBUTING
73
+
74
+ To make it easier for developers to contribute, we have a pre-commit workflow that will check for `black` formatting and `flake` checking.
75
+
76
+ ```sh
77
+ pip install pre-commit
78
+ pre-commit install
79
+ ```
80
+
81
+ ## BUILDING
82
+
83
+ ### Linux/MacOS
84
+
85
+ For building **ManimPango**, you need
86
+ * a C compiler
87
+ * Python's development headers
88
+ * [`pkg-config`](https://www.freedesktop.org/wiki/Software/pkg-config/)
89
+ * [Pango](https://pango.gnome.org) along with its development headers and its dependencies.
90
+
91
+ If you are on MacOS, you can use [brew](https://brew.sh) to install those. Using [MacPorts](https://www.macports.org) is also possible.
92
+
93
+ ```sh
94
+ brew install pango pkg-config
95
+ ```
96
+
97
+ If you are on Linux, you can use a system package manager to do so. For example, if you are on Debian based system, you can use `apt`
98
+
99
+ ```sh
100
+ apt install libpango1.0-dev pkg-config python3-dev
101
+ ```
102
+
103
+ **Arch Linux:** `pacman -S pango pkgconf`
104
+
105
+ **Fedora:** `dnf install pango-devel pkg-config python3-devel`
106
+
107
+ Or similar in your system's package manager.
108
+
109
+ #### Using `tar` archives
110
+
111
+ If you don't want to contribute to this repository, you can use the tar archives published in PyPi, or just use `pip` to install using
112
+
113
+ ```sh
114
+ pip install manimpango --no-binary :all:
115
+ ```
116
+
117
+ **Note**: `pip` by default uses wheels, so make sure to pass the `--no-binary` parameter.
118
+
119
+ #### Using `git` clones / Contributing
120
+
121
+ Please remember to do this inside your virtual environment, if you want to use your **Manimpango** with **Manim**.
122
+
123
+ ```sh
124
+ python -m venv ./venv
125
+ source venv/bin/activate # Linux/macOS
126
+ venv\Scripts\activate # Windows
127
+ ```
128
+
129
+ If you are using a clone of this repository, you will need [Cython](https://cython.org) which can be easily installed using `pip`:
130
+
131
+ ```sh
132
+ pip install Cython
133
+ ```
134
+
135
+ After that you can use `pip` to install the clone with the following command:
136
+
137
+ ```sh
138
+ pip install -e .
139
+ pip install -r requirements-dev.txt .
140
+ ```
141
+
142
+ Next, run the setup script:
143
+
144
+ ```sh
145
+ python setup.py build_ext -i
146
+ ```
147
+
148
+ After installation is complete, you should be able to run pytest:
149
+
150
+ ```sh
151
+ pytest
152
+ ```
153
+
154
+ You will need to this way if you want to *contribute* to **ManimPango**.
155
+
156
+ ### Contributing with Windows
157
+
158
+ *If you are a normal user, don't read this, you have wheels which you can just install directly using pip.*
159
+
160
+ If you want to contribute to **ManimPango** and you are on Windows, this section is for you.
161
+
162
+ As Windows does not include a C compiler by default, you will first need to install one. You have two choices:
163
+
164
+ 1. MinGW/Msys2
165
+
166
+ 2. Visual Studio
167
+
168
+ #### MinGW/Msys2
169
+
170
+ 1. Download **MSYS2** from the download link provided on their page https://www.msys2.org/#installation and install it according to their instructions.
171
+ 2. Once you have **MSYS2** installed, it offers you three different shells: the **MinGW32** shell, the **MinGW64** shell and **MSYS** shell. In order for the following steps to work, you have to open the **MSYS2 MinGW64** shell (you can search for this). Small hint: it has a blue color logo.
172
+ 3. Run the following commands to install Python, Pango, Cython, Numpy, Scipy, Pillow, Pycairo and ffmpeg
173
+ ```sh
174
+ pacman -S mingw-w64-x86_64-python
175
+ pacman -S mingw-w64-x86_64-python-pip
176
+ pacman -S mingw-w64-x86_64-pango
177
+ pacman -S mingw-w64-x86_64-cython
178
+ pacman -S mingw-w64-x86_64-python-numpy
179
+ pacman -S mingw-w64-x86_64-python-scipy
180
+ pacman -S mingw-w64-x86_64-python-pillow
181
+ pacman -S mingw-w64-x86_64-python-cairo
182
+ pacman -S mingw-w64-x86_64-ffmpeg
183
+ ```
184
+ 4. Still in the same shell, install **Manim** using `pip install manim`.
185
+ 5. Finally, get your clone of **ManimPango**, `cd` into that directory and then run `pip install -e .`.
186
+ **Note** You can't use it with your regular Python version. It will cause weird errors if you do so. For working with **ManimPango**, you must be inside the `MSYS2 MINGW64 shell`.
187
+ 6. You can then use `manim` inside that shell, to run **Manim**.
188
+ **Hint**: If you want to try out Python interactively, you can open `idle` using the command `python -m idlelib` inside that shell.
189
+
190
+ #### Visual Studio
191
+
192
+ First, install Visual Studio as specified in https://wiki.python.org/moin/WindowsCompilers. Possibly Visual Studio Build Tools 2022 with Windows10 SDK.
193
+
194
+ Then run the script at `packing/download_dlls.py`. This will get a **Pango** build along with `pkg-config` and install it at `C:\cibw\vendor`. Add `C:\cibw\vendor\bin` to PATH.
195
+
196
+ **Note:** You can change the install location by editing line 24 of the file `packing/download_dlls.py`.
197
+
198
+ Then set an environment variable `PKG_CONFIG_PATH`=`C:\cibw\vendor\lib\pkgconfig`.
199
+
200
+ Then you can install Cython using
201
+
202
+ ```sh
203
+ pip install Cython
204
+ ```
205
+
206
+ Finally, you can install your local **ManimPango** clone just like any other python package by typing:
207
+
208
+ ```sh
209
+ pip install .
210
+ ```
211
+
212
+ ## Code of Conduct
213
+
214
+ Our full code of conduct, and how we enforce it, can be read on [our website](https://docs.manim.community/en/latest/conduct.html).
215
+
216
+ ## License
217
+
218
+ This project is licensed under MIT License. The wheels distributed on PyPI contains compiled version of Pango and Cairo subject to terms of the GNU LGPL and other licenses. Consult the licenses of each library for more informations.
@@ -7,6 +7,9 @@ pyproject.toml
7
7
  requirements-dev.txt
8
8
  setup.cfg
9
9
  setup.py
10
+ /home/runner/work/ManimPango/ManimPango/manimpango/_register_font.c
11
+ /home/runner/work/ManimPango/ManimPango/manimpango/cmanimpango.c
12
+ /home/runner/work/ManimPango/ManimPango/manimpango/enums.c
10
13
  ManimPango.egg-info/PKG-INFO
11
14
  ManimPango.egg-info/SOURCES.txt
12
15
  ManimPango.egg-info/dependency_links.txt
@@ -21,6 +24,8 @@ docs/_static/favicon.ico
21
24
  docs/_templates/autosummary/class.rst
22
25
  docs/_templates/autosummary/module.rst
23
26
  manimpango/__init__.py
27
+ manimpango/_register_font.pxd
28
+ manimpango/_register_font.pyx
24
29
  manimpango/_version.py
25
30
  manimpango/cairo.pxd
26
31
  manimpango/cmanimpango.pxd
@@ -28,8 +33,8 @@ manimpango/cmanimpango.pyx
28
33
  manimpango/enums.pyx
29
34
  manimpango/glib.pxd
30
35
  manimpango/pango.pxd
31
- manimpango/register_font.pxd
32
- manimpango/register_font.pyx
36
+ manimpango/register_font.py
37
+ manimpango/utils.pxi
33
38
  manimpango/utils.py
34
39
  tests/__init__.py
35
40
  tests/_manim.py
@@ -42,6 +47,9 @@ tests/test_markup.py
42
47
  tests/test_utils.py
43
48
  tests/test_valid_svg.py
44
49
  tests/test_version.py
50
+ tests/cases/color_red.svg
51
+ tests/cases/hello_blue_world_green.svg
52
+ tests/cases/hello_blue_world_green_space.svg
45
53
  tests/fonts/AdobeVFPrototype.ttf
46
54
  tests/fonts/BungeeColor-Regular_colr_Windows.ttf
47
55
  tests/fonts/BungeeOutline-Regular.ttf
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.4
2
+ Name: ManimPango
3
+ Version: 0.6.1
4
+ Summary: Bindings for Pango for using with Manim.
5
+ Home-page: https://manimpango.manim.community/
6
+ Author: Naveen M K
7
+ Author-email: naveen@manim.community
8
+ Maintainer: The Manim Community Developers
9
+ License: MIT
10
+ Project-URL: Documentation, https://manimpango.manim.community/
11
+ Project-URL: Source, https://github.com/ManimCommunity/manimpango
12
+ Project-URL: Release notes, https://github.com/ManimCommunity/ManimPango/releases/
13
+ Keywords: cython,pango,cairo,manim
14
+ Platform: Linux
15
+ Platform: macOS
16
+ Platform: Windows
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Development Status :: 4 - Beta
25
+ Classifier: Programming Language :: Python :: 3 :: Only
26
+ Classifier: Programming Language :: Cython
27
+ Requires-Python: >=3.8
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Dynamic: author
31
+ Dynamic: author-email
32
+ Dynamic: classifier
33
+ Dynamic: description
34
+ Dynamic: description-content-type
35
+ Dynamic: home-page
36
+ Dynamic: keywords
37
+ Dynamic: license
38
+ Dynamic: license-file
39
+ Dynamic: maintainer
40
+ Dynamic: platform
41
+ Dynamic: project-url
42
+ Dynamic: requires-python
43
+ Dynamic: summary
44
+
45
+ # ManimPango
46
+
47
+ <p align="center">
48
+ <a href="https://pypi.org/project/manimpango/"><img src="https://img.shields.io/pypi/v/manimpango.svg?style=flat&logo=pypi" alt="PyPI Latest Release"></a>
49
+ <a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Wheel" src="https://img.shields.io/pypi/wheel/manimpango"></a>
50
+ <a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/manimpango"></a>
51
+ <a href="https://choosealicense.com/licenses/mit/"><img alt="PyPI - License" src="https://img.shields.io/pypi/l/manimpango"></a>
52
+ <a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/ManimPango.svg?style=flat"></a>
53
+ <a href='https://manimpango.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/manimpango/badge/?version=latest' alt='Documentation Status' /></a>
54
+ <br>
55
+ <img src="https://github.com/ManimCommunity/manimpango/workflows/Build%20Wheels/badge.svg">
56
+ </p>
57
+
58
+ **ManimPango** is a C binding for [Pango](https://pango.gnome.org/) using [Cython](https://cython.org/), which is internally used in [Manim](https://www.manim.community) to render (non-LaTeX) text.
59
+
60
+
61
+
62
+ ## INSTALL
63
+
64
+ Installing **ManimPango** is super easy, just use `pip`. It is [`manimpango`](https://pypi.org/project/manimpango/) in PyPi.
65
+
66
+ ```sh
67
+ pip install manimpango
68
+ ```
69
+
70
+ For **Linux Users**, there are no Wheels. You must have a C compiler as well as **Pango** and its dependencies along with the **Pango** development headers. See [BUILDING](#BUILDING) for more information.
71
+
72
+ ## WORKFLOW SETUP / CONTRIBUTING
73
+
74
+ To make it easier for developers to contribute, we have a pre-commit workflow that will check for `black` formatting and `flake` checking.
75
+
76
+ ```sh
77
+ pip install pre-commit
78
+ pre-commit install
79
+ ```
80
+
81
+ ## BUILDING
82
+
83
+ ### Linux/MacOS
84
+
85
+ For building **ManimPango**, you need
86
+ * a C compiler
87
+ * Python's development headers
88
+ * [`pkg-config`](https://www.freedesktop.org/wiki/Software/pkg-config/)
89
+ * [Pango](https://pango.gnome.org) along with its development headers and its dependencies.
90
+
91
+ If you are on MacOS, you can use [brew](https://brew.sh) to install those. Using [MacPorts](https://www.macports.org) is also possible.
92
+
93
+ ```sh
94
+ brew install pango pkg-config
95
+ ```
96
+
97
+ If you are on Linux, you can use a system package manager to do so. For example, if you are on Debian based system, you can use `apt`
98
+
99
+ ```sh
100
+ apt install libpango1.0-dev pkg-config python3-dev
101
+ ```
102
+
103
+ **Arch Linux:** `pacman -S pango pkgconf`
104
+
105
+ **Fedora:** `dnf install pango-devel pkg-config python3-devel`
106
+
107
+ Or similar in your system's package manager.
108
+
109
+ #### Using `tar` archives
110
+
111
+ If you don't want to contribute to this repository, you can use the tar archives published in PyPi, or just use `pip` to install using
112
+
113
+ ```sh
114
+ pip install manimpango --no-binary :all:
115
+ ```
116
+
117
+ **Note**: `pip` by default uses wheels, so make sure to pass the `--no-binary` parameter.
118
+
119
+ #### Using `git` clones / Contributing
120
+
121
+ Please remember to do this inside your virtual environment, if you want to use your **Manimpango** with **Manim**.
122
+
123
+ ```sh
124
+ python -m venv ./venv
125
+ source venv/bin/activate # Linux/macOS
126
+ venv\Scripts\activate # Windows
127
+ ```
128
+
129
+ If you are using a clone of this repository, you will need [Cython](https://cython.org) which can be easily installed using `pip`:
130
+
131
+ ```sh
132
+ pip install Cython
133
+ ```
134
+
135
+ After that you can use `pip` to install the clone with the following command:
136
+
137
+ ```sh
138
+ pip install -e .
139
+ pip install -r requirements-dev.txt .
140
+ ```
141
+
142
+ Next, run the setup script:
143
+
144
+ ```sh
145
+ python setup.py build_ext -i
146
+ ```
147
+
148
+ After installation is complete, you should be able to run pytest:
149
+
150
+ ```sh
151
+ pytest
152
+ ```
153
+
154
+ You will need to this way if you want to *contribute* to **ManimPango**.
155
+
156
+ ### Contributing with Windows
157
+
158
+ *If you are a normal user, don't read this, you have wheels which you can just install directly using pip.*
159
+
160
+ If you want to contribute to **ManimPango** and you are on Windows, this section is for you.
161
+
162
+ As Windows does not include a C compiler by default, you will first need to install one. You have two choices:
163
+
164
+ 1. MinGW/Msys2
165
+
166
+ 2. Visual Studio
167
+
168
+ #### MinGW/Msys2
169
+
170
+ 1. Download **MSYS2** from the download link provided on their page https://www.msys2.org/#installation and install it according to their instructions.
171
+ 2. Once you have **MSYS2** installed, it offers you three different shells: the **MinGW32** shell, the **MinGW64** shell and **MSYS** shell. In order for the following steps to work, you have to open the **MSYS2 MinGW64** shell (you can search for this). Small hint: it has a blue color logo.
172
+ 3. Run the following commands to install Python, Pango, Cython, Numpy, Scipy, Pillow, Pycairo and ffmpeg
173
+ ```sh
174
+ pacman -S mingw-w64-x86_64-python
175
+ pacman -S mingw-w64-x86_64-python-pip
176
+ pacman -S mingw-w64-x86_64-pango
177
+ pacman -S mingw-w64-x86_64-cython
178
+ pacman -S mingw-w64-x86_64-python-numpy
179
+ pacman -S mingw-w64-x86_64-python-scipy
180
+ pacman -S mingw-w64-x86_64-python-pillow
181
+ pacman -S mingw-w64-x86_64-python-cairo
182
+ pacman -S mingw-w64-x86_64-ffmpeg
183
+ ```
184
+ 4. Still in the same shell, install **Manim** using `pip install manim`.
185
+ 5. Finally, get your clone of **ManimPango**, `cd` into that directory and then run `pip install -e .`.
186
+ **Note** You can't use it with your regular Python version. It will cause weird errors if you do so. For working with **ManimPango**, you must be inside the `MSYS2 MINGW64 shell`.
187
+ 6. You can then use `manim` inside that shell, to run **Manim**.
188
+ **Hint**: If you want to try out Python interactively, you can open `idle` using the command `python -m idlelib` inside that shell.
189
+
190
+ #### Visual Studio
191
+
192
+ First, install Visual Studio as specified in https://wiki.python.org/moin/WindowsCompilers. Possibly Visual Studio Build Tools 2022 with Windows10 SDK.
193
+
194
+ Then run the script at `packing/download_dlls.py`. This will get a **Pango** build along with `pkg-config` and install it at `C:\cibw\vendor`. Add `C:\cibw\vendor\bin` to PATH.
195
+
196
+ **Note:** You can change the install location by editing line 24 of the file `packing/download_dlls.py`.
197
+
198
+ Then set an environment variable `PKG_CONFIG_PATH`=`C:\cibw\vendor\lib\pkgconfig`.
199
+
200
+ Then you can install Cython using
201
+
202
+ ```sh
203
+ pip install Cython
204
+ ```
205
+
206
+ Finally, you can install your local **ManimPango** clone just like any other python package by typing:
207
+
208
+ ```sh
209
+ pip install .
210
+ ```
211
+
212
+ ## Code of Conduct
213
+
214
+ Our full code of conduct, and how we enforce it, can be read on [our website](https://docs.manim.community/en/latest/conduct.html).
215
+
216
+ ## License
217
+
218
+ This project is licensed under MIT License. The wheels distributed on PyPI contains compiled version of Pango and Cairo subject to terms of the GNU LGPL and other licenses. Consult the licenses of each library for more informations.
@@ -44,7 +44,7 @@ For building **ManimPango**, you need
44
44
  * [`pkg-config`](https://www.freedesktop.org/wiki/Software/pkg-config/)
45
45
  * [Pango](https://pango.gnome.org) along with its development headers and its dependencies.
46
46
 
47
- If you are on MacOS, you can use [brew](https://brew.sh) to install those. Using [MacPorts](https://www.macports.org) is also possible, but their version of **Pango** is old and will probably not be updated in the near future.
47
+ If you are on MacOS, you can use [brew](https://brew.sh) to install those. Using [MacPorts](https://www.macports.org) is also possible.
48
48
 
49
49
  ```sh
50
50
  brew install pango pkg-config
@@ -145,9 +145,9 @@ pacman -S mingw-w64-x86_64-ffmpeg
145
145
 
146
146
  #### Visual Studio
147
147
 
148
- First, install Visual Studio as specified in https://wiki.python.org/moin/WindowsCompilers. Possibly Visual Studio Build Tools 2019 with Windows10 SDK.
148
+ First, install Visual Studio as specified in https://wiki.python.org/moin/WindowsCompilers. Possibly Visual Studio Build Tools 2022 with Windows10 SDK.
149
149
 
150
- Then run the script at `packing/download_dlls.py`. This will get a **Pango** build along with `pkg-config` and install it at `C:\cibw\vendor`. Add `C:\cibw\vendor\bin` and `C:\cibw\vendor\pkg-config\bin` to PATH.
150
+ Then run the script at `packing/download_dlls.py`. This will get a **Pango** build along with `pkg-config` and install it at `C:\cibw\vendor`. Add `C:\cibw\vendor\bin` to PATH.
151
151
 
152
152
  **Note:** You can change the install location by editing line 24 of the file `packing/download_dlls.py`.
153
153
 
@@ -165,13 +165,6 @@ Finally, you can install your local **ManimPango** clone just like any other pyt
165
165
  pip install .
166
166
  ```
167
167
 
168
- **Important**: You have to to use https://docs.python.org/3/library/os.html#os.add_dll_directory before running **ManimPango**. Alternatively, you need to copy the `dll` at `C:\cibw\vendor\bin` to the folder where **ManimPango** is compiled. This is applicable for Python 3.8 and above.
169
-
170
- ```python
171
- import os
172
- os.add_dll_directory('C:\cibw\vendor\bin')
173
- ```
174
-
175
168
  ## Code of Conduct
176
169
 
177
170
  Our full code of conduct, and how we enforce it, can be read on [our website](https://docs.manim.community/en/latest/conduct.html).
@@ -10,6 +10,8 @@ Manimpango Reference
10
10
  manimpango.MarkupUtils
11
11
  manimpango.register_font
12
12
  manimpango.unregister_font
13
+ manimpango.fc_register_font
14
+ manimpango.fc_unregister_font
13
15
  manimpango.list_fonts
14
16
 
15
17
  Enums
@@ -11,9 +11,9 @@ if os.name == "nt": # pragma: no cover
11
11
  f"{os.environ['PATH']}"
12
12
  )
13
13
  try:
14
+ from .register_font import * # isort:skip # noqa: F403,F401
14
15
  from .cmanimpango import * # noqa: F403,F401
15
16
  from .enums import * # noqa: F403,F401
16
- from .register_font import * # noqa: F403,F401
17
17
  except ImportError as ie: # pragma: no cover
18
18
  py_ver = ".".join(map(str, sys.version_info[:3]))
19
19
  msg = f"""
@@ -1,5 +1,5 @@
1
-
2
1
  from libc.stddef cimport wchar_t
2
+ from pango cimport *
3
3
 
4
4
 
5
5
  cdef extern from "Python.h":
@@ -35,6 +35,13 @@ IF UNAME_SYSNAME == "Windows":
35
35
  DWORD fl,
36
36
  unsigned int pdv
37
37
  )
38
+
39
+ ctypedef void* HANDLE
40
+ HANDLE CreateMutexA(void* lpMutexAttributes, int bInitialOwner, const char* lpName)
41
+ int ReleaseMutex(HANDLE hMutex)
42
+ int WaitForSingleObject(HANDLE hHandle, unsigned long dwMilliseconds)
43
+ int CloseHandle(HANDLE hObject)
44
+
38
45
  ELIF UNAME_SYSNAME == "Darwin":
39
46
  cdef extern from "Carbon/Carbon.h":
40
47
  ctypedef struct CFURLRef: