OleCreateFontIndirect problem

  • Thread starter Thread starter Iosif Haidu
  • Start date Start date
I

Iosif Haidu

Hi,

I have a problem with 'OleCreateFontIndirect' function.
The COM font object (using iid: IID_IFont, interface: IFont) created by this
function does not have same atributes for size as the font descriptor object
that is passed as first parameter to this function.
For example if I pass a font descriptor that has the following attributes:
lpstrName: Arial Narrow (in wide characters)
cySize.int64: 10000 (size of font: 10)
sWeight: 700
fItalic: 1
fUnderline: 1
fStrikethrough: 1

the 'get_Size' method of IFont object returned by the
'OleCreateFontIndirect' does not return the same value for font size as the
font descriptor.
For the above example the CY variable returned by 'get_Size' metod of IFont
objec is: CY.int64: 15000.

Here is a code sample:

....
IFont *pFont = NULL;
HRESULT hres;
hres = OleCreateFontIndirect(&fd, IID_IFont, (void**)&pFont);
if(SUCCEEDED(hres))
{
CY cysize;
pFont->get_Size(&cysize);
}
....

where 'fd' is a FONTDESC type variable and is set somewhere before.

Can anybody tell me why is that happening ?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top