[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: Re: Review Request 119983: Use font metrics to scale icons for high dpi outputs
From: "David Edmundson" <david () davidedmundson ! co ! uk>
Date: 2014-08-28 23:11:06
Message-ID: 20140828231106.11205.86672 () probe ! kde ! org
[Download RAW message or body]
--===============7742607400690492579==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119983/#review65459
-----------------------------------------------------------
src/declarativeimports/core/units.cpp
<https://git.reviewboard.kde.org/r/119983/#comment45732>
I'm confused.
gridUnit is based on QGuiApplication::font()
and we generate a ratio comparing it against QGuiApplication::font()
won't that always result in the same constant?
- David Edmundson
On Aug. 28, 2014, 11:03 p.m., Sebastian Kügler wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119983/
> -----------------------------------------------------------
>
> (Updated Aug. 28, 2014, 11:03 p.m.)
>
>
> Review request for Plasma, Kai Uwe Broulik, David Edmundson, and Vishesh Handa.
>
>
> Bugs: 337712 and 338308
> http://bugs.kde.org/show_bug.cgi?id=337712
> http://bugs.kde.org/show_bug.cgi?id=338308
>
>
> Repository: plasma-framework
>
>
> Description
> -------
>
> Use font metrics to scale icons for high dpi outputs
>
> QScreen, through EDID reports bogus values for physicalDotsPerInch*().
> This leads to oversized icons on monitors with bogus edid information.
>
> This patch changes the ratio underlying to the icon sizing for displays
> with a DPI > 96 * 1.5 to use the ratio between the font as rendered (its
> effective pixelSize, essentially) to scale the icon sizes up.
>
> As we rely on proper font metrics throughout already, this should bring
> sizing in line with the font, which is something that makes sense as it
> means we're sharing the underlying mechanism (font metrics) for sizing
> in different areas.
>
> The downside of this patch is that we're essentially working around an
> issue that should be fixed in the hardware, the monitor's edid.
> Unrealistic.
>
> print dpi / sizing in dpitest
>
> Print out some useful information to deduce dpi and pixel sizing.
>
> David, and Kai Uwe, Vishesh (since I know you have a high DPI displays),
> could you run this patch for a bit and check if it works for you, too?
>
> I've pushed it to plasma-framework[sebas/dpi] for your git convenience.
>
>
> Diffs
> -----
>
> src/declarativeimports/core/units.h ba481781a04a54cb77f99048d3d400fdae617b38
> src/declarativeimports/core/units.cpp 56c0b55427c128beff5f8d18c37847a435f194c0
> tests/dpi/dpitest.cpp c3d2c3e6821fd79fc8b5ed0b3559a5870f88aa36
>
> Diff: https://git.reviewboard.kde.org/r/119983/diff/
>
>
> Testing
> -------
>
> Ran Plasma Desktop, no apparent problems (on this hardware, which worked, anyway).
>
>
> Thanks,
>
> Sebastian Kügler
>
>
--===============7742607400690492579==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;"> \
<tr> <td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/119983/">https://git.reviewboard.kde.org/r/119983/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="https://git.reviewboard.kde.org/r/119983/diff/1/?file=308044#file308044line197" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/declarativeimports/core/units.cpp</a> <span style="font-weight: \
normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
Units::updateSpacing()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">195</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="k">const</span> <span class="n">qreal</span> <span class="n">pointSize</span> \
<span class="o">=</span> <span class="n">QGuiApplication</span><span \
class="o">::</span><span class="n">font</span><span class="p">().</span><span \
class="n">pointSize</span><span class="p">();</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">196</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="k">const</span> <span class="n">qreal</span> <span \
class="n">fontPixelRatio</span> <span class="o">=</span> <span \
class="n">m_gridUnit</span> <span class="o">/</span> <span \
class="n">pointSize</span><span class="p">;</span></pre></td> </tr>
</tbody>
</table>
<div style="margin-left: 2em;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I'm \
confused.</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">gridUnit is based on QGuiApplication::font()</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">and we generate a ratio comparing it against QGuiApplication::font()</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">won't that always result in the same constant?</p></pre> </div>
</div>
<br />
<p>- David Edmundson</p>
<br />
<p>On August 28th, 2014, 11:03 p.m. UTC, Sebastian Kügler wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;"> <tr>
<td>
<div>Review request for Plasma, Kai Uwe Broulik, David Edmundson, and Vishesh \
Handa.</div> <div>By Sebastian Kügler.</div>
<p style="color: grey;"><i>Updated Aug. 28, 2014, 11:03 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=337712">337712</a>,
<a href="http://bugs.kde.org/show_bug.cgi?id=338308">338308</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-framework
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Use font metrics to scale icons for high dpi \
outputs</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">QScreen, through EDID reports bogus values for \
physicalDotsPerInch*().<br style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: normal;" /> This leads to oversized icons on \
monitors with bogus edid information.</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">This patch changes the \
ratio underlying to the icon sizing for displays<br style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: normal;" /> with a DPI > 96 * 1.5 \
to use the ratio between the font as rendered (its<br style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" /> \
effective pixelSize, essentially) to scale the icon sizes up.</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">As we \
rely on proper font metrics throughout already, this should bring<br style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" /> \
sizing in line with the font, which is something that makes sense as it<br \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
normal;" /> means we're sharing the underlying mechanism (font metrics) for sizing<br \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
normal;" /> in different areas.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">The downside of this patch is that we're essentially \
working around an<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: normal;" /> issue that should be fixed in the hardware, the \
monitor's edid.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: normal;" /> Unrealistic.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">print dpi / sizing in dpitest</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Print \
out some useful information to deduce dpi and pixel sizing.</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">David, and Kai Uwe, Vishesh (since I know you have a high DPI displays), \
<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: normal;" /> could you run this patch for a bit and check if it \
works for you, too?</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">I've pushed it to \
plasma-framework[sebas/dpi] for your git convenience.</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Ran Plasma Desktop, no apparent problems (on this \
hardware, which worked, anyway).</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/declarativeimports/core/units.h <span style="color: \
grey">(ba481781a04a54cb77f99048d3d400fdae617b38)</span></li>
<li>src/declarativeimports/core/units.cpp <span style="color: \
grey">(56c0b55427c128beff5f8d18c37847a435f194c0)</span></li>
<li>tests/dpi/dpitest.cpp <span style="color: \
grey">(c3d2c3e6821fd79fc8b5ed0b3559a5870f88aa36)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/119983/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============7742607400690492579==--
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic