GTK+, building a display



I already searched and asked for this on the GTK+/GTK+Devel lists but I
didn't get any answer, so I'll ask again: is there any way to set the font
width or height size? I mean, not the font size in points but the font width
or height in pixels. I'm doing a display in GTK+ for a POS emulator and I
need to set the font width and font height to get some efects like "double
width" or "double height". At the moment I'm using some functions from the
Pango lib, like "pango_matrix_scale" and "pango_layout_get_pixel_size", to
do this, but this is very annoying, since I have to start from a size in
points like 0.5 and go to something like MAX_TEST_SIZE, testing all the
values from "pango_layout_get_pixel_size" to see if any of them is in my
desirable font width or height. I don't need to say that this consumes a lot
of time and CPU usage.

Another way to see my problem is answering this question: if I have a
display with 168x136 pixels and 21x8 cols what font size, in points, should
I use that best fits this display?

The display size can change (the user can change the skins) at runtime, so I
must recalculate this every time.

Leonel Freire



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