xref: /aosp_15_r20/external/harfbuzz_ng/README.python.md (revision 2d1272b857b1f7575e6e246373e1cb218663db8a)
1*2d1272b8SAndroid Build Coastguard WorkerTo enable HarfBuzz bindings for Python among other languages, make sure
2*2d1272b8SAndroid Build Coastguard Workeryou have latest version of gobject-introspection available.  On Ubuntu,
3*2d1272b8SAndroid Build Coastguard Workeryou can install that this way:
4*2d1272b8SAndroid Build Coastguard Worker
5*2d1272b8SAndroid Build Coastguard Worker```bash
6*2d1272b8SAndroid Build Coastguard Workersudo apt-get install libgirepository1.0-dev
7*2d1272b8SAndroid Build Coastguard Worker```
8*2d1272b8SAndroid Build Coastguard Worker
9*2d1272b8SAndroid Build Coastguard WorkerAnd then run `meson setup` and make sure that `Introspection` is reported
10*2d1272b8SAndroid Build Coastguard Workerenabled in output.
11*2d1272b8SAndroid Build Coastguard Worker
12*2d1272b8SAndroid Build Coastguard WorkerIf you are building with Visual Studio, it is recommended that Visual Studio
13*2d1272b8SAndroid Build Coastguard Worker2019 or later is used for this build, for the best build experience.
14*2d1272b8SAndroid Build Coastguard Worker
15*2d1272b8SAndroid Build Coastguard WorkerCompile and install.
16*2d1272b8SAndroid Build Coastguard Worker
17*2d1272b8SAndroid Build Coastguard WorkerMake sure you have the installation lib dir in `LD_LIBRARY_PATH` (or the
18*2d1272b8SAndroid Build Coastguard Workerinstallation DLL dir in `PATH` for Windows systems), as needed
19*2d1272b8SAndroid Build Coastguard Workerfor the linker to find the library.
20*2d1272b8SAndroid Build Coastguard Worker
21*2d1272b8SAndroid Build Coastguard WorkerThen make sure you also have `GI_TYPELIB_PATH` pointing to the resulting
22*2d1272b8SAndroid Build Coastguard Worker`$prefix/lib/girepository-*` directory.
23*2d1272b8SAndroid Build Coastguard Worker
24*2d1272b8SAndroid Build Coastguard WorkerMake sure you have pygobject installed.  Then check that the following
25*2d1272b8SAndroid Build Coastguard Workerimport works in your Python interpreter:
26*2d1272b8SAndroid Build Coastguard Worker
27*2d1272b8SAndroid Build Coastguard Worker```python
28*2d1272b8SAndroid Build Coastguard Workerfrom gi.repository import HarfBuzz
29*2d1272b8SAndroid Build Coastguard Worker```
30*2d1272b8SAndroid Build Coastguard Worker
31*2d1272b8SAndroid Build Coastguard WorkerIf it does, you are ready to call HarfBuzz from Python!  Congratulations.
32*2d1272b8SAndroid Build Coastguard WorkerSee [`src/sample.py`](src/sample.py).
33*2d1272b8SAndroid Build Coastguard Worker
34*2d1272b8SAndroid Build Coastguard WorkerThe Python API will change.  Let us know on the mailing list if you are
35*2d1272b8SAndroid Build Coastguard Workerusing it, and send lots of feedback.
36