Skip to main content

Bindings for Pango for using with Manim.

Project description

ManimPango

PyPI Latest Release PyPI - Wheel PyPI - Downloads PyPI - License PyPI - Python Version Documentation Status

ManimPango is a C binding for Pango using Cython, which is internally used in Manim to render (non-LaTeX) text.

INSTALL

Installing ManimPango is super easy, just use pip. It is manimpango in PyPi.

pip install manimpango

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 for more information.

WORKFLOW SETUP / CONTRIBUTING

To make it easier for developers to contribute, we have a pre-commit workflow that will check for black formatting and flake checking.

pip install pre-commit
pre-commit install

BUILDING

Linux/MacOS

For building ManimPango, you need

  • a C compiler
  • Python's development headers
  • pkg-config
  • Pango along with its development headers and its dependencies.

If you are on MacOS, you can use brew to install those. Using MacPorts is also possible, but their version of Pango is old and will probably not be updated in the near future.

brew install pango pkg-config

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

apt install libpango1.0-dev pkg-config python3-dev

Arch Linux: pacman -S pango pkgconf

Fedora: dnf install pango-devel pkg-config python3-devel

Or similar in your system's package manager.

Using tar archives

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

pip install manimpango --no-binary :all:

Note: pip by default uses wheels, so make sure to pass the --no-binary parameter.

Using git clones / Contributing

Please remember to do this inside your virtual environment, if you want to use your Manimpango with Manim.

python -m venv ./venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows

If you are using a clone of this repository, you will need Cython which can be easily installed using pip:

pip install Cython

After that you can use pip to install the clone with the following command:

pip install -e .
pip install -r requirements-dev.txt .

Next, run the setup script:

python setup.py build_ext -i

After installation is complete, you should be able to run pytest:

pytest

You will need to this way if you want to contribute to ManimPango.

Contributing with Windows

If you are a normal user, don't read this, you have wheels which you can just install directly using pip.

If you want to contribute to ManimPango and you are on Windows, this section is for you.

As Windows does not include a C compiler by default, you will first need to install one. You have two choices:

  1. MinGW/Msys2

  2. Visual Studio

MinGW/Msys2

  1. Download MSYS2 from the download link provided on their page https://www.msys2.org/#installation and install it according to their instructions.
  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.
  3. Run the following commands to install Python, Pango, Cython, Numpy, Scipy, Pillow, Pycairo and ffmpeg
pacman -S mingw-w64-x86_64-python
pacman -S mingw-w64-x86_64-python-pip
pacman -S mingw-w64-x86_64-pango
pacman -S mingw-w64-x86_64-cython
pacman -S mingw-w64-x86_64-python-numpy
pacman -S mingw-w64-x86_64-python-scipy
pacman -S mingw-w64-x86_64-python-pillow
pacman -S mingw-w64-x86_64-python-cairo
pacman -S mingw-w64-x86_64-ffmpeg
  1. Still in the same shell, install Manim using pip install manim.
  2. Finally, get your clone of ManimPango, cd into that directory and then run pip install -e .. 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.
  3. You can then use manim inside that shell, to run Manim. Hint: If you want to try out Python interactively, you can open idle using the command python -m idlelib inside that shell.

Visual Studio

First, install Visual Studio as specified in https://wiki.python.org/moin/WindowsCompilers. Possibly Visual Studio Build Tools 2019 with Windows10 SDK.

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.

Note: You can change the install location by editing line 24 of the file packing/download_dlls.py.

Then set an environment variable PKG_CONFIG_PATH=C:\cibw\vendor\lib\pkgconfig.

Then you can install Cython using

pip install Cython

Finally, you can install your local ManimPango clone just like any other python package by typing:

pip install .

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.

import os
os.add_dll_directory('C:\cibw\vendor\bin')

Code of Conduct

Our full code of conduct, and how we enforce it, can be read on our website.

License

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ManimPango-0.4.4.tar.gz (4.1 MB view details)

