Include PangoFT2 introspection typelibs in gi.repository
Summary:
I have created an addition to Inkex that allows it to parse text and calculate bounding boxes without a call to the Inkscape binary. It is using the Python GTK libraries, which calls Pango using the PyGObject libaries. It is already working most of the time, but fails on certain fonts because it does not currently have access to PangoFT2 introspection. In other words, the following line fails:
from gi.repository import PangoFT2
with the error
File "C:\Program Files\Inkscape\lib\python3.10\site-packages\gi\importer.py", line 136, in load_module
raise ImportError('cannot import name %s, '
ImportError: cannot import name PangoFT2, introspection typelib not found
I have confirmed that if the following introspection typelibs are included, the issue can be resolved:
PangoFT2-1.0.typelib
freetype2-2.0.typelib
PangoFc-1.0.typelib
fontconfig-2.0.typelib
These are not large (a couple KB each), so it would be great if these could be included in all versions. (In fact, I see little reason why all of the PyGObject typelibs shouldn't be included.)
Version info
Inkscape 1.2.1 (9c6d41e410, 2022-07-14)
GLib version: 2.72.2
GTK version: 3.24.34
glibmm version: 2.66.4
gtkmm version: 3.24.6
libxml2 version: 2.9.14
libxslt version: 1.1.35
Cairo version: 1.17.6
Pango version: 1.50.7
HarfBuzz version: 4.4.1
OS version: Windows 10 21H1