Re: Get the default font in Gtk3




[get the Gtk font type and size]

Ops, sorry: I'm reworking a backup utility that I wrote (cronopete), and
I added a timeline with the backups (you can see an screenshot at
http://www.rastersoft.com/cronopete_screenshot.png ). As you can see, at
the left is the timeline and it has the days, months and years. I think
those should use the same typography than the standard Gtk widgets, but
reducing the size to 2/3. The same for the titles in each "pseudowindow"
(they have a visual effect: they go forward and backwards when you move
through the timeline).

...I must be missing something here...
You can change font size in a layout. The scrolling might be tricky, but
just eyeballing it, sounds like something that can be done by showing
the layout twice at different coords in different clips
(cairo_save/cairo_restore brackets).

So...?

(Only thing I'm not quite sure about right now is if gtk fully initializes
font description in a layout, cause I vaguely recall that it might
not... though maybe that was just wrt. theming API...)


Mainly the problem is that I'm using cairo_show_text... I presume that what you say is that I should replace all that with Pango... Now I have some problems: first, I'm using vala and I can't find the "get_pango_layout" from a widget. It exists "create_pango_layout", so I suppose that this is the call I need to create a layout. Now the big question is: does ANY widget return the right layout, or I must use a widget designed to contain text (like a Gtk.Label) to get that layout, paint into it, and paste it in the final Cairo canvas (which won't be the same canvas than the Gtk.Label from which I created the layout)?

Thanks.


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