How to show text on drawing area?

I use the toy implementation cairo_show_text() to display text, I think it’s enough for me.

However, I input the UTF-8 string (Chinese characters) to cairo_show_text(), the rendered result is just hollow block.

Note that, all my other GTK widgets can display UTF-8 well.

What’s the reason? Could anyone help me? Or should I use other APIs to show text on drawing area?

Create a PangoLayout using the GtkWidget API and then use PangoCairo to draw the layout on the Cairo context.

1 Like

@ebassi Thank you very much! :grinning: :wink:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.