Pango: Alternative to deprecated pango_fc_font_lock_face api?

Hello,

I’m working on an application that subclasses PangoRenderer to produced cached text to render in OpenGL. (Source: https://github.com/Librelancer/Librelancer/tree/master/src/pangogame/src )

As a part of this rendering process I use pango_fc_font_lock_face so I can rasterize glyphs to an atlas. This api is now deprecated, and the suggested replacement of accessing the underlying Harfbuzz face doesn’t seem to provide a way to rasterize the glyphs.

Is there a better option for this?

You can use PangoCairo to draw in a Cairo surface and then upload the image data to the texture.

https://developer.gnome.org/pango/unstable/pango-Cairo-Rendering.html

GTK4 uses this approach in its OpenGL and Vulkan GSK renderers: https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gsk/gl/gskglglyphcache.c#L113