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

Uploaded Source

Built Distributions

ManimPango-1.0.0a1-cp311-cp311-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.11 Windows x86-64

ManimPango-1.0.0a1-cp311-cp311-win32.whl (3.9 MB view details)

Uploaded CPython 3.11 Windows x86

ManimPango-1.0.0a1-cp311-cp311-macosx_10_9_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

ManimPango-1.0.0a1-cp310-cp310-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.10 Windows x86-64

ManimPango-1.0.0a1-cp310-cp310-win32.whl (3.9 MB view details)

Uploaded CPython 3.10 Windows x86

ManimPango-1.0.0a1-cp310-cp310-macosx_10_9_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ManimPango-1.0.0a1-cp39-cp39-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.9 Windows x86-64

ManimPango-1.0.0a1-cp39-cp39-win32.whl (3.9 MB view details)

Uploaded CPython 3.9 Windows x86

ManimPango-1.0.0a1-cp39-cp39-macosx_10_9_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ManimPango-1.0.0a1-cp38-cp38-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.8 Windows x86-64

ManimPango-1.0.0a1-cp38-cp38-win32.whl (3.9 MB view details)

Uploaded CPython 3.8 Windows x86

ManimPango-1.0.0a1-cp38-cp38-macosx_10_9_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file ManimPango-1.0.0a1.tar.gz.

File metadata

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

File hashes

Hashes for ManimPango-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 95022944e0fbae9bb542b4366a4a3a656c007c89b0c57ed9f72130a6ae00ad5d
MD5 0f23363e3a038ebd60b684f12ca968d3
BLAKE2b-256 aedc84c27ca1a20a0cfe53c634e6b5ce4208be8e7ab5a38f948a2764de90cbb5

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for ManimPango-1.0.0a1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b023b51556162f7a704bbcdb5a49d71c7b9886b41235a06bfd74b6171c8db642
MD5 0924f306ec9fa0fcdeb054c975034d53
BLAKE2b-256 77ea025e1735c5687b2313ce4c50058aef15148f313b7571fab38cbd501e5ba1

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp311-cp311-win32.whl.

File metadata

File hashes

Hashes for ManimPango-1.0.0a1-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 a9aa4439a5d9e263a558f94cb84d928b249491008e0ae996769698414565eb37
MD5 3a8daaa22f4a93bd52f4afab64e0ffe4
BLAKE2b-256 e4eb438d3b6b2f5023bff216c4d6451612c75c88a4103537b9605c6c5b14c609

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ManimPango-1.0.0a1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 97f359ac6119acc938d37bf4b3c99857d77b34b41d18d63a2537cb3be73685fd
MD5 112b342b79c7e90ba614833308ed3524
BLAKE2b-256 ec37c4cc9d64b4aa6f2e420572ae8236b1c4c6ae468f7d911d519f37d65bb8e4

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for ManimPango-1.0.0a1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f01b5f9127f36186dae8bcc1dcb128247c6b81f46355fb5d76ba000258d5b160
MD5 43882de2af4d3d56d997b5b87c437326
BLAKE2b-256 5823974aff56e6236ed5ffb908ef1eee699993b4b58cf5b6ec9245caa0b67361

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp310-cp310-win32.whl.

File metadata

File hashes

Hashes for ManimPango-1.0.0a1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 0c375472088a34442d6a4921d7d899b31eb1f7ec5df7ceb65a3dc15b0a507e71
MD5 ec7c43deafa73204a6197f05b4d95daa
BLAKE2b-256 be34b3bd0d74f760e87dbbe9cfc8757e4cddce6182e990cea319b68f66ca50fe

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ManimPango-1.0.0a1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 61bb6daffde854bf6e9503d6df7dec3f18a2dfc7d0c69c0ccd5a8bd9f696e7ac
MD5 4c3ba48ea88d07bdf6373b86369d463a
BLAKE2b-256 c760b17ef7d69b8a3f6c305fdbf3ec584741e4f9686a021e39d7e429c8d29cf1

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for ManimPango-1.0.0a1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 63b1edabf4f85bbcd71e909338a77d17b8b5cbfb094ef679d1d67bbd23d10150
MD5 8727749d696352bd87f912dfd9ea69fc
BLAKE2b-256 0b87146b2a01deb70a2d2d499aa3ce7cd42001635ca3aac4e3571a19f047d1cf

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp39-cp39-win32.whl.

File metadata

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

File hashes

Hashes for ManimPango-1.0.0a1-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 71b2a0ffa6d60f9827522d02431bc515e2c75e7eadffc9ea59a06a3d1cadd20c
MD5 57f186877c7639bdd477622768432686
BLAKE2b-256 7cdd2d0e5526de45e55b36ce813bd9494c87dac0f444199405f9949571410bbc

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ManimPango-1.0.0a1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 29ef0d1eeee9c4ebb909c7d98c2a34b3393e74eeda1f3fcabc717ac46f6660ab
MD5 53341dafa43fde9fc06538a38067d719
BLAKE2b-256 0eeb4cc5bfe05900e449e02666cb9104023d5c04d1562f31f40b74920d9a8f7e

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for ManimPango-1.0.0a1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 98a098a51d7008eb9aab5c0666b6b2b31a6a6a517f654920004a5b3b9a5c21a0
MD5 e952efacc0c934e93c8d424b15e7f50b
BLAKE2b-256 9f78ae4ad8707996d437164dad9071df56b79a444b6a07c9b26947d29e609476

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp38-cp38-win32.whl.

File metadata

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

File hashes

Hashes for ManimPango-1.0.0a1-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 6e7c63f3b0811a5f832a0b3ed08f84dd7f5b8d068f1663d4922714035718abb5
MD5 259e6cff12fd3f45939c2a0454686676
BLAKE2b-256 262b5ab8efd60cbf7e65c1e452792f797a59f2ccbcac63ab541d6928cf26bfda

See more details on using hashes here.

Provenance

File details

Details for the file ManimPango-1.0.0a1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ManimPango-1.0.0a1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ca593bf4ccb6ebb60734d2a85d51e0356cfdff388161e8b58e282933e581df30
MD5 ef056321929f3ec3c1f8fa064bc5b359
BLAKE2b-256 8a1cf3143c0981190dc7dd41688fdbaa243c04a3f2affb40640e080007610ebb

See more details on using hashes here.

Provenance

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