[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-app-devel
Subject:    Re: Get the default font in Gtk3
From:       Rafał Mużyło <galtgendo () o2 ! pl>
Date:       2018-03-28 21:02:46
Message-ID: 20180328210246.GD3437 () blackspire2
[Download RAW message or body]

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.

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic