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.5.0.tar.gz (4.1 MB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.12 Windows x86

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

Uploaded CPython 3.12 macOS 10.9+ x86-64

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.11 Windows x86

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

Uploaded CPython 3.11 macOS 10.9+ x86-64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 Windows x86

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

Uploaded CPython 3.10 macOS 10.9+ x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 Windows x86

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

Uploaded CPython 3.9 macOS 10.9+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 Windows x86

ManimPango-0.5.0-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.5.0.tar.gz.

File metadata

  • Download URL: ManimPango-0.5.0.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.5.0.tar.gz
Algorithm Hash digest
SHA256 299913bbccb0f15954b64401cf9df24607e1a01edda589ea77de1ed4cc2bc284
MD5 38722b83f4dbf78aa08e02015c47234d
BLAKE2b-256 485bd1249c3d90324a1d4dce4711e507c8ec87addca61d1304ffa55513783ba3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-0.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 aef7151c210fce42518eff7a00e4b07d497a2516e13945d56b9b4a6427fae3f6
MD5 c7656ceaf09f352fef15717fcdf60ddc
BLAKE2b-256 ffd026acb86744a4ca8c6acd890a33e8d653db072c00547bfb419f4db4464f2c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.5.0-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.5.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 0b5e47755cce7848fa268b5f77f17fc4fe363d30f5412fef845560df26dece82
MD5 7bffe0772329ad24708fb5c16339fd42
BLAKE2b-256 4ae9b2b5995d0e2223d6fcbce6ae019ebc50fcbcbf9b802693e017b382550e6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-0.5.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bf4a09fe1989763ea041fcce044ce501d89678bcc14084949f6792fc3b204517
MD5 6e7e724eabb6f3d672e863b04b946b4e
BLAKE2b-256 2872787d902d255d42301473f898922a39963ce913c1c6b2bea80ba78be77d2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-0.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 86e68c085e455d4bd607c2f63fcce41d1496a873dde29c413a3fbd98ff99c258
MD5 5da30cf3641f55d204794862a20dcad6
BLAKE2b-256 d420142b4597beabd3c0dfa913cf455873408c740c64fbf809db9538a2c374a7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.5.0-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.5.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 5de05ac673b1ac597cc3e4e0e05756195b387f8f96b81cd03767a9f12f8af3f4
MD5 fed64110f3b20a7d658a6bd6ebfc1676
BLAKE2b-256 9bba6b86f7fd0121ce58e2c23ada1ffd1910c8b3fa43500c8fc5c18932a7e48e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-0.5.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f8a866a03c8a569dfaf08035748aea5c56f5e729d12682aae5d25fbe837a6270
MD5 a9e21cddb30ec30e3fe1ef71dd3859ab
BLAKE2b-256 8180510be2b2392651bed2be604464d85f2b65fa3c338b6e3927fd7c3574190d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-0.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 26053a59e352c11e33fa224be6fde095a08c9db2665895ada7689fdeb225064c
MD5 6b5b329913dd673247001ae6766b809f
BLAKE2b-256 5b0d2d8520038f65192fd1fd8061b52dc2193358761abcfc00128d1abd0c260b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.5.0-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.5.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 7e301f0d2ceeb05b82dbb5ddd1e2397b6de7ef4ab556d04c0765eb29f18be981
MD5 4b6712dbd537d41abf82d2f1e3b002ba
BLAKE2b-256 2e2302c48e0f72f6143020abaf04e2ae3cca40f4ba0bd4e3be0e1c2fd038f221

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-0.5.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b3309536038e11a4020bf5422d36b691e5583d38f616311c75527faa853fa948
MD5 9305ee41655c227399e8a62eb80603aa
BLAKE2b-256 8371766cd5c911470b67b52dec6344c661ac5f1fcbb7ebd85460fb2f025c48a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-0.5.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b81d815b1a5e78376ae9b6aa2d7606d38cc19e31eb89480471462bbdf0fcd3c7
MD5 20d410e30186f695841d5b9d97ed30e9
BLAKE2b-256 a1282f05b9760b89b8b08132d9cf76e3258dc88c869356bec4103d66865fe277

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.5.0-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.5.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 8c453e9511d5888c92aa1f7b120b7f3318fc21fd7a4862156c9b094986f2e17d
MD5 341734648b5313c781f02cbd165581d1
BLAKE2b-256 3fa4c7015f817221b7039076e848335f1356534ab47d95e6d56d7a2f8e1de21b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-0.5.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5d58e736ccf2afb3398c42ad1d478b84176785ad19cb994dfc9575030bfd040f
MD5 1bfc457101ce6615dcaeafa9d1eae82f
BLAKE2b-256 8acdf06beab9d0029feed191912725536247f4d9ad0ce3892cc242791b3fc3e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-0.5.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 9bb032625d5c663c4727bae61870e3c16696278c569c98a094b14953f22a70c8
MD5 927ae8e455f8004a14ab385a77d80a87
BLAKE2b-256 c1a7ba872f5d4efd8def28f269ae8f25ac32e36b78f5c3871b1c75c6645fdf21

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.5.0-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.5.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 d135fbc2049b3cb22fa941e7333c10a42b29aa080871dd4e80d169da2337b797
MD5 1c0daad34c5eed14ffbd47056120ed48
BLAKE2b-256 222bce62ec59314600bd4b26a46a11595558030bf122da250e44fb2faf0ad769

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-0.5.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f1b614dc33b1cc012ef38a49b04def005e80a14592bdd389be91a9073a71be30
MD5 7ae7791742b8e2da7d613426b6dc44e0
BLAKE2b-256 36b66c9f5df4c87f595c0bd2a85664e3af93b76788246b1d97237353ca76398f

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