diff options
author | Graeme Geldenhuys <graemeg@users.sourceforge.net> | 2007-05-18 14:50:52 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@users.sourceforge.net> | 2007-05-18 14:50:52 +0000 |
commit | 788ae16a47c2bd345ee1542b0bd6e4b2278258f6 (patch) | |
tree | f9ea535fd45f8926f50df3281ccc38c714dd73e5 /gfx/x11/gfx_x11.pas | |
parent | a0918f9ac872f34e4781264374ce451be608742f (diff) | |
download | fpGUI-788ae16a47c2bd345ee1542b0bd6e4b2278258f6.tar.xz |
* Added a new UTF8 Utils unit with some handy functions.
* Modified TFEdit to be UTF8 friendly. Needs testing.
* Modified the WidgetTest - Edit Fields form to show UTF8 text
in the TFEdit component for testing.
Diffstat (limited to 'gfx/x11/gfx_x11.pas')
-rw-r--r-- | gfx/x11/gfx_x11.pas | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gfx/x11/gfx_x11.pas b/gfx/x11/gfx_x11.pas index 7128c4bf..1deba25a 100644 --- a/gfx/x11/gfx_x11.pas +++ b/gfx/x11/gfx_x11.pas @@ -621,6 +621,7 @@ function TX11Canvas.TextExtent(const AText: String): TSize; var {$IFDEF XftSupport} extents : TXGlyphInfo; + WideText: WideString; {$ELSE} Direction, FontAscent, FontDescent: LongInt; CharStruct: TXCharStruct; @@ -634,7 +635,9 @@ begin else begin {$IFDEF XftSupport} - XftTextExtents8(GFApplication.Handle, FFontStruct.FontData, PChar(AText), Length(AText), extents); + WideText := Utf8Decode(AText); +// XftTextExtents8(GFApplication.Handle, FFontStruct.FontData, PChar(AText), Length(AText), extents); + XftTextExtents16(GFApplication.Handle, FFontStruct.FontData, PChar(WideText), Length(WideText), extents); Result.cx := extents.xOff; Result.cy := extents.yOff; {$ELSE} |