* gtk2_font.cpp: GTK2 implementation of the Font class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: gtk2_font.cpp,v 1.5 2003/04/16 21:40:07 ipkiss Exp $
+ * $Id: gtk2_font.cpp,v 1.6 2003/04/17 10:42:41 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
{
msg_Err( _p_intf, "Could not load font %s", fontname.c_str());
}*/
+ Context = gdk_pango_context_get();
+ Layout = pango_layout_new( Context );
}
//---------------------------------------------------------------------------
GTK2Font::~GTK2Font()
/*FIXME*/
/* w = gdk_text_width( GFont, text.c_str(), text.length() );
h = gdk_text_height( GFont, text.c_str(), text.length() );*/
- w = 0;
- h = 0;
+ w = 100;
+ h = 50;
}
//---------------------------------------------------------------------------
void GTK2Font::GenericPrint( Graphics *dest, string text, int x, int y,
int w, int h, int align, int color )
{
+ GdkDrawable *drawable = ( (GTK2Graphics *)dest )->GetImage();
+ GdkGC *gc = ( (GTK2Graphics *)dest )->GetGC();
/* HDC DC = ( (GTK2Graphics *)dest )->GetImageHandle();
// Set boundaries
LPRECT r = new RECT;
// Free memory
delete r;*/
+ pango_layout_set_text( Layout, text.c_str(), text.length() );
+ gdk_draw_layout( drawable, gc, x, y, Layout );
}
//---------------------------------------------------------------------------
* gtk2_font.h: GTK2 implementation of the Font class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: gtk2_font.h,v 1.2 2003/04/13 17:46:22 asmax Exp $
+ * $Id: gtk2_font.h,v 1.3 2003/04/17 10:42:41 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
class GTK2Font : Font
{
private:
- GdkFont *GFont;
+ PangoContext *Context;
+ PangoLayout *Layout;
// Assign font to Device Context
virtual void AssignFont( Graphics *dest );
// void AssignGTK2Font( HDC DC );