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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 Windows x86

ManimPango-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 Windows x86

ManimPango-0.4.1-cp39-cp39-macosx_10_9_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 Windows x86

ManimPango-0.4.1-cp38-cp38-macosx_10_9_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

ManimPango-0.4.1-cp37-cp37m-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.7m Windows x86-64

ManimPango-0.4.1-cp37-cp37m-win32.whl (3.4 MB view details)

Uploaded CPython 3.7m Windows x86

ManimPango-0.4.1-cp37-cp37m-macosx_10_9_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: ManimPango-0.4.1.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for ManimPango-0.4.1.tar.gz
Algorithm Hash digest
SHA256 f2da037ccdfe174040d3315001cc59bfc7405cd1b1191078bd4db0938005d649
MD5 01d4a2139007c5514944619563efa679
BLAKE2b-256 a8c023944d54e7a56986c7a90869b6461f5ee8b93c229937e01ff5d4531a017d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.4.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a83da66451498d6cc3f6e637157ca6c7530b68f9bc0ac6fe043b04bf78c87073
MD5 30e5dc429c9573ef01d909d40d330ecf
BLAKE2b-256 f6a67f49a2bb3e023e86614fb270911fcec535029fdbafe12dfc6fc3e98d13cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.4.1-cp310-cp310-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 5228e5326dc52753f4e6855ac4bf9667d78c0005315cddaf74fac5c2a6f87bc3
MD5 f0291439c99c87f92a0205a2ccf88019
BLAKE2b-256 5b31f8205cad0f72409e3296a49c1ddbdacc5067d0e5289e1188221032143de7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.10, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fc70c1ae3bb853b7244ea2c9b50c908e9d7a93062ec68315872e38771cc66969
MD5 6a4843ebeda76e664d544e001dabb0f9
BLAKE2b-256 626c674aa63187f0ff783dc1221ba67aeab73ba59f8a88ce33d4116a26cd60d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.4.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ca35af36d490000a7155fdb3aae124bcdfe2a167086c95df0aeee92483f1dce1
MD5 464588a5821725e2163c66abcbaee816
BLAKE2b-256 e1fb3a076ef75fdd8dcdc3c5028e52323efe8a0865a48b07c3c697b14fa6574f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.4.1-cp39-cp39-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 109f2f5298f7a53354871766b21bc3a40e41eba448030fdcdffb970a295ebf28
MD5 21abce73b889181b8837dee52e49c355
BLAKE2b-256 151964ca6b55333ac23ffbc87172b9dd127c8a7f6e66ceb509e2e3bd07d95a35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.4.1-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2375739e7a65a7f16e5856b392d930410c194066dd44cf6000d5ef2eb3b7d6f3
MD5 d497c81f1f63699d72717643c0e7b4d7
BLAKE2b-256 1db5ee689e2779347e6044eaa3fbfe9c9fcbbc2974efa50639f691282f623a3c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.4.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 7a0e42e17b2caae12bcd68502befa0e879c8503e6d31cd07e8d819b1e2567718
MD5 189e13a81e6a8136377b8b6cd795fdce
BLAKE2b-256 99be3b6719b48e93eaf2c9ee93fadeda2cc68b1bff808d3b7dde10090aacb5d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.4.1-cp38-cp38-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 5ed7b089681d1379c4250b070b668079e92d69251491ec8e010c083d21a80775
MD5 aedf92c2669930dd674e4b1ff91324f2
BLAKE2b-256 c630ef7ea005fded61c01c6f9291b8778c8c5e3af72ce3fb4de94f7bac450d69

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManimPango-0.4.1-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d36b4df474149e958fadcc31a29cefc90ced6240053fa0e9cd3188a5649eca6b
MD5 fef336d9fe0837bba29f3c61400585cb
BLAKE2b-256 a644dd5d0091956cc35eeadb205505580feb490a04bbff07df1fd20772250446

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: ManimPango-0.4.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 c59cadd9ed02c0d748fcf294ddb7d158c2ba2a50caa96d6af58ee0bcde327d67
MD5 3d7dc5330431472df16412678636302f
BLAKE2b-256 d83d52bff8c3a0068eb663f9c0abaf68da8f98563feadede6aa89199c5bff70d

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.1-cp37-cp37m-win32.whl.

File metadata

  • Download URL: ManimPango-0.4.1-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 02eee359b971d8f900ecb4de0e0023abe1aaec8f5e1c39c663a99a4e2b4425b0
MD5 2ede03b7e8137a0780ac16ac1eee38b0
BLAKE2b-256 bfdf30f3c390ae29408a2e3d7d84205fb181224baa44a48190e7c0d82d915f80

See more details on using hashes here.

File details

Details for the file ManimPango-0.4.1-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: ManimPango-0.4.1-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ManimPango-0.4.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fb84060069e35bbc220cc9a19658f3e694019a98cee2154fee1171a47bf3db44
MD5 e587fc731ea66eb5a9e18b19925a68f2
BLAKE2b-256 35d3a32542912ad44150eec1d7aa2eb4618eaea32da52764dc1249ec78618640

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