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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.11 Windows x86

ManimPango-1.0.0a2-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.0a2-cp310-cp310-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 Windows x86

ManimPango-1.0.0a2-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.0a2-cp39-cp39-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 Windows x86

ManimPango-1.0.0a2-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.0a2-cp38-cp38-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 Windows x86

ManimPango-1.0.0a2-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.0a2.tar.gz.

File metadata

  • Download URL: ManimPango-1.0.0a2.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.0a2.tar.gz
Algorithm Hash digest
SHA256 3ce41624aeab7533e0be441ed28b38d2c95c90a5c73b955a11d4622392f1e23c
MD5 ac5e2102f4429ca93ff332ff2b029b74
BLAKE2b-256 ab2a67188b9630bdb49fa2b1f2cad7f6393d98783b9adcdd98290f7e10960248

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-1.0.0a2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bc4fba034cc6dbb0deb7732174350d47178c7b0888765be312bc29f29e5647d1
MD5 d01a4e662d8c6af4b1b2ef5ae43855b4
BLAKE2b-256 7ef5677c32ceaadeca1f76706b1732f9a7d8e22516abfcf2856125f9d2c1f26a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-1.0.0a2-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 1dc67e78ac259649b5dec7febc667c047e586b93faa02a9c7d32e55b63742964
MD5 f048d720c4900bd1e17949a639ea47ea
BLAKE2b-256 460d7cf9e4ded634ddcf94624e9cfb7ef2de352df11b67e6ff0923e2aa9ddabc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-1.0.0a2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f053e60f35bc7e03be7c78ecdd34f28c8457f803afc722836b580f2514c5436b
MD5 b1afe7d92d9ccc0dca9762f720002988
BLAKE2b-256 b5ec9278e2839217bf85b4102d5965528f6b4c330b9f3cc1a10416566487c857

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-1.0.0a2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 92db47ac57d81f8f4a3443ff9df70f44b51566d6c482c681aa1c56936e8faefa
MD5 ff02090706de26f9a551926bcf6a57ac
BLAKE2b-256 1e5a5fc61b1a6387f2731f28b9455054b0e59b0517504f1e8b1e41641fb4b881

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-1.0.0a2-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 76f8ba38c45e306cceeba5371997f9bf4556cf61d925d480b47fa72842305177
MD5 a32cd3c1af3d07c7e74bbf27c2bb6a3d
BLAKE2b-256 604c6078fd7b18dd9519851b5d2ecf828227324cc4c3ab5c77b5a2677914d474

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-1.0.0a2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0839f65444a2d9f521163fcd1801fc4181dd55208addf73333d4322b3a054a07
MD5 885b2f7a4cae4dac013fff572f46c502
BLAKE2b-256 768d72f42f3fe04ba554e086a9e4772fa9779c102a45d981897776f6e1002050

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-1.0.0a2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8e6bdcb4ccf4def1b0c0a58757cfffac56884a13cb0b58a3ff66a71851aafb08
MD5 58bc5255be5a18cc143fac54ffd9afc0
BLAKE2b-256 b481df95082f04ec7f2b8f62a382a7db939284663633a55ca8b37153d6900784

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-1.0.0a2-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.0a2-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 c81aa6d1aba352c1b2967c189bf90be8c9c66cb5eeb91ee0817195ee1f46d2cf
MD5 5aac3f001c9d43ab3e4188483d34695f
BLAKE2b-256 6ca1291bf0ca0674b88ca9699ea4d22742a0f4210c39274010547a3d4a6d1413

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-1.0.0a2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 97503b65e8ad7bc32a0220afdf4fa8e64a803ce481f68268585435a18194e40c
MD5 8014cedc10a20b3efc0501dfdc043bfa
BLAKE2b-256 64b6e2866f48d2bdec75ebe4dec30ef41b69c053aa1c962a4ba3a6fda4409a0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-1.0.0a2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d926deeb261113912116d48f7383ddad4d409d305f7d83d186a6d99fdf74559d
MD5 dd9f855e6b6699122eecc20002c3f685
BLAKE2b-256 3091b2f1aa3dad7ec5541675e4558bded03b69879dc3bd70a1c794360e5501ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-1.0.0a2-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.0a2-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 c3b065d902085449afd77a8ecbbebb44a90374a4442b8b4e64fb1b979d702851
MD5 871d12c551191459bcf32a225a65f6b9
BLAKE2b-256 ce3eb4825c2e05ad7e813cdf846e0e9c69631d6286ebd587b8f9bb680aa1d64d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ManimPango-1.0.0a2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 950c36d9e5430b780c366671f825a8ba40b63a7c890fb0bd2b673c03af9f7d10
MD5 93cd2c439271d542da6321b1af32cde9
BLAKE2b-256 c38ac8c8b97045deea3dd9fa2c085a1169d62da6bacca749e42e54c661f96e16

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