{"id":9918,"library":"manimpango","title":"ManimPango","description":"ManimPango provides Python bindings for the Pango text layout library, specifically designed to integrate with the Manim animation engine for advanced text rendering. It allows Manim users to leverage Pango's rich text features, font handling, and internationalization capabilities. The current version is 0.6.1, and the library is actively maintained with frequent minor releases addressing Python version compatibility, OS-specific build issues, and Pango library updates.","status":"active","version":"0.6.1","language":"en","source_language":"en","source_url":"https://github.com/ManimCommunity/manimpango","tags":["manim","pango","fonts","text rendering","graphics","animation"],"install":[{"cmd":"pip install manimpango","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"FontDescriptor","correct":"from manimpango import FontDescriptor"},{"symbol":"list_fonts","correct":"from manimpango import list_fonts"},{"symbol":"register_font","correct":"from manimpango import register_font"},{"note":"Pango utility functions are grouped under PangoUtils class, not a direct 'utils' module.","wrong":"from manimpango import utils","symbol":"PangoUtils","correct":"from manimpango import PangoUtils"}],"quickstart":{"code":"from manimpango import FontDescriptor, list_fonts, register_font\nimport os\n\nprint(\"Available fonts (first 5):\")\n# In a real scenario, this might return hundreds of fonts.\n# We limit for demonstration.\nfor font_name in list_fonts()[:5]:\n    print(f\"- {font_name}\")\n\n# Create a font descriptor (Pango uses 'family style weight size')\ntry:\n    descriptor = FontDescriptor(\"Arial Bold 16\")\n    print(f\"\\nSuccessfully created FontDescriptor for: {descriptor.family}, style={descriptor.style}, weight={descriptor.weight}, size={descriptor.size}\")\nexcept Exception as e:\n    print(f\"\\nError creating FontDescriptor: {e}\")\n\n# Example of how you would register a font (requires an actual font file path)\n# For a runnable quickstart, we'll just demonstrate the call without a real file.\n# font_file_path = os.environ.get('MANIMPANGO_CUSTOM_FONT_PATH', '/path/to/your/custom_font.ttf')\n# if os.path.exists(font_file_path):\n#     register_font(font_file_path)\n#     print(f\"Registered font from {font_file_path}\")\n# else:\n#     print(f\"(Skipping font registration: custom font file not found at {font_file_path})\")","lang":"python","description":"This quickstart demonstrates how to list available system fonts and create a `FontDescriptor` using ManimPango. While `register_font` is a key feature, it's commented out as it requires a specific font file path which is not universally available for a quickstart example. It requires Python 3.8+."},"warnings":[{"fix":"Upgrade your Python environment to 3.8 or higher. The current version requires Python >=3.8.","message":"ManimPango dropped support for Python 3.7 in version 0.4.4. Installations on Python 3.7 or older will fail.","severity":"breaking","affected_versions":">=0.4.4"},{"fix":"Upgrade your macOS operating system to 10.13 or newer. Alternatively, you may need to compile from source, ensuring your system's Pango version is compatible, though this is not officially supported for older macOS versions.","message":"Starting with v0.6.1, ManimPango wheels for macOS require macOS 10.13 (High Sierra) or newer due to an upgrade in the bundled Pango library version. Users on older macOS versions may encounter installation or runtime errors.","severity":"breaking","affected_versions":">=0.6.1"},{"fix":"Ensure Pango, Cairo, and their development headers are installed on your Linux system. For Debian/Ubuntu: `sudo apt-get install libpango1.0-dev libcairo2-dev`. For Fedora: `sudo dnf install pango-devel cairo-devel`.","message":"While ManimPango wheels for Windows and macOS statically link Pango, Linux users (or those installing from source) still require system-level Pango and Cairo libraries to be installed. Missing these can lead to build or runtime errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Refer to the ManimPango documentation or source code for the exact changes to `register_font` if you encounter issues on Windows after upgrading to 0.6.0 or newer. Typically, this involves ensuring correct path handling and argument types.","message":"The `register_font` API on Windows received updates in v0.6.0. If you were using `register_font` on Windows with a version prior to 0.6.0, you might need to adjust your calls.","severity":"gotcha","affected_versions":">=0.6.0"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Run `pip install manimpango` to install the library.","cause":"The manimpango package is not installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'manimpango'"},{"fix":"On Linux, ensure system Pango and Cairo development libraries are installed (e.g., `sudo apt-get install libpango1.0-dev libcairo2-dev`). Ensure your environment variables are correctly set if you're using a custom Pango installation.","cause":"This error often indicates that the underlying Pango library or its initialization failed, usually due to missing system dependencies or an environment issue.","error":"Pango-CRITICAL **: no PangoFontMap currently set"},{"fix":"Ensure you are using the `0.x.x` stable API for `FontDescriptor` which expects a string like 'Family Style Weight Size'. Consult the latest documentation for `manimpango` 0.x.x.","cause":"This specific error string is highly unlikely for current versions, but similar TypeErrors might occur if you are calling FontDescriptor from an alpha `1.0.0a` version which had a breaking API rewrite or using an outdated tutorial.","error":"TypeError: FontDescriptor() takes no arguments"},{"fix":"Ensure you are using Python 3.8 or newer. If on macOS, ensure you are on 10.13+ for recent versions. If on Linux, you might need to ensure system dependencies are in place and try installing from source, or check if specific distributions exist for your environment.","cause":"Your Python version is too old for the available `manimpango` distributions on PyPI, or your operating system/architecture is not supported by the pre-built wheels.","error":"ERROR: Could not find a version that satisfies the requirement manimpango (from versions: none) ERROR: No matching distribution found for manimpango"}]}