Re: Get the default font in Gtk3



On Wed, Mar 28, 2018 at 08:20:21PM +0200, rastersoft wrote:
Hi all:

I want to paint in a Cairo canvas some letters, and I want to use the 
default tipografy and size from Gtk to give it coherence with all the 
buttons and so on, no matter if the user changes it. So the question is: 
how can I get it?

You don't.

No, you seriously don't.
Unless you want to do something fancy, all you need to do would be (in
 "draw" handler):

  layout = gtk_widget_get_pango_layout(widget)
  ...
  ...work on the layout (via pango API)...
  ...
  pango_cairo_show_layout(cr, layout)
  g_object_unref(layout)

That should cover much of normal text display on a widget.
pango_cairo_layout_path should cover most of the rest.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]