Commit 07767bfd authored by Jeff Latimer's avatar Jeff Latimer Committed by Alexandre Julliard

gdi: Added implementation of GetCharABCWidthsI.

parent 17de8290
...@@ -2358,6 +2358,55 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, ...@@ -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.@) * GetGlyphOutlineA (GDI32.@)
*/ */
......
...@@ -3809,6 +3809,44 @@ BOOL WineEngGetCharABCWidths(GdiFont font, UINT firstChar, UINT lastChar, ...@@ -3809,6 +3809,44 @@ BOOL WineEngGetCharABCWidths(GdiFont font, UINT firstChar, UINT lastChar,
} }
/************************************************************* /*************************************************************
* 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 * WineEngGetTextExtentPoint
* *
*/ */
......
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
@ stdcall GetCharABCWidthsA(long long long ptr) @ stdcall GetCharABCWidthsA(long long long ptr)
@ stdcall GetCharABCWidthsFloatA(long long long ptr) @ stdcall GetCharABCWidthsFloatA(long long long ptr)
@ stdcall GetCharABCWidthsFloatW(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 GetCharABCWidthsW(long long long ptr)
@ stdcall GetCharWidth32A(long long long long) @ stdcall GetCharWidth32A(long long long long)
@ stdcall GetCharWidth32W(long long long long) @ stdcall GetCharWidth32W(long long long long)
......
...@@ -367,6 +367,8 @@ extern BOOL WineEngDestroyFontInstance(HFONT handle); ...@@ -367,6 +367,8 @@ extern BOOL WineEngDestroyFontInstance(HFONT handle);
extern DWORD WineEngEnumFonts(LPLOGFONTW, FONTENUMPROCW, LPARAM); extern DWORD WineEngEnumFonts(LPLOGFONTW, FONTENUMPROCW, LPARAM);
extern BOOL WineEngGetCharABCWidths(GdiFont font, UINT firstChar, extern BOOL WineEngGetCharABCWidths(GdiFont font, UINT firstChar,
UINT lastChar, LPABC buffer); 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 BOOL WineEngGetCharWidth(GdiFont, UINT, UINT, LPINT);
extern DWORD WineEngGetFontData(GdiFont, DWORD, DWORD, LPVOID, DWORD); extern DWORD WineEngGetFontData(GdiFont, DWORD, DWORD, LPVOID, DWORD);
extern DWORD WineEngGetGlyphIndices(GdiFont font, LPCWSTR lpstr, INT count, extern DWORD WineEngGetGlyphIndices(GdiFont font, LPCWSTR lpstr, INT count,
......
...@@ -3394,6 +3394,7 @@ BOOL WINAPI GetCharABCWidthsW(HDC,UINT,UINT,LPABC); ...@@ -3394,6 +3394,7 @@ BOOL WINAPI GetCharABCWidthsW(HDC,UINT,UINT,LPABC);
BOOL WINAPI GetCharABCWidthsFloatA(HDC,UINT,UINT,LPABCFLOAT); BOOL WINAPI GetCharABCWidthsFloatA(HDC,UINT,UINT,LPABCFLOAT);
BOOL WINAPI GetCharABCWidthsFloatW(HDC,UINT,UINT,LPABCFLOAT); BOOL WINAPI GetCharABCWidthsFloatW(HDC,UINT,UINT,LPABCFLOAT);
#define GetCharABCWidthsFloat WINELIB_NAME_AW(GetCharABCWidthsFloat) #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 GetCharacterPlacementA(HDC,LPCSTR,INT,INT,GCP_RESULTSA*,DWORD);
DWORD WINAPI GetCharacterPlacementW(HDC,LPCWSTR,INT,INT,GCP_RESULTSW*,DWORD); DWORD WINAPI GetCharacterPlacementW(HDC,LPCWSTR,INT,INT,GCP_RESULTSW*,DWORD);
#define GetCharacterPlacement WINELIB_NAME_AW(GetCharacterPlacement) #define GetCharacterPlacement WINELIB_NAME_AW(GetCharacterPlacement)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment