[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdelibs/kdeui
From:       Jeremy Whiting <jpwhiting () kde ! org>
Date:       2011-01-06 13:19:51
Message-ID: AANLkTikDsTXuiaS3cLwJA6i-xdhrrEU18Oh2sRTSH8Uy () mail ! gmail ! com
[Download RAW message or body]

David,

This has come up on the ml before
http://www.pubbs.net/200905/kde/66514-adding-kfontutils-to-kdeui.html
Anyway, the flag name changing would be good probably, but the QPainter is
needed for better accuracy, QFontMetrics doesn't quite cut it.

BR,
Jeremy

On Thu, Jan 6, 2011 at 1:04 AM, David Faure <faure@kde.org> wrote:

> On Thursday 06 January 2011, Jeremy Paul Whiting wrote:
> > SVN commit 1212196 by whiting:
> >
> > Initial import of KFontUtils from kdeedu/libkdeedu/kdeeduui into kdelibs.
> > CCMAIL: aacid@kde.org
> >
> >
> >  M  +2 -0      CMakeLists.txt
> >  A             fonts/kfontutils.cpp   [License: LGPL]
> >  A             fonts/kfontutils.h   [License: LGPL]
>
> "DoNotAllowWordWrap" would be called "TextSingleLine" in Qt (if it means
> '\n'
> is treated as ' ') or "TextWordWrap" (if both '\n' and reaching the given
> width lead to word wrap).
> I would suggest renaming that enum to one of these, depending on the
> intended
> meaning, for consistency.
>
> I'm a bit surprised that the implementation uses boundingRect() rather than
> QFontMetrics::size(), which in my experience gives better results.
>
> In fact why does this use QPainter at all? If we do this calculation at
> another moment than at painting time, then we don't have a QPainter -- and
> we
> don't need one. This could just use QFont and QFontMetrics instead.
>
> --
> David Faure, faure@kde.org, http://www.davidfaure.fr
> Sponsored by Nokia to work on KDE, incl. Konqueror (
> http://www.konqueror.org).
>

[Attachment #3 (text/html)]

David,<br><br>This has come up on the ml before <a \
href="http://www.pubbs.net/200905/kde/66514-adding-kfontutils-to-kdeui.html">http://www.pubbs.net/200905/kde/66514-adding-kfontutils-to-kdeui.html</a> \
Anyway, the flag name changing would be good probably, but the QPainter is needed for \
better accuracy, QFontMetrics doesn&#39;t quite cut it.<br> \
<br>BR,<br>Jeremy<br><br><div class="gmail_quote">On Thu, Jan 6, 2011 at 1:04 AM, \
David Faure <span dir="ltr">&lt;<a \
href="mailto:faure@kde.org">faure@kde.org</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, \
204, 204); padding-left: 1ex;"> On Thursday 06 January 2011, Jeremy Paul Whiting \
wrote:<br> &gt; SVN commit 1212196 by whiting:<br>
&gt;<br>
&gt; Initial import of KFontUtils from kdeedu/libkdeedu/kdeeduui into kdelibs.<br>
&gt; CCMAIL: <a href="mailto:aacid@kde.org">aacid@kde.org</a><br>
&gt;<br>
&gt;<br>
&gt;  M  +2 -0      CMakeLists.txt<br>
&gt;  A             fonts/kfontutils.cpp   [License: LGPL]<br>
&gt;  A             fonts/kfontutils.h   [License: LGPL]<br>
<br>
&quot;DoNotAllowWordWrap&quot; would be called &quot;TextSingleLine&quot; in Qt (if \
it means &#39;\n&#39;<br> is treated as &#39; &#39;) or &quot;TextWordWrap&quot; (if \
both &#39;\n&#39; and reaching the given<br> width lead to word wrap).<br>
I would suggest renaming that enum to one of these, depending on the intended<br>
meaning, for consistency.<br>
<br>
I&#39;m a bit surprised that the implementation uses boundingRect() rather than<br>
QFontMetrics::size(), which in my experience gives better results.<br>
<br>
In fact why does this use QPainter at all? If we do this calculation at<br>
another moment than at painting time, then we don&#39;t have a QPainter -- and we<br>
don&#39;t need one. This could just use QFont and QFontMetrics instead.<br>
<font color="#888888"><br>
--<br>
David Faure, <a href="mailto:faure@kde.org">faure@kde.org</a>, <a \
href="http://www.davidfaure.fr" target="_blank">http://www.davidfaure.fr</a><br> \
Sponsored by Nokia to work on KDE, incl. Konqueror (<a \
href="http://www.konqueror.org" target="_blank">http://www.konqueror.org</a>).<br> \
</font></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic