I think, that file 'INCLUDE\EQUATES\GDI32.INC' (FASM 1.67.23) should have two definitions (for ANSI and Unicode) of structure 'TEXTMETRIC' (as it is for example in 'wingdi.h' from Dev-C++ package), because using
existing (ANSI) definition of 'TEXTMETRIC' causes an error in 'GetTextMetricsW' procedure.
Simple explanation of this:
- 'GetTextMetricsW' expects a pointer to 57-byte variant of 'TEXTMETRIC',
- 'GetTextMetricsA' expects a pointer to 53-byte variant of 'TEXTMETRIC'.
I propose to add presented below definition of 'TEXTMETRICW' structure to 'INCLUDE\EQUATES\GDI32.INC': struct TEXTMETRICW
tmHeight dd ?
tmAscent dd ?
tmDescent dd ?
tmInternalLeading dd ?
tmExternalLeading dd ?
tmAveCharWidth dd ?
tmMaxCharWidth dd ?
tmWeight dd ?
tmOverhang dd ?
tmDigitizedAspectX dd ?
tmDigitizedAspectY dd ?
tmFirstChar dw ?
tmLastChar dw ?
tmDefaultChar dw ?
tmBreakChar dw ?
tmItalic db ?
tmUnderlined db ?
tmStruckOut db ?
tmPitchAndFamily db ?
tmCharSet db ?
ends
Existing definition (ANSI version) of 'TEXTMETRIC' structure from 'INCLUDE\EQUATES\GDI32.INC':
struct TEXTMETRIC
tmHeight dd ?
tmAscent dd ?
tmDescent dd ?
tmInternalLeading dd ?
tmExternalLeading dd ?
tmAveCharWidth dd ?
tmMaxCharWidth dd ?
tmWeight dd ?
tmOverhang dd ?
tmDigitizedAspectX dd ?
tmDigitizedAspectY dd ?
tmFirstChar db ?
tmLastChar db ?
tmDefaultChar db ?
tmBreakChar db ?
tmItalic db ?
tmUnderlined db ?
tmStruckOut db ?
tmPitchAndFamily db ?
tmCharSet db ?
ends
Definitions of 'TEXTMETRIC' variants in 'wingdi.h':
typedef struct tagTEXTMETRICA {
LONG tmHeight;
LONG tmAscent;
LONG tmDescent;
LONG tmInternalLeading;
LONG tmExternalLeading;
LONG tmAveCharWidth;
LONG tmMaxCharWidth;
LONG tmWeight;
LONG tmOverhang;
LONG tmDigitizedAspectX;
LONG tmDigitizedAspectY;
BYTE tmFirstChar;
BYTE tmLastChar;
BYTE tmDefaultChar;
BYTE tmBreakChar;
BYTE tmItalic;
BYTE tmUnderlined;
BYTE tmStruckOut;
BYTE tmPitchAndFamily;
BYTE tmCharSet;
} TEXTMETRICA,*PTEXTMETRICA,*LPTEXTMETRICA;
typedef struct tagTEXTMETRICW {
LONG tmHeight;
LONG tmAscent;
LONG tmDescent;
LONG tmInternalLeading;
LONG tmExternalLeading;
LONG tmAveCharWidth;
LONG tmMaxCharWidth;
LONG tmWeight;
LONG tmOverhang;
LONG tmDigitizedAspectX;
LONG tmDigitizedAspectY;
WCHAR tmFirstChar;
WCHAR tmLastChar;
WCHAR tmDefaultChar;
WCHAR tmBreakChar;
BYTE tmItalic;
BYTE tmUnderlined;
BYTE tmStruckOut;
BYTE tmPitchAndFamily;
BYTE tmCharSet;
} TEXTMETRICW,*PTEXTMETRICW,*LPTEXTMETRICW;