[Libreoffice-bugs] [Bug 122131] SAL_USE_VCLPLUGIN=qt5: Fonts, tooltips, toolbar icons way too large

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sat Dec 29 00:43:50 UTC 2018


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

--- Comment #7 from Jan-Marek Glogowski <glogow at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20181229/cb0b7668/attachment.html>


More information about the Libreoffice-bugs mailing list