We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was toying with PyCairo to see if it had the capability to display emojis from the OpenMoji SVG-in-OT font.
import cairo import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk def draw(da, ctx): ctx.move_to(80, 80) ctx.set_font_size(40.0) ctx.show_text("Hello, World!") extent = ctx.text_extents("Hello, World!") ctx.rel_move_to(extent.x_bearing, 0) ctx.select_font_face("OpenMoji") ctx.show_text(" 🌎") def main(): win = Gtk.Window() win.connect("destroy", lambda w: Gtk.main_quit()) win.set_default_size(450, 180) drawingarea = Gtk.DrawingArea() win.add(drawingarea) drawingarea.connect("draw", draw) win.show_all() Gtk.main() if __name__ == "__main__": main()
But things didn't work out as it doesn't render the globe and it throws a context save and restore mismatch error.
Traceback (most recent call last): File "test.py", line 13, in draw ctx.show_text(" 🌎") cairo.Error: Context.restore() without matching Context.save() (test.py:2278413): Gtk-WARNING **: 12:05:02.802: drawing failure for widget 'GtkDrawingArea': cairo_restore() without matching cairo_save() (test.py:2278413): Gtk-WARNING **: 12:05:02.802: drawing failure for widget 'GtkWindow': cairo_restore() without matching cairo_save()
Though if I use Noto Color Emoji instead no error is emitted and I can see the globe. Any ideas?
Noto Color Emoji
The text was updated successfully, but these errors were encountered:
This looks like an issue in the cairo library itself, not pycairo the python binding to cairographics.
Sorry, something went wrong.
No branches or pull requests
I was toying with PyCairo to see if it had the capability to display emojis from the OpenMoji SVG-in-OT font.
But things didn't work out as it doesn't render the globe and it throws a context save and restore mismatch error.
Though if I use
Noto Color Emoji
instead no error is emitted and I can see the globe. Any ideas?The text was updated successfully, but these errors were encountered: