lblKun.SetFont(f).SetText("\1[!" + f.GetFaceName() + "! [3 " + ToUtf8(Join(kanji_.KunReading, EntrySeparator)) + "]]");
luzr wrote on Mon, 07 July 2008 16:30 |
If you use QTF in label, font is ignored. (-> a feature, not a bug Mirek |
lblKun.SetFont(f).SetText("\1[!" + f.GetFaceName() + "! [3 " + ToUtf8(Join(kanji_.KunReading, EntrySeparator)) + "]]");
cbpporter wrote on Tue, 08 July 2008 13:47 |
Sorry, but Qtf is more trouble than it's worth. I'll fork label and rewrite Paint so that it uses manual word-wrapping. |
Draw& ScreenInfo();
Quote: |
If your screen resolution makes items too small to view comfortably, you can increase the DPI to compensate. |
Quote: |
That is why I keep saying that points and DPI for screen are largely irrelevant. What only matters is zoom ratio. |
Quote: |
2. I still need to know how to use ScreenInfo and GetPixelsPerInch. |
Quote: |
Something like Draw::GetPixelsPerInch seems a good place to start, but first of all I can only call it on a Draw instance, and even if I do, I get a failed assert regarding IsDrawing. Using it on ScreenInfo also seemed like a good idea, but I can't use it or find it's definition. All I can find is about 6 such declarations scattered around |
Ctrl:: static const char *GetZoomText(); static void SetZoomSize(Size sz, Size bsz = Size(0, 0)); static int HorzLayoutZoom(int cx); static int VertLayoutZoom(int cy); static Size LayoutZoom(int cx, int cy); static Size LayoutZoom(Size sz); static void NoLayoutZoom(); static void GetZoomRatio(Size& m, Size& d); static int HZoom(int cx) { return HorzLayoutZoom(cx); }
Quote: |
I had to deprecate ScreenInfo, as it is inherently MT unsafe... You should be able to get the same thing using ScreenDraw info(true); |
Quote: |
If yes, then probably I should extract the info I need at application startup and then discard the ScreenDraw instance. |
Quote: |
Also, except font antialiasing, is there any other missing tag from Qtf that is present in a font description? |
Quote: |
If it will be accepted I'll add the possibility to choose the sizing unit to TheIDE's font properties dialog from the layout designer so that I can set up all my layouts to use points. |
Font& Font::HeightPt(int pt) { height = pt * sScreenPPI / 72; return *this; }
Quote: |
That's Pandora's box, believe me. |
luzr wrote on Sun, 07 September 2008 14:35 |
Ehm, after all these posts about points being meaningless for screen? |
Font& Font::HeightPt(int pt) { height = pt * sScreenPPI / 72; return *this; }
int PointsToPixels(int points) { static int screenPPI = ScreenDraw(false).GetPixelsPerInch().cy; return points * screenPPI / 72; }
Quote: |
Does this apply to X11 also? |
Quote: |
And if for some strange reason the only font that I have is Wingdings, will StdFont default to Wingdings? |
Quote: |
Anyway, the critical piece of code starts at line 173 of Draw/DrawTextWin32.cpp |
ScreenDraw info(true);