Commit 965b2852 authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

Do conversions between the font size specified in points (or

decipoints) and height specified in logical units.
parent 32f296b6
......@@ -45,9 +45,9 @@ typedef struct
INT AddFontFamily(const LOGFONTA *lplf, UINT nFontType, LPCHOOSEFONTA lpcf,
HWND hwnd, LPCFn_ENUMSTRUCT e);
INT AddFontStyle(const ENUMLOGFONTEXA *lpElfex, UINT nFontType,
LPCHOOSEFONTA lpcf, HWND hcmb2,
HWND hcmb3, HWND hDlg, BOOL iswin16);
INT AddFontStyle(const ENUMLOGFONTEXA *lpElfex, const TEXTMETRICA *metrics,
UINT nFontType, LPCHOOSEFONTA lpcf, HWND hcmb2, HWND hcmb3,
HWND hDlg, BOOL iswin16);
void _dump_cf_flags(DWORD cflags);
LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
......
......@@ -59,6 +59,14 @@ static void FONT_LogFont16To32A( const LPLOGFONT16 font16, LPLOGFONTA font32 )
lstrcpynA( font32->lfFaceName, font16->lfFaceName, LF_FACESIZE );
};
static void FONT_Metrics16To32A( const TEXTMETRIC16 *pm16, TEXTMETRICA *pm32a)
{
ZeroMemory( pm32a, sizeof(TEXTMETRICA));
/* NOTE: only the fields used by AddFontStyle() are filled in */
pm32a->tmHeight = pm16->tmHeight;
pm32a->tmExternalLeading = pm16->tmExternalLeading;
};
static void CFn_CHOOSEFONT16to32A(LPCHOOSEFONT16 chf16, LPCHOOSEFONTA chf32a)
{
chf32a->lStructSize=sizeof(CHOOSEFONTA);
......@@ -117,10 +125,13 @@ INT16 WINAPI FontStyleEnumProc16( SEGPTR logfont, SEGPTR metrics,
HWND hDlg=GetParent(hcmb3);
LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
LOGFONT16 *lplf = MapSL(logfont);
TEXTMETRIC16 *lpmtrx16 = MapSL(metrics);
ENUMLOGFONTEXA elf32a;
TEXTMETRICA mtrx32a;
FONT_LogFont16To32A(lplf, &(elf32a.elfLogFont));
return AddFontStyle(&elf32a, nFontType, (LPCHOOSEFONTA)lpcf->lpTemplateName,
hcmb2, hcmb3, hDlg, TRUE);
FONT_Metrics16To32A(lpmtrx16, &mtrx32a);
return AddFontStyle(&elf32a, &mtrx32a, nFontType,
(LPCHOOSEFONTA)lpcf->lpTemplateName, hcmb2, hcmb3, hDlg, TRUE);
}
/***********************************************************************
......
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