mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[WIN32K] / [GDI32]
- GetTextExtentExPointI and GetTextExtentPointI take an array of glyph indices, not characters. Pass a flag GTEF_INDICES (This is a reactos specific definition and not exactly like on Windows XP, but the real names/values are undocumented and this is the easiest way.) to NtGdiGetTextExtent/NtGdiGetTextExtentExW and handle this flag in TextIntGetTextExtentPoint to account for this. Fixes bug 3481 svn path=/trunk/; revision=48597
This commit is contained in:
@@ -173,7 +173,7 @@ GetTextExtentPointW(
|
||||
LPSIZE lpSize
|
||||
)
|
||||
{
|
||||
return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 1);
|
||||
return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ GetTextExtentExPointI(HDC hdc,
|
||||
LPINT alpDx,
|
||||
LPSIZE lpSize)
|
||||
{
|
||||
return NtGdiGetTextExtentExW(hdc,pgiIn,cgi,nMaxExtent,(ULONG *)lpnFit, (PULONG) alpDx,lpSize,1);
|
||||
return NtGdiGetTextExtentExW(hdc,pgiIn,cgi,nMaxExtent,(ULONG *)lpnFit, (PULONG) alpDx,lpSize,GTEF_INDICES);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -312,7 +312,7 @@ GetTextExtentPointI(HDC hdc,
|
||||
int cgi,
|
||||
LPSIZE lpSize)
|
||||
{
|
||||
return NtGdiGetTextExtent(hdc,pgiIn,cgi,lpSize,2);
|
||||
return NtGdiGetTextExtent(hdc,pgiIn,cgi,lpSize,GTEF_INDICES);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -192,6 +192,9 @@ typedef DWORD LFTYPE;
|
||||
#define GCABCW_NOFLOAT 0x0001
|
||||
#define GCABCW_INDICES 0x0002
|
||||
|
||||
// NtGdiGetTextExtent* flags (reactos own)
|
||||
#define GTEF_INDICES 0x1
|
||||
|
||||
/* CAPS1 support */
|
||||
#define CAPS1 94
|
||||
//#define C1_TRANSPARENT 0x0001
|
||||
|
||||
@@ -96,7 +96,7 @@ INT FASTCALL IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristi
|
||||
ULONG FASTCALL ftGdiGetGlyphOutline(PDC,WCHAR,UINT,LPGLYPHMETRICS,ULONG,PVOID,LPMAT2,BOOL);
|
||||
INT FASTCALL IntGetOutlineTextMetrics(PFONTGDI,UINT,OUTLINETEXTMETRICW *);
|
||||
BOOL FASTCALL ftGdiGetRasterizerCaps(LPRASTERIZER_STATUS);
|
||||
BOOL FASTCALL TextIntGetTextExtentPoint(PDC,PTEXTOBJ,LPCWSTR,INT,ULONG,LPINT,LPINT,LPSIZE);
|
||||
BOOL FASTCALL TextIntGetTextExtentPoint(PDC,PTEXTOBJ,LPCWSTR,INT,ULONG,LPINT,LPINT,LPSIZE,FLONG);
|
||||
BOOL FASTCALL ftGdiGetTextMetricsW(HDC,PTMW_INTERNAL);
|
||||
DWORD FASTCALL IntGetFontLanguageInfo(PDC);
|
||||
INT FASTCALL ftGdiGetTextCharsetInfo(PDC,PFONTSIGNATURE,DWORD);
|
||||
|
||||
@@ -75,7 +75,7 @@ GreGetKerningPairs(
|
||||
return Count;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
DWORD
|
||||
FASTCALL
|
||||
GreGetCharacterPlacementW(
|
||||
@@ -90,13 +90,14 @@ GreGetCharacterPlacementW(
|
||||
|
||||
if (!pgcpw)
|
||||
{
|
||||
if (GreGetTextExtentW( hdc, pwsz, nCount, &Size, 1))
|
||||
if (GreGetTextExtentW( hdc, pwsz, nCount, &Size, 0))
|
||||
return MAKELONG(Size.cx, Size.cy);
|
||||
return 0;
|
||||
}
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
INT
|
||||
FASTCALL
|
||||
@@ -167,7 +168,7 @@ IntGetCharDimensions(HDC hdc, PTEXTMETRICW ptm, PDWORD height)
|
||||
DC_UnlockDc(pdc);
|
||||
return 0;
|
||||
}
|
||||
Good = TextIntGetTextExtentPoint(pdc, TextObj, alphabet, 52, 0, NULL, 0, &sz);
|
||||
Good = TextIntGetTextExtentPoint(pdc, TextObj, alphabet, 52, 0, NULL, 0, &sz, 0);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
DC_UnlockDc(pdc);
|
||||
|
||||
|
||||
@@ -2123,7 +2123,8 @@ TextIntGetTextExtentPoint(PDC dc,
|
||||
ULONG MaxExtent,
|
||||
LPINT Fit,
|
||||
LPINT Dx,
|
||||
LPSIZE Size)
|
||||
LPSIZE Size,
|
||||
FLONG fl)
|
||||
{
|
||||
PFONTGDI FontGDI;
|
||||
FT_Face face;
|
||||
@@ -2195,7 +2196,11 @@ TextIntGetTextExtentPoint(PDC dc,
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
glyph_index = FT_Get_Char_Index(face, *String);
|
||||
if (fl & GTEF_INDICES)
|
||||
glyph_index = *String;
|
||||
else
|
||||
glyph_index = FT_Get_Char_Index(face, *String);
|
||||
|
||||
if (!(realglyph = ftGdiGlyphCacheGet(face, glyph_index,
|
||||
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)))
|
||||
{
|
||||
@@ -4238,16 +4243,17 @@ NtGdiGetGlyphIndicesW(
|
||||
IntLockFreeType;
|
||||
face = FontGDI->face;
|
||||
|
||||
if (DefChar == 0xffff && FT_IS_SFNT(face))
|
||||
{
|
||||
TT_OS2 *pOS2 = FT_Get_Sfnt_Table(face, ft_sfnt_os2);
|
||||
DefChar = (pOS2->usDefaultChar ? FT_Get_Char_Index(face, pOS2->usDefaultChar) : 0);
|
||||
}
|
||||
|
||||
for (i = 0; i < cwc; i++)
|
||||
{
|
||||
Buffer[i] = FT_Get_Char_Index(face, UnSafepwc[i]);
|
||||
Buffer[i] = FT_Get_Char_Index(face, UnSafepwc[i]); // FIXME: unsafe!
|
||||
if (Buffer[i] == 0)
|
||||
{
|
||||
if (DefChar == 0xffff && FT_IS_SFNT(face))
|
||||
{
|
||||
TT_OS2 *pOS2 = FT_Get_Sfnt_Table(face, ft_sfnt_os2);
|
||||
DefChar = (pOS2->usDefaultChar ? FT_Get_Char_Index(face, pOS2->usDefaultChar) : 0);
|
||||
}
|
||||
Buffer[i] = DefChar;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/** Functions *****************************************************************/
|
||||
|
||||
#if 0
|
||||
/*
|
||||
flOpts :
|
||||
GetTextExtentPoint32W = 0
|
||||
@@ -60,7 +61,8 @@ GreGetTextExtentW(
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
psize);
|
||||
psize,
|
||||
flOpts);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
@@ -123,7 +125,8 @@ GreGetTextExtentExW(
|
||||
MaxExtent,
|
||||
(LPINT)Fit,
|
||||
(LPINT)Dx,
|
||||
pSize);
|
||||
pSize,
|
||||
fl);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
@@ -132,6 +135,7 @@ GreGetTextExtentExW(
|
||||
DC_UnlockDc(pdc);
|
||||
return Result;
|
||||
}
|
||||
#endif
|
||||
|
||||
DWORD
|
||||
APIENTRY
|
||||
@@ -347,7 +351,8 @@ NtGdiGetTextExtentExW(
|
||||
MaxExtent,
|
||||
NULL == UnsafeFit ? NULL : &Fit,
|
||||
Dx,
|
||||
&Size);
|
||||
&Size,
|
||||
fl);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
@@ -420,7 +425,7 @@ NtGdiGetTextExtent(HDC hdc,
|
||||
LPSIZE psize,
|
||||
UINT flOpts)
|
||||
{
|
||||
return NtGdiGetTextExtentExW(hdc, lpwsz, cwc, 0, NULL, NULL, psize, 0);
|
||||
return NtGdiGetTextExtentExW(hdc, lpwsz, cwc, 0, NULL, NULL, psize, flOpts);
|
||||
}
|
||||
|
||||
BOOL
|
||||
|
||||
Reference in New Issue
Block a user