Index: win32ss/gdi/ntgdi/freetype.c =================================================================== --- win32ss/gdi/ntgdi/freetype.c (revision 56865) +++ win32ss/gdi/ntgdi/freetype.c (working copy) @@ -3128,6 +3128,7 @@ POINT Start; BOOL DoBreak = FALSE; USHORT DxShift; + LONG lAlign; // TODO: Write test-cases to exactly match real Windows in different // bad parameters (e.g. does Windows check the DC or the RECT first?). @@ -3159,6 +3160,23 @@ goto fail; } + lAlign = pdcattr->lTextAlign; + + if (fuOptions & ETO_RTLREADING) lAlign |= TA_RTLREADING; + if (pdcattr->dwLayout & LAYOUT_RTL) + { + DPRINT("WARNING: Right to Left!\n"); + if ((lAlign & TA_CENTER) != TA_CENTER) lAlign ^= TA_RIGHT; + lAlign ^= TA_RTLREADING; + } + + if (lAlign & TA_UPDATECP) + { + IntGetCurrentPositionEx( dc, &Start ); + XStart = Start.x; + YStart = Start.y; + } + DxShift = fuOptions & ETO_PDY ? 1 : 0; if (PATH_IsPathOpen(dc->dclevel)) @@ -3295,9 +3313,9 @@ * Process the vertical alignment and determine the yoff. */ - if (pdcattr->lTextAlign & TA_BASELINE) + if (lAlign & TA_BASELINE) yoff = 0; - else if (pdcattr->lTextAlign & TA_BOTTOM) + else if (lAlign & TA_BOTTOM) yoff = -face->size->metrics.descender >> 6; else /* TA_TOP */ yoff = face->size->metrics.ascender >> 6; @@ -3309,7 +3327,7 @@ * Process the horizontal alignment and modify XStart accordingly. */ - if (pdcattr->lTextAlign & (TA_RIGHT | TA_CENTER)) + if (lAlign & (TA_RIGHT | TA_CENTER)) { ULONGLONG TextWidth = 0; LPCWSTR TempText = String; @@ -3373,7 +3391,7 @@ previous = 0; - if ((pdcattr->lTextAlign & TA_CENTER) == TA_CENTER) + if ((lAlign & TA_CENTER) == TA_CENTER) { RealXStart -= TextWidth / 2; }