Project

General

Profile

WFont Generic Families doesnt work in Internet Explorer

Added by Ulf Johnsson over 12 years ago

I have code that goes something like this:

void MyClass::PaintEvent(Wt::WPainter &painter)

{

painter.setFont(GetFont()); //GetFont() gets a WFont with genericfamily:Monospace and specific:Courier and has size:20

Wt::AlignmentFlag flag = (GetHAlignment() | GetVAlignment());

painter.drawText(Wt::WRectf(0,0,100,100), flag, Wt::WString("Text"));

}

Problem:

In firefox everything appears fine, but in IE the font-size is correct but the font itself looks like "Palace Script MT" :S

Has anyone gotten fonts to work in IE ?

Note: It doesnt matter what font i choose, the end result still seems to be "Palace Script MT".

Please help =(

/Ulf Johnsson


Replies (2)

RE: WFont Generic Families doesnt work in Internet Explorer - Added by Ulf Johnsson over 12 years ago

Solved it! Well, sort of...

The problem here was that I was using IE8, and according to the documentation here:

http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WPaintedWidget.html

IE6 up to <9 uses rendering method "InlineVML" and IE9 and greater uses "HtmlCanvas".

So apperently "InlineVML" cannot work out font-attributes.

NOTE: I found that the old IE (<9) cannot rotate ellipses, but it can rotate other shapes.

But again this isnt a problem in the browsers using "HtmlCanvas".

Hope this can be some help to others as well.

/Ulf Johnsson

RE: WFont Generic Families doesnt work in Internet Explorer - Added by Koen Deforche over 12 years ago

Hey,

I'll still need to check though, since it sounds like a regression of the font-rendering in the VML backend.

I've created a ticket for it: #1116

Regards,

koen

    (1-2/2)