Hi,

bheemesh <[EMAIL PROTECTED]> 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:

void my_code()
{
        GtkWidget *win;
        GtkWidget *gl;
        GtkWidget *button;

        PangoFontDescription *fd;
        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();
        gtk_container_add(GTK_CONTAINER(win), gl);

        button = gtk_button_new();
        gtk_fixed_put(GTK_FIXED(gl), button, 24, 70);
        gtk_widget_set_size_request(button, 344, 62);

        gtk_widget_create_pango_layout(button, first_button);
        gtk_widget_modify_font(button, fd);

        gtk_widget_show_all(win);
}

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.


Sven





-- 
Info: To unsubscribe send a mail to [EMAIL PROTECTED] with 
"unsubscribe directfb-users" as subject.

Reply via email to