Uploaded Source

Built Distributions

ManimPango-0.4.4-cp312-cp312-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.12 Windows x86-64

ManimPango-0.4.4-cp312-cp312-win32.whl (3.4 MB view details)

Uploaded CPython 3.12 Windows x86

ManimPango-0.4.4-cp312-cp312-macosx_10_9_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

ManimPango-0.4.4-cp311-cp311-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.11 Windows x86-64

ManimPango-0.4.4-cp311-cp311-win32.whl (3.4 MB view details)

Uploaded CPython 3.11 Windows x86

ManimPango-0.4.4-cp311-cp311-macosx_10_9_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

ManimPango-0.4.4-cp310-cp310-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.10 Windows x86-64

ManimPango-0.4.4-cp310-cp310-win32.whl (3.4 MB view details)

Uploaded CPython 3.10 Windows x86

ManimPango-0.4.4-cp310-cp310-macosx_10_9_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ManimPango-0.4.4-cp39-cp39-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.9 Windows x86-64

ManimPango-0.4.4-cp39-cp39-win32.whl (3.4 MB view details)

Uploaded CPython 3.9 Windows x86

ManimPango-0.4.4-cp39-cp39-macosx_10_9_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ManimPango-0.4.4-cp38-cp38-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.8 Windows x86-64

ManimPango-0.4.4-cp38-cp38-win32.whl (3.4 MB view details)

Uploaded CPython 3.8 Windows x86

ManimPango-0.4.4-cp38-cp38-macosx_10_9_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file ManimPango-0.4.4.tar.gz.

File metadata

  • Download URL: ManimPango-0.4.4.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for ManimPango-0.4.4.tar.gz
Algorithm Hash digest
SHA256 d4dfb55e8c8a62d6b56b6bacea314369f25dda59e2ed4f4c0e6867512d93828c
MD5 3a4905b230b35025f3cbd41ae296db5d
BLAKE2b-256 6a51a8ac58edbdfc0d6d5ca0162962133723a4a5bbb242448a47c8742c1fba96

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for ManimPango-0.4.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9e8c907876f3a5bb99d28d49aeb93b29a80e72f66300f7f0f0cf82ccba53473b
MD5 9a60e4b2afad6a491092b6eb9670f13a
BLAKE2b-256 7bc79d89309692a322701204727fbed96bd1d66f581b8ec3fcf69962c08d0074

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp312-cp312-win32.whl.

File metadata

  • Download URL: ManimPango-0.4.4-cp312-cp312-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for ManimPango-0.4.4-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 f17e566e97b3eba8158caaefcc8fb3188376acd8a8e1bc7b7201f26019e0860b
MD5 7236adf8bf97cd89b5a9ec7e51189f15
BLAKE2b-256 56e3e484ec06c7fde4a3accbb284703f0f328973dd897e68b020642c6c93a1af

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ManimPango-0.4.4-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b76a337b1d7226a1b0b418c556e4cfcdb8ba38e0ddc13e8f4c5b8c7d27422b3a
MD5 ae1fb299c812f1f616ab077fe8205de7
BLAKE2b-256 4b499de02cb862023790100b0bea99cfd8bb4c68941ccb098a97bef4a84b6925

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for ManimPango-0.4.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0ac7e5da4b21267d7e07273ca79bb15260e9494e80d0b50414dfbe78b3e274b7
MD5 e69c286ea9d37b50017c5377f7d848b7
BLAKE2b-256 a31a26c55ec77a80e81afba5d40f0d5e6f3fc39581146f025632f507e6e45b0d

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp311-cp311-win32.whl.

File metadata

  • Download URL: ManimPango-0.4.4-cp311-cp311-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for ManimPango-0.4.4-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 077c22deccc8b07cf490e66dbe5511a8748156d002f9135df9e4a2ebae38140d
