gdi32: Implement GetTextExtentExPointI.
This commit is contained in:
parent
7a4e3a1011
commit
8487c2dd2a
@ -1144,34 +1144,40 @@ BOOL WINAPI GetTextExtentPoint32W(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* GetTextExtentPointI [GDI32.@]
|
* GetTextExtentExPointI [GDI32.@]
|
||||||
*
|
*
|
||||||
* Computes width and height of the array of glyph indices.
|
* Computes width and height of the array of glyph indices.
|
||||||
*
|
*
|
||||||
|
* PARAMS
|
||||||
|
* hdc [I] Handle of device context.
|
||||||
|
* indices [I] Glyph index array.
|
||||||
|
* count [I] Number of glyphs in array.
|
||||||
|
* max_ext [I] Maximum width in glyphs.
|
||||||
|
* nfit [O] Maximum number of characters.
|
||||||
|
* dxs [O] Partial string widths.
|
||||||
|
* size [O] Returned string size.
|
||||||
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI GetTextExtentPointI(
|
BOOL WINAPI GetTextExtentExPointI( HDC hdc, const WORD *indices, INT count, INT max_ext,
|
||||||
HDC hdc, /* [in] Handle of device context */
|
LPINT nfit, LPINT dxs, LPSIZE size )
|
||||||
const WORD *indices, /* [in] Address of glyph index array */
|
|
||||||
INT count, /* [in] Number of glyphs in array */
|
|
||||||
LPSIZE size) /* [out] Address of structure for string size */
|
|
||||||
{
|
{
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
DC * dc = DC_GetDCPtr( hdc );
|
DC * dc = DC_GetDCPtr( hdc );
|
||||||
if (!dc) return FALSE;
|
if (!dc) return FALSE;
|
||||||
|
|
||||||
if(dc->gdiFont) {
|
if(dc->gdiFont) {
|
||||||
ret = WineEngGetTextExtentPointI(dc->gdiFont, indices, count, size);
|
ret = WineEngGetTextExtentExPointI(dc->gdiFont, indices, count, max_ext, nfit, dxs, size);
|
||||||
size->cx = abs(INTERNAL_XDSTOWS(dc, size->cx));
|
size->cx = abs(INTERNAL_XDSTOWS(dc, size->cx));
|
||||||
size->cy = abs(INTERNAL_YDSTOWS(dc, size->cy));
|
size->cy = abs(INTERNAL_YDSTOWS(dc, size->cy));
|
||||||
size->cx += count * dc->charExtra;
|
size->cx += count * dc->charExtra;
|
||||||
}
|
}
|
||||||
else if(dc->funcs->pGetTextExtentExPoint) {
|
else if(dc->funcs->pGetTextExtentExPoint) {
|
||||||
FIXME("calling GetTextExtentExPoint\n");
|
FIXME("calling GetTextExtentExPoint\n");
|
||||||
ret = dc->funcs->pGetTextExtentExPoint( dc->physDev, (LPCWSTR)indices,
|
ret = dc->funcs->pGetTextExtentExPoint( dc->physDev, (LPCWSTR)indices,
|
||||||
count, 0, NULL, NULL, size );
|
count, max_ext, nfit, dxs, size );
|
||||||
}
|
}
|
||||||
|
|
||||||
DC_ReleaseDCPtr( dc );
|
DC_ReleaseDCPtr( dc );
|
||||||
@ -1181,6 +1187,26 @@ BOOL WINAPI GetTextExtentPointI(
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* GetTextExtentPointI [GDI32.@]
|
||||||
|
*
|
||||||
|
* Computes width and height of the array of glyph indices.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* hdc [I] Handle of device context.
|
||||||
|
* indices [I] Glyph index array.
|
||||||
|
* count [I] Number of glyphs in array.
|
||||||
|
* size [O] Returned string size.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: TRUE
|
||||||
|
* Failure: FALSE
|
||||||
|
*/
|
||||||
|
BOOL WINAPI GetTextExtentPointI( HDC hdc, const WORD *indices, INT count, LPSIZE size )
|
||||||
|
{
|
||||||
|
return GetTextExtentExPointI( hdc, indices, count, 0, NULL, NULL, size );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* GetTextExtentPointA (GDI32.@)
|
* GetTextExtentPointA (GDI32.@)
|
||||||
|
@ -4580,17 +4580,18 @@ BOOL WineEngGetTextExtentExPoint(GdiFont *font, LPCWSTR wstr, INT count,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
* WineEngGetTextExtentPointI
|
* WineEngGetTextExtentExPointI
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
BOOL WineEngGetTextExtentPointI(GdiFont *font, const WORD *indices, INT count,
|
BOOL WineEngGetTextExtentExPointI(GdiFont *font, const WORD *indices, INT count,
|
||||||
LPSIZE size)
|
INT max_ext, LPINT pnfit, LPINT dxs, LPSIZE size)
|
||||||
{
|
{
|
||||||
INT idx;
|
INT idx;
|
||||||
|
INT nfit = 0, ext;
|
||||||
GLYPHMETRICS gm;
|
GLYPHMETRICS gm;
|
||||||
TEXTMETRICW tm;
|
TEXTMETRICW tm;
|
||||||
|
|
||||||
TRACE("%p, %p, %d, %p\n", font, indices, count, size);
|
TRACE("%p, %p, %d, %d, %p\n", font, indices, count, max_ext, size);
|
||||||
|
|
||||||
size->cx = 0;
|
size->cx = 0;
|
||||||
WineEngGetTextMetrics(font, &tm);
|
WineEngGetTextMetrics(font, &tm);
|
||||||
@ -4600,9 +4601,19 @@ BOOL WineEngGetTextExtentPointI(GdiFont *font, const WORD *indices, INT count,
|
|||||||
WineEngGetGlyphOutline(font, indices[idx],
|
WineEngGetGlyphOutline(font, indices[idx],
|
||||||
GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL,
|
GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
size->cx += FONT_GM(font,indices[idx])->adv;
|
size->cx += FONT_GM(font,indices[idx])->adv;
|
||||||
|
ext = size->cx;
|
||||||
|
if (! pnfit || ext <= max_ext) {
|
||||||
|
++nfit;
|
||||||
|
if (dxs)
|
||||||
|
dxs[idx] = ext;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TRACE("return %d,%d\n", size->cx, size->cy);
|
|
||||||
|
if (pnfit)
|
||||||
|
*pnfit = nfit;
|
||||||
|
|
||||||
|
TRACE("return %d, %d, %d\n", size->cx, size->cy, nfit);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5129,8 +5140,8 @@ BOOL WineEngGetTextExtentExPoint(GdiFont *font, LPCWSTR wstr, INT count,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WineEngGetTextExtentPointI(GdiFont *font, const WORD *indices, INT count,
|
BOOL WineEngGetTextExtentExPointI(GdiFont *font, const WORD *indices, INT count,
|
||||||
LPSIZE size)
|
INT max_ext, LPINT nfit, LPINT dx, LPSIZE size)
|
||||||
{
|
{
|
||||||
ERR("called but we don't have FreeType\n");
|
ERR("called but we don't have FreeType\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -332,7 +332,7 @@
|
|||||||
@ stdcall GetTextCharsetInfo(long ptr long)
|
@ stdcall GetTextCharsetInfo(long ptr long)
|
||||||
@ stdcall GetTextColor(long)
|
@ stdcall GetTextColor(long)
|
||||||
@ stdcall GetTextExtentExPointA(long str long long ptr ptr ptr)
|
@ stdcall GetTextExtentExPointA(long str long long ptr ptr ptr)
|
||||||
# @ stub GetTextExtentExPointI
|
@ stdcall GetTextExtentExPointI(long ptr long long ptr ptr ptr)
|
||||||
@ stdcall GetTextExtentExPointW(long wstr long long ptr ptr ptr)
|
@ stdcall GetTextExtentExPointW(long wstr long long ptr ptr ptr)
|
||||||
# @ stub GetTextExtentExPointWPri
|
# @ stub GetTextExtentExPointWPri
|
||||||
@ stdcall GetTextExtentPoint32A(long str long ptr)
|
@ stdcall GetTextExtentPoint32A(long str long ptr)
|
||||||
|
@ -444,7 +444,7 @@ extern BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph
|
|||||||
extern UINT WineEngGetOutlineTextMetrics(GdiFont*, UINT, LPOUTLINETEXTMETRICW) DECLSPEC_HIDDEN;
|
extern UINT WineEngGetOutlineTextMetrics(GdiFont*, UINT, LPOUTLINETEXTMETRICW) DECLSPEC_HIDDEN;
|
||||||
extern UINT WineEngGetTextCharsetInfo(GdiFont *font, LPFONTSIGNATURE fs, DWORD flags) DECLSPEC_HIDDEN;
|
extern UINT WineEngGetTextCharsetInfo(GdiFont *font, LPFONTSIGNATURE fs, DWORD flags) DECLSPEC_HIDDEN;
|
||||||
extern BOOL WineEngGetTextExtentExPoint(GdiFont*, LPCWSTR, INT, INT, LPINT, LPINT, LPSIZE) DECLSPEC_HIDDEN;
|
extern BOOL WineEngGetTextExtentExPoint(GdiFont*, LPCWSTR, INT, INT, LPINT, LPINT, LPSIZE) DECLSPEC_HIDDEN;
|
||||||
extern BOOL WineEngGetTextExtentPointI(GdiFont*, const WORD *, INT, LPSIZE) DECLSPEC_HIDDEN;
|
extern BOOL WineEngGetTextExtentExPointI(GdiFont*, const WORD *, INT, INT, LPINT, LPINT, LPSIZE) DECLSPEC_HIDDEN;
|
||||||
extern INT WineEngGetTextFace(GdiFont*, INT, LPWSTR) DECLSPEC_HIDDEN;
|
extern INT WineEngGetTextFace(GdiFont*, INT, LPWSTR) DECLSPEC_HIDDEN;
|
||||||
extern BOOL WineEngGetTextMetrics(GdiFont*, LPTEXTMETRICW) DECLSPEC_HIDDEN;
|
extern BOOL WineEngGetTextMetrics(GdiFont*, LPTEXTMETRICW) DECLSPEC_HIDDEN;
|
||||||
extern BOOL WineEngFontIsLinked(GdiFont*) DECLSPEC_HIDDEN;
|
extern BOOL WineEngFontIsLinked(GdiFont*) DECLSPEC_HIDDEN;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user