ChooseFont

Where can I find the DWRITE_FONT_STYLE and DWRITE_FONT_STRETCH properties?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
CHOOSEFONT cf;
LOGFONT log;

//Setting the CHOOSEFONT structure
cf.lStructSize = sizeof(CHOOSEFONT);
cf.hwndOwner = (HWND) NULL;
cf.lpLogFont = &log;
cf.Flags = CF_SCREENFONTS;
cf.rgbColors = RGB(0,0,0);
cf.lCustData = 0L;
cf.lpfnHook = (LPCFHOOKPROC)NULL;
cf.lpTemplateName = (LPCWSTR)NULL;
cf.hInstance = (HINSTANCE) NULL;
cf.lpszStyle = (LPWSTR)NULL;
cf.nFontType = SCREEN_FONTTYPE;
cf.nSizeMin = 24;
			
			

if(ChooseFont(&cf) == TRUE)
{
	HRESULT hr = pDWFactory->CreateTextFormat(log.lfFaceName, NULL, (DWRITE_FONT_WEIGHT)log.lfWeight, log.lfItalic ? DWRITE_FONT_STYLE_ITALIC : DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL,(FLOAT)cf.iPointSize/10, _T(""), &pTF);
}
What do you mean ? They are only used if you use windows 7 SDK or later and defining WINVER accordingly. At runtime windows vista sp2 or later is required.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd368080(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/dd368078(v=vs.85).aspx
I figured it out, it took a little more finagling with DirectWrite API

Thanks for the reply though.
Topic archived. No new replies allowed.