MD5 1ec7994a1e9242410496509bc8aab35b
BLAKE2b-256 986c5c579315ca5f4ca90c03059c63392943e009ebbe35e5dbbafb95a0ee1043

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ManimPango-0.4.4-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 19ab9c2be4b44f99fc3bb87ce7e8685940a9c8812f2250e0f84acccee13cd1f8
MD5 dc43c7224995c881180b05f4296e577e
BLAKE2b-256 f08639700933f44dcbd3534d9ccd4e49755b3710fc51dc5cffd31a3ed03bcbe6

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for ManimPango-0.4.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7192ec39ff8d59546b9e0dc21a00042ab507944291a662c5526a4bf1b3639705
MD5 231da11cb94e8c1a6d81cf2671d3d163
BLAKE2b-256 0c568856c2b95f3ad037c89654eb12ac54f9074d8b143ecaf49ba17948e30c88

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp310-cp310-win32.whl.

File metadata

  • Download URL: ManimPango-0.4.4-cp310-cp310-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for ManimPango-0.4.4-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 a31aa72a1451b1ef762e02845fa08cef10bba89708c449648db1f83e9f1b5715
MD5 165ea3937e64c5ae5b06aeecccd37354
BLAKE2b-256 b117e900a78061ebee13f441188401701abcd50cc9c2c9da8a8efc7cb0c547b4

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ManimPango-0.4.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4eadd960fb01ca9a18b00e54e4a9f5f8631c939a607cdf0765502e0f3cb43de7
MD5 878e4adcfc54ed6c7fec6830f4bbb3e6
BLAKE2b-256 d9a03685afa6209837327f12dcfd4d698ccfb01a9acac4e014fb5f2fbc786d23

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for ManimPango-0.4.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d3efaeb07cf212fba0d39ccd8314ea3f5e7e8384d7c54b11bc0f683dabb64959
MD5 26b27d5afc2c184b36c2b0581fb112a7
BLAKE2b-256 33423cc50586f13fddd6f13a8477a3dbd47d761e7ad52c5fc1c94d12541bf4a0

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp39-cp39-win32.whl.

File metadata

  • Download URL: ManimPango-0.4.4-cp39-cp39-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for ManimPango-0.4.4-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 ca6dda74fa306a2f96dac943ca23aee4be0ba2c15d99a4789c088913eb61d78e
MD5 bd0c4f4b5bd6a58a2fee5ab9dbeff8e9
BLAKE2b-256 12d87dbf9c285d8ff2c293c73d7f9a423ed025bab359507258bf3293702b376b

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ManimPango-0.4.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2b130d577d1aa4865730568d84fcb64100b704e296b68deccbc2963dd421bfa1
MD5 64db4ffb6b408f510b6ec6440e85bb0e
BLAKE2b-256 53eda371e1e21639f3ceb1a6acf1172c74bffa9aa7e7b30f97a53b086c7c450d

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for ManimPango-0.4.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4a7787c5135381dd1ad8a0a5c671e8c0c88bcd3f93967b775e3389de75e70198
MD5 4300ac5228d1a6a289bc86bf691f2e60
BLAKE2b-256 4b47109fdc95c92ec43652501919c0d7639cdf374de09000e52dd7257498964b

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp38-cp38-win32.whl.

File metadata

  • Download URL: ManimPango-0.4.4-cp38-cp38-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for ManimPango-0.4.4-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 443edb608b8ce0171763044e4ee50ca44b2aebed8f32d5c1c3f90c7d2f809481
MD5 78a573ce04174f67a5c28001e2bf78f0
BLAKE2b-256 fc3da3d0a174b7f61f73bb615bf39d5aed85cde24bffcf3e7738ce1d83cefd75

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.4-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ManimPango-0.4.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5e0a9b13631acf01c0c61e6f5c7042ec9c43f5fbdae28791bf34755e6bba4659
MD5 f6098548a2b09734f3b5b5da0f4840e4
BLAKE2b-256 b9744f62724c2726da561d50d7196b35ca7a6721c800690e1e6dfff3b0279929

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page