summaryrefslogtreecommitdiff
path: root/gfx/x11
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@users.sourceforge.net>2007-05-18 14:50:52 +0000
committerGraeme Geldenhuys <graemeg@users.sourceforge.net>2007-05-18 14:50:52 +0000
commit788ae16a47c2bd345ee1542b0bd6e4b2278258f6 (patch)
treef9ea535fd45f8926f50df3281ccc38c714dd73e5 /gfx/x11
parenta0918f9ac872f34e4781264374ce451be608742f (diff)
downloadfpGUI-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')
-rw-r--r--gfx/x11/fpgfxpackage.lpk6
-rw-r--r--gfx/x11/fpgfxpackage.pas2
-rw-r--r--gfx/x11/gfx_x11.pas5
3 files changed, 10 insertions, 3 deletions
diff --git a/gfx/x11/fpgfxpackage.lpk b/gfx/x11/fpgfxpackage.lpk
index c58916a3..5c02e39b 100644
--- a/gfx/x11/fpgfxpackage.lpk
+++ b/gfx/x11/fpgfxpackage.lpk
@@ -21,7 +21,7 @@
<License Value="Modified LGPL
"/>
<Version Minor="4"/>
- <Files Count="9">
+ <Files Count="10">
<Item1>
<Filename Value="../gfxbase.pas"/>
<UnitName Value="GfxBase"/>
@@ -58,6 +58,10 @@
<Filename Value="../commandlineparams.pas"/>
<UnitName Value="CommandLineParams"/>
</Item9>
+ <Item10>
+ <Filename Value="../fputf8utils.pas"/>
+ <UnitName Value="fpUTF8Utils"/>
+ </Item10>
</Files>
<LazDoc Paths="../../docs/xml/gfx/"/>
<RequiredPkgs Count="1">
diff --git a/gfx/x11/fpgfxpackage.pas b/gfx/x11/fpgfxpackage.pas
index 84c4bda2..f6e51e3b 100644
--- a/gfx/x11/fpgfxpackage.pas
+++ b/gfx/x11/fpgfxpackage.pas
@@ -8,7 +8,7 @@ interface
uses
GfxBase, GFX_X11, gfxinterface, schar16, unitkeys, fpgfx, GELDirty, GELImage,
- CommandLineParams;
+ CommandLineParams, fpUTF8Utils;
implementation
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}