rpav / cl-cairo2

Cairo bindings for Common Lisp
https://github.com/rpav/cl-cairo2/wiki
Boost Software License 1.0
62 stars 15 forks source link

Is freetype font locking limited to xcb, xlib? #26

Open samuel-hunter opened 2 years ago

samuel-hunter commented 2 years ago

I'm learning cairo, so it's very possible I'm making a mistake here, so thank you ahead of time for your patience!

From what I know, Cairo exposes functions cairo_ft_scaled_font_lock_face and cairo_ft_scaled_font_unlock_face to make sure Freetype functions are not called simultaneously. cl-cairo2 wraps these two functions in the macro with-ft-scaled-face-locked. However, the two foreign functions that with-ft-scaled-face-locked uses are only available if I load either the system cl-cairo2-xcb or cl-cairo2-xlib.

I want to use Freetype fonts to write to a memory region attached to a Wayland wl_buffer. I'm under the impression that xcb and xlib are competitor libraries implementing the client-side of the X protocol, which I don't need for this use case. Do these libraries provide something beyond that, which Freetype font locking needs to work, or is this an artificial restriction?