Behdad Esfahbod | 31d48dd | 2015-01-21 01:57:44 -0800 | [diff] [blame] | 1 | To enable HarfBuzz bindings for Python among other languages, make sure |
Behdad Esfahbod | c60f3c8 | 2015-05-04 23:10:32 -0700 | [diff] [blame] | 2 | you have latest version of gobject-introspection available. On Ubuntu, |
| 3 | you can install that this way: |
| 4 | |
Ebrahim Byagowi | 5f7f0bf | 2018-03-29 04:22:53 +0430 | [diff] [blame] | 5 | ```bash |
| 6 | sudo apt-get install libgirepository1.0-dev |
| 7 | ``` |
Behdad Esfahbod | c60f3c8 | 2015-05-04 23:10:32 -0700 | [diff] [blame] | 8 | |
Ebrahim Byagowi | cac483b | 2020-08-03 18:41:49 +0430 | [diff] [blame] | 9 | And then run `meson setup` and make sure that `Introspection` is reported |
| 10 | enabled in output. |
Behdad Esfahbod | 31d48dd | 2015-01-21 01:57:44 -0800 | [diff] [blame] | 11 | |
| 12 | Compile and install. |
| 13 | |
Khaled Hosny | 06596cf | 2019-08-03 13:55:34 +0200 | [diff] [blame] | 14 | Make sure you have the installation lib dir in `LD_LIBRARY_PATH`, as needed |
Behdad Esfahbod | 31d48dd | 2015-01-21 01:57:44 -0800 | [diff] [blame] | 15 | for the linker to find the library. |
| 16 | |
Khaled Hosny | 06596cf | 2019-08-03 13:55:34 +0200 | [diff] [blame] | 17 | Then make sure you also have `GI_TYPELIB_PATH` pointing to the resulting |
| 18 | `$prefix/lib/girepository-*` directory. |
Behdad Esfahbod | 31d48dd | 2015-01-21 01:57:44 -0800 | [diff] [blame] | 19 | |
| 20 | Make sure you have pygobject installed. Then check that the following |
Bruce Mitchener | 257d0e5 | 2018-10-19 22:49:21 +0700 | [diff] [blame] | 21 | import works in your Python interpreter: |
Behdad Esfahbod | 31d48dd | 2015-01-21 01:57:44 -0800 | [diff] [blame] | 22 | |
Ebrahim Byagowi | 5f7f0bf | 2018-03-29 04:22:53 +0430 | [diff] [blame] | 23 | ```python |
| 24 | from gi.repository import HarfBuzz |
| 25 | ``` |
Behdad Esfahbod | 31d48dd | 2015-01-21 01:57:44 -0800 | [diff] [blame] | 26 | |
| 27 | If it does, you are ready to call HarfBuzz from Python! Congratulations. |
Khaled Hosny | 06596cf | 2019-08-03 13:55:34 +0200 | [diff] [blame] | 28 | See [`src/sample.py`](src/sample.py). |
Behdad Esfahbod | 31d48dd | 2015-01-21 01:57:44 -0800 | [diff] [blame] | 29 | |
| 30 | The Python API will change. Let us know on the mailing list if you are |
| 31 | using it, and send lots of feedback. |