Partial implementation of GetOutlineTextMetrics32A.

Added structures for OUTLINETEXTMETRICS.
This commit is contained in:
Moshe Vainer 1998-10-14 18:15:43 +00:00 committed by Alexandre Julliard
parent 27bb362fe1
commit 4a150e7753
4 changed files with 207 additions and 7 deletions

View File

@ -218,7 +218,7 @@ file gdi.exe
305 stub ENGINEGETGLYPHBMP
306 stub ENGINEMAKEFONTDIR
307 pascal16 GetCharABCWidths(word word word ptr) GetCharABCWidths16
308 pascal GetOutlineTextMetrics(word word ptr) GetOutlineTextMetrics16
308 pascal16 GetOutlineTextMetrics(word word ptr) GetOutlineTextMetrics16
309 pascal GetGlyphOutline(word word word ptr long ptr ptr) GetGlyphOutline16
310 pascal16 CreateScalableFontResource(word str str str) CreateScalableFontResource16
311 stub GetFontData

View File

@ -1499,6 +1499,135 @@ typedef struct
DECL_WINELIB_TYPE_AW(TEXTMETRIC)
DECL_WINELIB_TYPE_AW(LPTEXTMETRIC)
typedef struct tagPANOSE
{
BYTE bFamilyType;
BYTE bSerifStyle;
BYTE bWeight;
BYTE bProportion;
BYTE bContrast;
BYTE bStrokeVariation;
BYTE bArmStyle;
BYTE bLetterform;
BYTE bMidline;
BYTE bXHeight;
} PANOSE;
typedef struct _OUTLINETEXTMETRIC32A
{
UINT32 otmSize;
TEXTMETRIC32A otmTextMetrics;
BYTE otmFilter;
PANOSE otmPanoseNumber;
UINT32 otmfsSelection;
UINT32 otmfsType;
INT32 otmsCharSlopeRise;
INT32 otmsCharSlopeRun;
INT32 otmItalicAngle;
UINT32 otmEMSquare;
INT32 otmAscent;
INT32 otmDescent;
UINT32 otmLineGap;
UINT32 otmsCapEmHeight;
UINT32 otmsXHeight;
RECT32 otmrcFontBox;
INT32 otmMacAscent;
INT32 otmMacDescent;
UINT32 otmMacLineGap;
UINT32 otmusMinimumPPEM;
POINT32 otmptSubscriptSize;
POINT32 otmptSubscriptOffset;
POINT32 otmptSuperscriptSize;
POINT32 otmptSuperscriptOffset;
UINT32 otmsStrikeoutSize;
INT32 otmsStrikeoutPosition;
INT32 otmsUnderscoreSize;
INT32 otmsUnderscorePosition;
LPSTR otmpFamilyName;
LPSTR otmpFaceName;
LPSTR otmpStyleName;
LPSTR otmpFullName;
} OUTLINETEXTMETRIC32A, *LPOUTLINETEXTMETRIC32A;
typedef struct _OUTLINETEXTMETRIC32W
{
UINT32 otmSize;
TEXTMETRIC32W otmTextMetrics;
BYTE otmFilter;
PANOSE otmPanoseNumber;
UINT32 otmfsSelection;
UINT32 otmfsType;
INT32 otmsCharSlopeRise;
INT32 otmsCharSlopeRun;
INT32 otmItalicAngle;
UINT32 otmEMSquare;
INT32 otmAscent;
INT32 otmDescent;
UINT32 otmLineGap;
UINT32 otmsCapEmHeight;
UINT32 otmsXHeight;
RECT32 otmrcFontBox;
INT32 otmMacAscent;
INT32 otmMacDescent;
UINT32 otmMacLineGap;
UINT32 otmusMinimumPPEM;
POINT32 otmptSubscriptSize;
POINT32 otmptSubscriptOffset;
POINT32 otmptSuperscriptSize;
POINT32 otmptSuperscriptOffset;
UINT32 otmsStrikeoutSize;
INT32 otmsStrikeoutPosition;
INT32 otmsUnderscoreSize;
INT32 otmsUnderscorePosition;
LPSTR otmpFamilyName;
LPSTR otmpFaceName;
LPSTR otmpStyleName;
LPSTR otmpFullName;
} OUTLINETEXTMETRIC32W, *LPOUTLINETEXTMETRIC32W;
typedef struct _OUTLINETEXTMETRIC16
{
UINT16 otmSize;
TEXTMETRIC16 otmTextMetrics;
BYTE otmFilter;
PANOSE otmPanoseNumber;
UINT16 otmfsSelection;
UINT16 otmfsType;
INT16 otmsCharSlopeRise;
INT16 otmsCharSlopeRun;
INT16 otmItalicAngle;
UINT16 otmEMSquare;
INT16 otmAscent;
INT16 otmDescent;
UINT16 otmLineGap;
UINT16 otmsCapEmHeight;
UINT16 otmsXHeight;
RECT16 otmrcFontBox;
INT16 otmMacAscent;
INT16 otmMacDescent;
UINT16 otmMacLineGap;
UINT16 otmusMinimumPPEM;
POINT16 otmptSubscriptSize;
POINT16 otmptSubscriptOffset;
POINT16 otmptSuperscriptSize;
POINT16 otmptSuperscriptOffset;
UINT16 otmsStrikeoutSize;
INT16 otmsStrikeoutPosition;
INT16 otmsUnderscoreSize;
INT32 otmsUnderscorePosition;
LPSTR otmpFamilyName;
LPSTR otmpFaceName;
LPSTR otmpStyleName;
LPSTR otmpFullName;
} OUTLINETEXTMETRIC16,*LPOUTLINETEXTMETRIC16;
DECL_WINELIB_TYPE_AW(OUTLINETEXTMETRIC)
DECL_WINELIB_TYPE_AW(LPOUTLINETEXTMETRIC)
/* ntmFlags field flags */
#define NTM_REGULAR 0x00000040L
#define NTM_BOLD 0x00000020L
@ -7964,10 +8093,9 @@ INT32 WINAPI GetObject32W(HANDLE32,INT32,LPVOID);
HWND16 WINAPI GetOpenClipboardWindow16(void);
HWND32 WINAPI GetOpenClipboardWindow32(void);
#define GetOpenClipboardWindow WINELIB_NAME(GetOpenClipboardWindow)
/* FIXME: LPVOID should be LPOUTLINETEXTMETRIC{16,32A,32W} */
UINT16 WINAPI GetOutlineTextMetrics16(HDC16,UINT16,LPVOID);
UINT32 WINAPI GetOutlineTextMetrics32A(HDC32,UINT32,LPVOID);
UINT32 WINAPI GetOutlineTextMetrics32W(HDC32,UINT32,LPVOID);
UINT16 WINAPI GetOutlineTextMetrics16(HDC16,UINT16,LPOUTLINETEXTMETRIC16);
UINT32 WINAPI GetOutlineTextMetrics32A(HDC32,UINT32,LPOUTLINETEXTMETRIC32A);
UINT32 WINAPI GetOutlineTextMetrics32W(HDC32,UINT32,LPOUTLINETEXTMETRIC32W);
#define GetOutlineTextMetrics WINELIB_NAME_AW(GetOutlineTextMetrics)
UINT16 WINAPI GetPaletteEntries16(HPALETTE16,UINT16,UINT16,LPPALETTEENTRY);
UINT32 WINAPI GetPaletteEntries32(HPALETTE32,UINT32,UINT32,LPPALETTEENTRY);

