gtk2 intf: fixed pango bidi, bug #16271

git-svn-id: trunk@24628 -
This commit is contained in:
mattias 2010-04-15 08:38:02 +00:00
parent f916cc487f
commit 72259342cb
3 changed files with 13 additions and 0 deletions

View File

@ -72,6 +72,7 @@ begin
SetColors(FGColor, BGColor);
WidgetCont := pango_layout_get_context(AFont^.GDIFontObject);
OldMatrix := pango_context_get_matrix(WidgetCont);
NewMatrix.xx := 1.0;
NewMatrix.xy := 0.0;

View File

@ -44,6 +44,13 @@ function gdk_x11_image_get_ximage(image:PGdkImage):PXImage;cdecl;external gdklib
procedure laz_gdk_gc_set_dashes(gc:PGdkGC; dash_offset:gint;
dashlist:Pgint8; n:gint); cdecl; external gdkdll name 'gdk_gc_set_dashes';
// - - - - - - - - - pango extras - - - - - - - - -
function pango_unichar_direction(ch : gunichar) : TPangoDirection; cdecl; external pangolib;
// pango 1.4
function pango_find_base_dir(text : Pgchar; aLength : gint) : TPangoDirection; cdecl; external pangolib;
type
PPPangoAttrList = ^PPangoAttrList;
// pango 1.16

View File

@ -765,11 +765,13 @@ var
DevCtx: TGtk2DeviceContext absolute DC;
DCOrigin: TPoint;
yOffset: integer;
Direction : TPangoDirection;
begin
Result := IsValidDC(DC);
if not Result then Exit;
if Count <= 0 then Exit;
if DevCtx.HasTransf then
DevCtx.TransfPoint(X, Y);
@ -784,6 +786,9 @@ begin
DevCtx.SelectedColors := dcscCustom;
EnsureGCColor(DC, dccCurrentTextColor, True, False);
Direction := pango_find_base_dir(Str, Count);
pango_context_set_base_dir(@DevCtx, Direction);
DevCtx.DrawTextWithColors(Str, Count,
X + DCOrigin.X, Y + DCOrigin.Y + yOffset,
nil, nil);