{"id":17968540,"url":"https://github.com/rougier/freetype-py","last_synced_at":"2025-05-15T14:08:16.936Z","repository":{"id":16445813,"uuid":"19197576","full_name":"rougier/freetype-py","owner":"rougier","description":"Python binding for the freetype library","archived":false,"fork":false,"pushed_at":"2024-09-02T19:35:39.000Z","size":1583,"stargazers_count":315,"open_issues_count":41,"forks_count":88,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-05-15T13:58:12.494Z","etag":null,"topics":["bindings","freetype","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rougier.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-04-27T06:37:28.000Z","updated_at":"2025-05-04T20:38:33.000Z","dependencies_parsed_at":"2024-06-18T12:38:43.803Z","dependency_job_id":"3220bf46-ccc5-4519-8d31-f470a4dc9346","html_url":"https://github.com/rougier/freetype-py","commit_stats":{"total_commits":293,"total_committers":33,"mean_commits":8.878787878787879,"dds":0.7406143344709898,"last_synced_commit":"73d73801ec54c8d045e3d58f23a00efd9f022034"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rougier%2Ffreetype-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rougier%2Ffreetype-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rougier%2Ffreetype-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rougier%2Ffreetype-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rougier","download_url":"https://codeload.github.com/rougier/freetype-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355335,"owners_count":22057354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindings","freetype","python"],"created_at":"2024-10-29T14:40:39.348Z","updated_at":"2025-05-15T14:08:11.922Z","avatar_url":"https://github.com/rougier.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"FreeType (high-level Python API)\n================================\n\nFreetype Python provides bindings for the FreeType library. Only the\nhigh-level API is bound.\n\nDocumentation available at: http://freetype-py.readthedocs.org/en/latest/\n\nInstallation\n============\n\n**From PyPI, recommended**: `pip install freetype-py`. This will install the\nlibrary with a bundled FreeType binary, so you're ready to go on Windows,\nmacOS and Linux (all with 32 and 64 bit x86 architecture support).\n\nDo note: if you specify the `--no-binary` paramater to pip, or use a different\narchitecture for which we don't pre-compile binaries, the package will default\nto using an external FreeType library. Specify the environment variable\n`FREETYPEPY_BUNDLE_FT=1` before calling pip to compile a binary yourself.\n\nInstallation with compiling FreeType from source\n------------------------------------------------\n\nIf you don't want to or can't use the pre-built binaries, build FreeType\nyourself: `export FREETYPEPY_BUNDLE_FT=yesplease \u0026\u0026 pip install .`.\nThis will download and compile FreeType with Harfbuzz support as specified in\n`setup-build-freetype.py`. Set the environment variable `PYTHON_ARCH` to 32 or\n64 to explicitly set an architecture, default is whatever your host machine\nuses. On macOS, we will always build a universal 32 and 64 bit Intel binary.\n\n- Windows: You need CMake and a C and C++ compiler, e.g. the Visual Code\n  Community 2017 distribution with the desktop C++ workload.\n- macOS: You need CMake and the XCode tools (full IDE not necessary)\n- Linux: You need CMake, gcc and g++. For building a 32 bit library on a\n  64 bit machine, you need gcc-multilib and g++-multilib (Debian) or\n  glibc-devel.i686 and libstdc++-devel.i686 (Fedora).\n\nInstallation with an external FreeType library (the default)\n------------------------------------------------------------\n\nInstall just the pure Python library and let it find a system-wide installed\nFreeType at runtime.\n\nMac users\n~~~~~~~~~\n\nFreetype should be already installed on your system. If not, either install it\nusing `homebrew \u003chttp://brew.sh\u003e`_ or compile it and place the library binary\nfile in '/usr/local/lib'.\n\nLinux users\n~~~~~~~~~~~\n\nFreetype should be already installed on your system. If not, either install\nrelevant package from your package manager or compile from sources and place\nthe library binary file in '/usr/local/lib'.\n\nWindow users\n~~~~~~~~~~~~\n\nThere are no official Freetype binary releases available, but they offer some\nlinks to precompiled Windows DLLs. Please see the `FreeType Downloads\n\u003chttps://www.freetype.org/download.html\u003e`_ page for links.\nYou can also compile the FreeType library from source yourself.\n\nIf you are using freetype-py on Windows with a 32-Bit version of Python, you\nneed the 32-Bit version of the Freetype binary. The same applies for a 64-Bit\nversion of Python.\n\nBecause of the way Windows searches for dll files, make sure the resulting\nfile is named 'freetype.dll' (and not something like Freetype245.dll).\nWindows expects the library in one of the directories listed in the $PATH\nenvironment variable. As it is not recommended to place the dll in a Windows\nsystem folder, you can choose one of the following ways to solve this:\n\n* Place library in a folder of your choice and edit the $PATH user\n  environment variable\n* Place library in a folder of your choice and edit the $PATH system\n  environment variable\n* For development purpose, place the library in the working directory of\n  the application\n* Place the library in one of the existing directories listed in $PATH\n\nTo get a complete list of all the directories in the $PATH\nenvironment variable (user and system), open a command promt and type\n\n.. code::\n\n   echo %PATH%\n\nUsage example\n=============\n\n.. code:: python\n\n   import freetype\n   face = freetype.Face(\"Vera.ttf\")\n   face.set_char_size( 48*64 )\n   face.load_char('S')\n   bitmap = face.glyph.bitmap\n   print(bitmap.buffer)\n\nScreenshots\n===========\n\nScreenshot below comes from the wordle.py example. No clever tricks here, just\nbrute force.\n\n.. image:: https://raw.githubusercontent.com/rougier/freetype-py/master/doc/_static/wordle.png\n\nScreenshots below comes from the glyph-vector.py and glyph-vector-2.py\nexamples showing how to access a glyph outline information and use it to draw\nthe glyph. Rendering (with Bézier curves) is done using matplotlib.\n\n.. image:: https://raw.githubusercontent.com/rougier/freetype-py/master/doc/_static/S.png\n.. image:: https://raw.githubusercontent.com/rougier/freetype-py/master/doc/_static/G.png\n\n\nScreenshot below comes from the glyph-color.py showing how to draw and combine\na glyph outline with the regular glyph.\n\n.. image:: https://raw.githubusercontent.com/rougier/freetype-py/master/doc/_static/outline.png\n\nThe screenshot below comes from the hello-world.py example showing how to draw\ntext in a bitmap (that has been zoomed in to show antialiasing).\n\n.. image:: https://raw.githubusercontent.com/rougier/freetype-py/master/doc/_static/hello-world.png\n\n\nThe screenshot below comes from the agg-trick.py example showing an\nimplementation of ideas from the `Texts Rasterization Exposures\n\u003chttp://agg.sourceforge.net/antigrain.com/research/font_rasterization/\u003e`_ by\nMaxim Shemarev.\n\n.. image:: https://raw.githubusercontent.com/rougier/freetype-py/master/doc/_static/agg-trick.png\n\n\nFreezing apps\n=============\n\nFreetype implements a hook for PyInstaller to help simplify the freezing process\n(it e.g. ensures that the freetype DLL is included). This hook requires\nPyInstaller version 4+.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frougier%2Ffreetype-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frougier%2Ffreetype-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frougier%2Ffreetype-py/lists"}