pangowin32 usage



Hi,

I'm using pango-1.12.1.

I use the follow code to render some text on a win32 hdc. (linking
with pangowin32-1.0.lib glib-2.0.lib pango-1.0.lib), It compiles and
links correct. But nothing happens.

#include <pango/pangowin32.h>

...
case WM_PAINT:
		hdc = BeginPaint(hWnd, &ps);
        OnDraw(hdc);
		EndPaint(hWnd, &ps);
		break;
...

void OnDraw (HDC hdc)
{
    PangoLayout *layout;
    PangoFontDescription *desc;
    PangoContext *context;

    context = pango_win32_get_context();
    layout = pango_layout_new (context);
    pango_layout_set_text (layout, "Text", -1);
    desc = pango_font_description_from_string ("Sans Bold 27");
    pango_layout_set_font_description (layout, desc);
    pango_font_description_free (desc);
    pango_win32_update_layout(hdc, layout, 20, 20);
    pango_win32_render_layout(hdc, layout, 20, 20);
}

Did I miss something important to set?

I'm wondering if there is any way to troubleshoot this (or where to obtain a
debug version of pango?)

Regards,
jjgod.



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