{ "info": { "author": "Marco Giusti", "author_email": "marco.giusti@posteo.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries" ], "description": "###########################\nCFFI binding for fontconfig\n###########################\n\nThis package try to be a complete python binding for fontconfig.\n\nThis package contains two modules: the low level ``_fontconfig``\\ , that\nmatches the C APIs, and ``fc``\\ , that is an higher abstraction over it.\n\nThe C API::\n\n int FcGetVersion(void);\n \nin ``_fontconfig``::\n\n _fontconfig.FcGetVersion()\n\nin ``fc``::\n\n fc.get_version()\n\nInstallation\n============\n\nThis package requires the `enum34`_ package. Install it via pypi:\n\n.. code-block:: console\n\n $ pip install enum34\n\nor use your distribution's package:\n\n.. code-block:: console\n\n $ apt-get install python-enum34\n\nTo compile the ``_fontconfig`` extension, the following C headers are\nrequired:\n\n.. code-block:: C\n\n #include \n #include \n #include \n #include FT_FREETYPE_H // usually \n\nand the package `cffi`_. In Debian the following packages are enough:\n\n.. code-block:: console\n\n $ apt-get install python-cffi libfontconfig1-dev libfreetype6-dev\n\nFinally, to install the package itself:\n\n.. code-block:: console\n\n $ pip install fontconfig\n\n.. _enum34: https://pypi.python.org/pypi/enum34\n.. _cffi: https://pypi.python.org/pypi/cffi\n\n``_fontconfig`` module\n======================\n\nThe module ``_fontconfig`` exports few simbols to test the capabilities\nof the underlying library. These are:\n\n* ``PYFC_HAS_DirCacheRescan``\n* ``PYFC_HAS_FcRange``\n\nUsage:\n------\n\n.. code-block:: pycon\n\n >>> import _fontconfig\n >>> print _fontconfig.lib.FcGetVersion()\n 21100\n >>> _fontconfig.lib.FcInit() # init the library\n 1\n >>> config = _fontconfig.lib.FcConfigGetCurrent()\n >>> sl = _fontconfig.lib.FcConfigGetConfigDirs(config)\n >>> while True:\n ... s = _fontconfig.lib.FcStrListNext(sl)\n ... if not s:\n ... break\n ... print _fontconfig.ffi.string(s) # doctest: +ELLIPSIS\n ...\n /usr/share/fonts\n /usr/X11R6/lib/X11/fonts\n /usr/local/share/fonts\n ...\n >>> _fontconfig.lib.FcStrListDone(sl)\n\n``fc`` module\n=============\n\nThe ``fc`` module would be an higher abstraction moudule but it is still\nuncomplete.\n\nUsage:\n------\n\nThe same snippet as above:\n\n.. code-block:: pycon\n\n >>> import fc\n >>> fc.get_version() # fontconfig's version\n (2, 11, 0)\n >>> fc.init()\n >>> config = fc.FcConfig.get_current()\n >>> config.get_config_dirs() # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE\n ['/usr/share/fonts', '/usr/X11R6/lib/X11/fonts',\n '/usr/local/share/fonts', ...]\n\nFew more examples:\n\n.. code-block:: pycon\n\n >>> fc.__version__ # python library's version\n '0.1'\n >>> pattern = config.get_fonts(fc.SetName.system)[0]\n >>> pattern.name_unparse() # doctest: +ELLIPSIS\n '21 Kilobyte Salute:...'\n >>> config.get_font_dirs() # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE\n ['/usr/share/fonts', '/usr/X11R6/lib/X11/fonts',\n '/usr/local/share/fonts', ...]\n >>> pat = fc.FcPattern.name_parse(\"dejavu serif\")\n >>> for font in config.font_list(pat, [fc.PropertyName.file]):\n ... print(font.name_unparse()) # doctest: +ELLIPSIS\n ...\n :file=/usr/share/fonts/truetype/dejavu/DejaVuSerif-BoldItalic.ttf\n :file=/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed.ttf\n ...\n\n\n.. vim:ft=rst:tw=72:et:sts=3:sw=3", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/gm/fontconfig", "keywords": "fontconfig,cffi", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "fontconfig", "package_url": "https://pypi.org/project/fontconfig/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/fontconfig/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/gm/fontconfig" }, "release_url": "https://pypi.org/project/fontconfig/0.1/", "requires_dist": null, "requires_python": null, "summary": "CFFI bindings for fontconfig", "version": "0.1" }, "last_serial": 2170693, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "cd798e5696a9542fd0ee801061c77f4b", "sha256": "35bebcee549445497f3f5b21893f4901739a56ac4209df33c9e1df450efcce98" }, "downloads": -1, "filename": "fontconfig-0.1.zip", "has_sig": false, "md5_digest": "cd798e5696a9542fd0ee801061c77f4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 121960, "upload_time": "2016-06-16T11:55:17", "url": "https://files.pythonhosted.org/packages/d1/01/0a1ce055ab89acd13050fe9b0833be3ce8a0a07ec5450ddf1d1812016a3a/fontconfig-0.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cd798e5696a9542fd0ee801061c77f4b", "sha256": "35bebcee549445497f3f5b21893f4901739a56ac4209df33c9e1df450efcce98" }, "downloads": -1, "filename": "fontconfig-0.1.zip", "has_sig": false, "md5_digest": "cd798e5696a9542fd0ee801061c77f4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 121960, "upload_time": "2016-06-16T11:55:17", "url": "https://files.pythonhosted.org/packages/d1/01/0a1ce055ab89acd13050fe9b0833be3ce8a0a07ec5450ddf1d1812016a3a/fontconfig-0.1.zip" } ] }