Pango Win32 developing request
- From: "Christopher Hubmann" <chubmann aaitg com>
- To: gtk-i18n-list gnome org
- Subject: Pango Win32 developing request
- Date: Fri, 24 Aug 2007 14:01:46 +0200
Hi All,
I am currently trying to accomplish the following task:
I want to simply render a string containing unicode chars to a
DeviceContext using the pangowin32 engine,
but i can't find a single line of sample code searching the internet.
My main problems are:
1) How do i properly initialize the Win32 Engine for Pango?
2) How do i create a PangoGlyphString out of a given Unicode String in
combination with a created PangoFont?
3) How do i render the PangoGlyphString to a HDC?
Here are the fragments what i've got so far by reading the doxygen
documentation:
// Initialize pango
PangoEngine* *pango_engine =
script_engine_create(PANGO_RENDER_TYPE_WIN32);
HDC hdc_screen = pango_win32_get_dc();
PangoContext *pango =
pango_win32_get_context();
PangoFontMap *pango_font_map =
pango_win32_font_map_for_display();
PangoWin32FontCache *pango_font_cache =
pango_win32_font_map_get_font_cache(pango_font_map);
// DEBUG VALUES
char family[] = {"Microsoft Sans"};
unsigned long weight = 10;
unsigned long stretch = 1;
unsigned long style = 1;
unsigned long variant = 1;
// Create pango font
PangoFontDescription *pango_font_desc =
pango_font_description_new();
pango_font_description_set_family(pango_font_desc, family);
pango_font_description_set_weight(pango_font_desc,
(PangoWeight)weight);
pango_font_description_set_stretch(pango_font_desc,
(PangoStretch)stretch);
pango_font_description_set_style(pango_font_desc, (PangoStyle)style);
pango_font_description_set_variant(pango_font_desc,
(PangoVariant)variant);
PangoFont* pango_font = pango_font_map_load_font(pango_font_map,
pango, pango_font_desc);
pango_font_description_free(pango_font_desc);
Any help would be greatly appreciated!
Kind Regards,
Chris H.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]