https://bugs.documentfoundation.org/show_bug.cgi?id=122131

--- Comment #7 from Jan-Marek Glogowski <glo...@fbihome.de> ---
(In reply to Bernhard Rosenkraenzer from comment #6)
> The interesting part is probably physicalSize (and the resulting
> physicalDotsPerInch). Those numbers look off... (but KDE and other Qt
> applications look perfect).
> 
> logicalDotsPerInch: 96
> physicalDotsPerInch: 304.8
> physicalSize: QSizeF(160, 90)

Yup - that would be a tiny screen, as it's in mm...
xdpyinfo seems more correct with "508x317 millimeters"; not sure if this is a
guess based on the 96 DPI or on real data.

The icons are roughly scaled 3x when I tried to measure their rectangle using
gimp, so that would correspond to logicalDotsPerInch : physicalDotsPerInch.

Currently Qt5Font uses QFont::setPixelSize to set the font size. Quoting the
docs: "Using this function makes the font device dependent. Use setPointSize()
or setPointSizeF() to set the size of the font in a device independent manner."

So in theory
-    setPixelSize(rFSP.mnHeight);
+    setPointSizeF(rFSP.mfExactHeight * 72.0 /
QGuiApplication::primaryScreen()->logicalDotsPerInch());

should fix your problem. Docs for QScreen::logicalDotsPerInch claim "this value
can be used to convert font point sizes to pixel sizes".

My final patch is a bit different. LO still looks ok for me, but I have no
idea, if this would work for you.
Maybe this needs adaption of Qt5Font::ImplGetGlyphBoundRect too

Can you test the patch at https://gerrit.libreoffice.org/#/c/65696/ ?

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to