View File

@ -930,13 +930,85 @@ BOOL32 WINAPI GetTextMetrics32W( HDC32 hdc, TEXTMETRIC32W *metrics )
UINT16 WINAPI GetOutlineTextMetrics16(
HDC16 hdc, /* [in] Handle of device context */
UINT16 cbData, /* [in] Size of metric data array */
void *lpOTM) /* [out] Address of metric data array */
LPOUTLINETEXTMETRIC16 lpOTM) /* [out] Address of metric data array */
{
FIXME(font, "(%04x,%04x,%p): stub\n", hdc,cbData,lpOTM);
return 0;
}
/***********************************************************************
* GetOutlineTextMetrics [GDI.207] Gets metrics for TrueType fonts.
*
*
* RETURNS
* Success: Non-zero or size of required buffer
* Failure: 0
*/
UINT32 WINAPI GetOutlineTextMetrics32A(
HDC32 hdc, /* [in] Handle of device context */
UINT32 cbData, /* [in] Size of metric data array */
LPOUTLINETEXTMETRIC32A lpOTM) /* [out] Address of metric data array */
{
UINT32 rtn = FALSE;
LPTEXTMETRIC32A lptxtMetr;
if (lpOTM == 0)
{
lpOTM = (LPOUTLINETEXTMETRIC32A)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(OUTLINETEXTMETRIC32A));
rtn = sizeof(OUTLINETEXTMETRIC32A);
cbData = rtn;
} else
{
cbData = sizeof(*lpOTM);
rtn = cbData;
};
lpOTM->otmSize = cbData;
lptxtMetr =HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(TEXTMETRIC32A));
if (!GetTextMetrics32A(hdc,lptxtMetr))
{
return 0;
} else
{
memcpy(&(lpOTM->otmTextMetrics),lptxtMetr,sizeof(TEXTMETRIC32A));
};
HeapFree(GetProcessHeap(),HEAP_ZERO_MEMORY,lptxtMetr);
lpOTM->otmFilter = 0;
lpOTM->otmPanoseNumber.bFamilyType = 0;
lpOTM->otmPanoseNumber.bSerifStyle = 0;
lpOTM->otmPanoseNumber.bWeight = 0;
lpOTM->otmPanoseNumber.bProportion = 0;
lpOTM->otmPanoseNumber.bContrast = 0;
lpOTM->otmPanoseNumber.bStrokeVariation = 0;
lpOTM->otmPanoseNumber.bArmStyle = 0;
lpOTM->otmPanoseNumber.bLetterform = 0;
lpOTM->otmPanoseNumber.bMidline = 0;
lpOTM->otmPanoseNumber.bXHeight = 0;
lpOTM->otmfsSelection = 0;
lpOTM->otmfsType = 0;
/*
Further fill of the structure not implemented,
Needs real values for the structure members
*/
return rtn;
}
/***********************************************************************
* GetCharWidth16 (GDI.350)
*/

View File

@ -208,7 +208,7 @@ type win32
204 stdcall GetObjectA(long long ptr) GetObject32A
205 stdcall GetObjectType(long) GetObjectType
206 stdcall GetObjectW(long long ptr) GetObject32W
207 stub GetOutlineTextMetricsA
207 stdcall GetOutlineTextMetricsA(long long ptr) GetOutlineTextMetrics32A
208 stub GetOutlineTextMetricsW
209 stdcall GetPaletteEntries(long long long ptr) GetPaletteEntries32
210 stdcall GetPath(long ptr ptr long) GetPath32