diff --git a/docs/usermanual-integration.xml b/docs/usermanual-integration.xml index d46361e7e..1085e96c5 100644 --- a/docs/usermanual-integration.xml +++ b/docs/usermanual-integration.xml @@ -547,32 +547,43 @@ internal copy of ICU, by specifying the --with-icu=builtin compile-time option. - - -
Python bindings - + As noted in the section, + HarfBuzz uses a feature called GObject + Introspection (GI) to provide bindings for Python. - + At compile time, the GI scanner analyzes the HarfBuzz C source + and builds metadata objects connecting the language bindings to + the C library. Your Python code can then use the HarfBuzz binary + through its Python interface. - + HarfBuzz's Python bindings support Python 2 and Python 3. To use + them, you will need to have the pygobject + package installed. Then you should import + HarfBuzz from + gi.repository: -
- -
- + + from gi.repository import HarfBuzz + - + and you can call HarfBuzz functions from Python. Sample code can + be found in the sample.py script in the + HarfBuzz src directory. - + Do note, however, that the Python API is subject to change + without advance notice. GI allows the bindings to be + automatically updated, which is one of its advantages, but you + may need to update your Python code.