diff options
author | Graeme Geldenhuys <graemeg@users.sourceforge.net> | 2007-05-18 13:23:50 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@users.sourceforge.net> | 2007-05-18 13:23:50 +0000 |
commit | a0918f9ac872f34e4781264374ce451be608742f (patch) | |
tree | ac8b90f9b377d07817bda050d411d98747555c8d /gfx/x11/gfx_x11.pas | |
parent | c9a588b70ba776903edf4d7b9d95965c3ac4ccfc (diff) | |
download | fpGUI-a0918f9ac872f34e4781264374ce451be608742f.tar.xz |
* Fixed a bug introduced in r100 where Forms are not displayed anymore
under Linux (X11).
* Renamed all internal component names that started with a hash (#) to
a underscore (_). For some reason a hash+<text> may not be used as
a component name anymore. Must be a FPC 2.1.3 thing.
* UTF8 support has been added to GFX/X11. This still needs some more
testing, but it seems to be fine.
Diffstat (limited to 'gfx/x11/gfx_x11.pas')
-rw-r--r-- | gfx/x11/gfx_x11.pas | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/gfx/x11/gfx_x11.pas b/gfx/x11/gfx_x11.pas index ad50f149..7128c4bf 100644 --- a/gfx/x11/gfx_x11.pas +++ b/gfx/x11/gfx_x11.pas @@ -287,7 +287,7 @@ uses GELImage ,fpGFX {$IFDEF XftSupport} - ,schar16 // Unicode support +// ,schar16 // Unicode support {$ENDIF} ; @@ -652,7 +652,7 @@ procedure TX11Canvas.DoTextOut(const APosition: TPoint; const AText: String); {$IFDEF XftSupport} var fntColor: TXftColor; - s: String16; + WideText: WideString; procedure SetXftColor(c: TGfxPixel; var colxft: TXftColor); begin @@ -672,14 +672,20 @@ begin Exit; //==> {$IFDEF XftSupport} -// fnt := XftFontOpenName(GFApplication.Handle, XDefaultScreen(GFApplication.Handle), PChar('Sans-12')); + WideText := Utf8Decode(AText); + SetXftColor(FCurColor,fntColor); -// s := u8(AText); XftDrawSetClip(FXftDraw, FRegion); - XftDrawString8(FXftDraw, fntColor, FFontStruct.FontData, APosition.x, - Aposition.y + FFontStruct.GetAscent, PChar(AText), Length(AText)); -// XftDrawString16(FXftDraw, fntColor, fnt, APosition.x, Aposition.y * 3, @s[1], Length16(s)); -// XftFontClose(GFApplication.Handle, fnt); +// XftDrawString8(FXftDraw, fntColor, FFontStruct.FontData, APosition.x, +// Aposition.y + FFontStruct.GetAscent, PChar(AText), Length(AText)); + + XftDrawString16(FXftDraw, fntColor, FFontStruct.FontData, APosition.x, + Aposition.y + FFontStruct.GetAscent, PChar(WideText), Length(WideText)); + +// pasgf implementation +// XftDrawString16(FXftDraw, FColorTextXft, FCurFontRes.Handle, x, +// y+FCurFontRes.GetAscent, @txt[1], Length(txt) ) + {$ELSE} XDrawString(GFApplication.Handle, Handle, GC, APosition.x, APosition.y + FFontStruct.GetAscent, PChar(AText), Length(AText)); @@ -1572,6 +1578,7 @@ end; { Makes the window visible and raises it to the top of the stack. } procedure TX11Window.Show; begin + GFApplication.AddWindow(self); XMapRaised(GFApplication.Handle, Handle); end; |