mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:52:56 +00:00
Honour spacing requested by caller
svn path=/trunk/; revision=8963
This commit is contained in:
parent
a20876b230
commit
4eb5cb108b
1 changed files with 51 additions and 8 deletions
|
@ -22,7 +22,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: text.c,v 1.86 2004/03/28 22:39:59 gvg Exp $ */
|
/* $Id: text.c,v 1.87 2004/04/04 15:28:43 gvg Exp $ */
|
||||||
|
|
||||||
|
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
|
@ -1475,7 +1475,7 @@ NtGdiExtTextOut(
|
||||||
CONST RECT *lprc,
|
CONST RECT *lprc,
|
||||||
LPCWSTR String,
|
LPCWSTR String,
|
||||||
UINT Count,
|
UINT Count,
|
||||||
CONST INT *lpDx)
|
CONST INT *UnsafeDx)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* FIXME:
|
* FIXME:
|
||||||
|
@ -1508,12 +1508,28 @@ NtGdiExtTextOut(
|
||||||
PXLATEOBJ XlateObj, XlateObj2;
|
PXLATEOBJ XlateObj, XlateObj2;
|
||||||
ULONG Mode;
|
ULONG Mode;
|
||||||
FT_Render_Mode RenderMode;
|
FT_Render_Mode RenderMode;
|
||||||
BOOL Render;
|
BOOLEAN Render;
|
||||||
|
NTSTATUS Status;
|
||||||
|
INT *Dx = NULL;;
|
||||||
|
|
||||||
dc = DC_LockDc(hDC);
|
dc = DC_LockDc(hDC);
|
||||||
if (!dc)
|
if (!dc)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (NULL != UnsafeDx)
|
||||||
|
{
|
||||||
|
Dx = ExAllocatePoolWithTag(PagedPool, Count * sizeof(INT), TAG_GDITEXT);
|
||||||
|
if (NULL == Dx)
|
||||||
|
{
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
Status = MmCopyFromCaller(Dx, UnsafeDx, Count * sizeof(INT));
|
||||||
|
if (! NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SurfObj = (SURFOBJ*)AccessUserObject((ULONG) dc->Surface);
|
SurfObj = (SURFOBJ*)AccessUserObject((ULONG) dc->Surface);
|
||||||
|
|
||||||
XStart += dc->w.DCOrgX;
|
XStart += dc->w.DCOrgX;
|
||||||
|
@ -1655,14 +1671,26 @@ NtGdiExtTextOut(
|
||||||
|
|
||||||
if (dc->w.textAlign & (TA_RIGHT | TA_CENTER))
|
if (dc->w.textAlign & (TA_RIGHT | TA_CENTER))
|
||||||
{
|
{
|
||||||
UINT TextWidth;
|
UINT TextWidth = 0;
|
||||||
LPCWSTR TempText = String;
|
LPCWSTR TempText = String;
|
||||||
|
int Start;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate width of the text.
|
* Calculate width of the text.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (i = 0; i < Count; i++)
|
if (NULL != Dx)
|
||||||
|
{
|
||||||
|
Start = Count < 2 ? 0 : Count - 2;
|
||||||
|
TextWidth = Count < 2 ? 0 : Dx[Count - 2];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Start = 0;
|
||||||
|
}
|
||||||
|
TempText = String + Start;
|
||||||
|
|
||||||
|
for (i = Start; i < Count; i++)
|
||||||
{
|
{
|
||||||
IntLockFreeType;
|
IntLockFreeType;
|
||||||
glyph_index = FT_Get_Char_Index(face, *TempText);
|
glyph_index = FT_Get_Char_Index(face, *TempText);
|
||||||
|
@ -1700,7 +1728,7 @@ NtGdiExtTextOut(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
XStart -= TextWidth >> 1;
|
XStart -= TextWidth / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1730,7 +1758,7 @@ NtGdiExtTextOut(
|
||||||
glyph = face->glyph;
|
glyph = face->glyph;
|
||||||
|
|
||||||
/* retrieve kerning distance and move pen position */
|
/* retrieve kerning distance and move pen position */
|
||||||
if (use_kerning && previous && glyph_index)
|
if (use_kerning && previous && glyph_index && NULL == Dx)
|
||||||
{
|
{
|
||||||
FT_Vector delta;
|
FT_Vector delta;
|
||||||
IntLockFreeType;
|
IntLockFreeType;
|
||||||
|
@ -1815,7 +1843,14 @@ NtGdiExtTextOut(
|
||||||
|
|
||||||
EngDeleteSurface(HSourceGlyph);
|
EngDeleteSurface(HSourceGlyph);
|
||||||
|
|
||||||
|
if (NULL == Dx)
|
||||||
|
{
|
||||||
TextLeft += (glyph->advance.x + 32) >> 6;
|
TextLeft += (glyph->advance.x + 32) >> 6;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TextLeft += Dx[i];
|
||||||
|
}
|
||||||
previous = glyph_index;
|
previous = glyph_index;
|
||||||
|
|
||||||
String++;
|
String++;
|
||||||
|
@ -1831,6 +1866,10 @@ NtGdiExtTextOut(
|
||||||
}
|
}
|
||||||
BRUSHOBJ_UnlockBrush(hBrushFg);
|
BRUSHOBJ_UnlockBrush(hBrushFg);
|
||||||
NtGdiDeleteObject(hBrushFg);
|
NtGdiDeleteObject(hBrushFg);
|
||||||
|
if (NULL != Dx)
|
||||||
|
{
|
||||||
|
ExFreePool(Dx);
|
||||||
|
}
|
||||||
DC_UnlockDc(hDC);
|
DC_UnlockDc(hDC);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1847,6 +1886,10 @@ fail:
|
||||||
BRUSHOBJ_UnlockBrush(hBrushFg);
|
BRUSHOBJ_UnlockBrush(hBrushFg);
|
||||||
NtGdiDeleteObject(hBrushFg);
|
NtGdiDeleteObject(hBrushFg);
|
||||||
}
|
}
|
||||||
|
if (NULL != Dx)
|
||||||
|
{
|
||||||
|
ExFreePool(Dx);
|
||||||
|
}
|
||||||
DC_UnlockDc(hDC);
|
DC_UnlockDc(hDC);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue