Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[directfb-users] Re: How to control size, style and other attributes of fonts on widgets
bheemesh <firstname.lastname@example.org> writes:
> Here in my code, i just mention 3 different UTF-8 strings as labels on 3
> diffrerent buttons, and i am not mentioning any font related info here.
> But still the pango is able to render proper language fonts. I went in
> fonts-cache-1 file & tried to swapp the font files in terms of their order.
> But still it's abl;e to render exact language fonts, so i want know how
> exactly ht epango is able to map excat .ttf files for a given UTF-8 string.
You will have to read the source if you want to know how this happens
in detail. I still don't understand why you care though. It works; why
would you worry how it works?
About your code examples:
fd = pango_font_description_from_string("Sampige 20");
win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_size_request(win, 400, 400);
gl = gtk_fixed_new();
button = gtk_button_new();
gtk_fixed_put(GTK_FIXED(gl), button, 24, 70);
gtk_widget_set_size_request(button, 344, 62);
I don't see why you are using gtk_widget_create_pango_layout()
here. You aren't using the return value so all this does it leaking
some memory. You should set the text on the button instead.
Your second code example is complete nonsense. Please excuse my
wording but what you are doing there shows some major misunderstanding
of how GTK+ and Pango works. I suggest you take a look at the API
reference, the tutorials (especially the drawing examples) and some
working GTK+ code. Your approach of adding some functions that you
think might perhaps do the right thing is doomed to fail.
Info: To unsubscribe send a mail to email@example.com with
"unsubscribe directfb-users" as subject.
Main Index |