gdi: Added implementation of GetCharABCWidthsI.

This commit is contained in:
Jeff Latimer 2006-04-19 19:20:50 +10:00 committed by Alexandre Julliard
parent 17de829096
commit 07767bfd28
5 changed files with 91 additions and 1 deletions

View File

@ -2358,6 +2358,55 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar,
}
/******************************************************************************
* GetCharABCWidthsI [GDI32.@]
*
* Retrieves widths of characters in range.
*
* PARAMS
* hdc [I] Handle of device context
* firstChar [I] First glyphs in range to query
* count [I] Last glyphs in range to query
* pgi [i] Array of glyphs to query
* abc [O] Address of character-width structure
*
* NOTES
* Only works with TrueType fonts
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL WINAPI GetCharABCWidthsI( HDC hdc, UINT firstChar, UINT count,
LPWORD pgi, LPABC abc)
{
DC *dc = DC_GetDCPtr(hdc);
unsigned int i;
BOOL ret = FALSE;
if (!dc) return FALSE;
if(dc->gdiFont)
ret = WineEngGetCharABCWidthsI( dc->gdiFont, firstChar, count, pgi, abc );
else
FIXME(": stub\n");
if (ret)
{
/* convert device units to logical */
for( i = firstChar; i <= count; i++, abc++ ) {
abc->abcA = INTERNAL_XDSTOWS(dc, abc->abcA);
abc->abcB = INTERNAL_XDSTOWS(dc, abc->abcB);
abc->abcC = INTERNAL_XDSTOWS(dc, abc->abcC);
}
ret = TRUE;
}
GDI_ReleaseObj(hdc);
return ret;
}
/***********************************************************************
* GetGlyphOutlineA (GDI32.@)
*/

View File

@ -3808,6 +3808,44 @@ BOOL WineEngGetCharABCWidths(GdiFont font, UINT firstChar, UINT lastChar,
return TRUE;
}
/*************************************************************
* WineEngGetCharABCWidthsI
*
*/
BOOL WineEngGetCharABCWidthsI(GdiFont font, UINT firstChar, UINT count, LPWORD pgi,
LPABC buffer)
{
UINT c;
GLYPHMETRICS gm;
FT_UInt glyph_index;
GdiFont linked_font;
if(!FT_IS_SCALABLE(font->ft_face))
return FALSE;
get_glyph_index_linked(font, 'a', &linked_font, &glyph_index);
if (!pgi)
for(c = firstChar; c < firstChar+count; c++) {
WineEngGetGlyphOutline(linked_font, c, GGO_METRICS | GGO_GLYPH_INDEX,
&gm, 0, NULL, NULL);
buffer[c - firstChar].abcA = linked_font->gm[c].lsb;
buffer[c - firstChar].abcB = linked_font->gm[c].bbx;
buffer[c - firstChar].abcC = linked_font->gm[c].adv - linked_font->gm[c].lsb
- linked_font->gm[c].bbx;
}
else
for(c = 0; c < count; c++) {
WineEngGetGlyphOutline(linked_font, pgi[c], GGO_METRICS | GGO_GLYPH_INDEX,
&gm, 0, NULL, NULL);
buffer[c].abcA = linked_font->gm[pgi[c]].lsb;
buffer[c].abcB = linked_font->gm[pgi[c]].bbx;
buffer[c].abcC = linked_font->gm[pgi[c]].adv
- linked_font->gm[pgi[c]].lsb - linked_font->gm[pgi[c]].bbx;
}
return TRUE;
}
/*************************************************************
* WineEngGetTextExtentPoint
*

View File

@ -237,7 +237,7 @@
@ stdcall GetCharABCWidthsA(long long long ptr)
@ stdcall GetCharABCWidthsFloatA(long long long ptr)
@ stdcall GetCharABCWidthsFloatW(long long long ptr)
# @ stub GetCharABCWidthsI
@ stdcall GetCharABCWidthsI(long long long ptr ptr)
@ stdcall GetCharABCWidthsW(long long long ptr)
@ stdcall GetCharWidth32A(long long long long)
@ stdcall GetCharWidth32W(long long long long)

View File

@ -367,6 +367,8 @@ extern BOOL WineEngDestroyFontInstance(HFONT handle);
extern DWORD WineEngEnumFonts(LPLOGFONTW, FONTENUMPROCW, LPARAM);
extern BOOL WineEngGetCharABCWidths(GdiFont font, UINT firstChar,
UINT lastChar, LPABC buffer);
extern BOOL WineEngGetCharABCWidthsI(GdiFont font, UINT firstChar,
UINT count, LPWORD pgi, LPABC buffer);
extern BOOL WineEngGetCharWidth(GdiFont, UINT, UINT, LPINT);
extern DWORD WineEngGetFontData(GdiFont, DWORD, DWORD, LPVOID, DWORD);
extern DWORD WineEngGetGlyphIndices(GdiFont font, LPCWSTR lpstr, INT count,

View File

@ -3394,6 +3394,7 @@ BOOL WINAPI GetCharABCWidthsW(HDC,UINT,UINT,LPABC);
BOOL WINAPI GetCharABCWidthsFloatA(HDC,UINT,UINT,LPABCFLOAT);
BOOL WINAPI GetCharABCWidthsFloatW(HDC,UINT,UINT,LPABCFLOAT);
#define GetCharABCWidthsFloat WINELIB_NAME_AW(GetCharABCWidthsFloat)
BOOL WINAPI GetCharABCWidthsI(HDC,UINT,UINT,LPWORD,LPABC);
DWORD WINAPI GetCharacterPlacementA(HDC,LPCSTR,INT,INT,GCP_RESULTSA*,DWORD);
DWORD WINAPI GetCharacterPlacementW(HDC,LPCWSTR,INT,INT,GCP_RESULTSW*,DWORD);
#define GetCharacterPlacement WINELIB_NAME_AW(GetCharacterPlacement)