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

List:       kde-edu-devel
Subject:    [kde-edu]: Re: Adding KFontUtils to kdeui
From:       Jeremy Whiting <jpwhiting () kde ! org>
Date:       2011-01-06 4:52:58
Message-ID: AANLkTikusfTgGSDk50O8mWNftrdVW-MLoUSwCJ+Ey56e () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Ok, I committed the latest version of Albert's patch, with some tweaking
(put it into KFontUtils namespace, and changed @since from 4.3 to 4.7).  I
also updated KAnagram to use this instead of libkdeeduui.  I'll do the same
to blinken tomorrow and then libkdeeduui can go away \o/.

BR,
Jeremy

On Tue, Jan 4, 2011 at 9:23 AM, Jeremy Whiting <jpwhiting@kde.org> wrote:

>
>
> On Mon, Jan 3, 2011 at 1:03 PM, Christoph Feck <christoph@maxiom.de>wrote:
>
>> I was asked to restate my position on this thread.
>>
>> 1. The namespace should be named KFontUtils as was the original intention.
>> This is in line with KColorUtils and avoids the confusion with
>> QFontMetrics. I
>> suggest to move it to kdeui/fonts/kfontutils.{cpp|h}.
>>
>
> I agree, ok will do.
>
>
>>
>> 2. I share Parkers concern that passing a QPainter to the function is
>> wrong.
>> The reason given was that Qt has a bug where creating a QFont or
>> QFontMetrics object for a specific paint device does not yield the same
>> metrics as when using a QPainter for that paint device (bug number?). Qt
>> bugs
>> should not be reflected in the design decisions of an API. I don't have
>> the
>> patch at hand right now to check which name we used, but I suggest the
>> signature to be KFontUtils::maxPointSizeF(const QFont &font, const QSizeF
>> &size, const QString &text).
>>
>
> As Albert stated in his last message on the previous thread:
>
> "It's not a Qt bug, as far as i understand QFontMetrics calculates how much
> the
> font is going to use based on font information, given the same font you
> should
> get the same value in windows, mac, linux. On the other hand, when you
> render
> on a QImage you get freetype (or harfbuzz not sure) on linux and probably a
>
> different render for Mac and for Windows, and even the used geometry is
> *very*
> close, it's usually off by 1 or 2 pixels with what QFontMetrics returns
> because on how hinting and other weird font things work.
> Please if someone with more Qt/font rendering knowledge thinks i'm wrong,
> just
> tell, but this is the behaviour i've been seeing since Qt3 times and afair
> it
> was always justified this way."
>
> So change the namespace and put into kdelibs/kdeui/fonts/ ?
>
> Best Regards,
> Jeremy
>
>>
>> Christoph Feck (kdepepo)
>>
>> On Saturday 01 January 2011 20:31:55 Albert Astals Cid wrote:
>> > A Dimarts, 28 de desembre de 2010, Jeremy Whiting va escriure:
>> > > Albert Astals Cid <aacid <at> kde.org> writes:
>> > > > > > Anyway it's obvious i'm too late on this, let's just wait for
>> KDE
>> > > > > > 4.4
>> > > > >
>> > > > > Maybe. I do not think I am in the position to stop you :) I have
>> to
>> > > > > agree with Parker that the current suggested patch does not feel
>> "Qt
>> > > > > way", though.
>> > > >
>> > > > Well, i've done all you both have suggested, so don't know what more
>> > > > you want.
>> > > >
>> > > > Anyway, let's stop this, makes no sense keep discussing for
>> something
>> > > > that maybe we'll never ship.
>> > > >
>> > > > Albert
>> > > >
>> > > > > > Albert
>> > >
>> > > Christoph, Albert, Others,
>> > >
>> > > I'd like to see this happen in the 4.7 timeframe (sooner than later)
>> > > especially because it will help kdeedu/libkdeedu/kdeeduui disappear,
>> > > which removes a dependency of a couple of kdeedu applications prior to
>> > > the migration to git.
>> > >
>> > > Thoughts about the last patches sent by Albert? otherwise I suggest we
>> > > move this class into kdelibs/kdeui where all kde applications can
>> > > benefit from it.
>> >
>> > I'm all for it, not sure if i fixed all of Christoph and Parker concerns
>> > though.
>> >
>> > Albert
>> >
>> > > Best Regards,
>> > > Jeremy
>>
>
>

[Attachment #5 (text/html)]

Ok, I committed the latest version of Albert&#39;s patch, with some tweaking (put it \
into KFontUtils namespace, and changed @since from 4.3 to 4.7).  I also updated \
KAnagram to use this instead of libkdeeduui.  I&#39;ll do the same to blinken \
tomorrow and then libkdeeduui can go away \o/.<br> <br>BR,<br>Jeremy<br><br><div \
class="gmail_quote">On Tue, Jan 4, 2011 at 9:23 AM, Jeremy Whiting <span \
dir="ltr">&lt;<a href="mailto:jpwhiting@kde.org">jpwhiting@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;"> <br><br><div \
class="gmail_quote"><div class="im">On Mon, Jan 3, 2011 at 1:03 PM, Christoph Feck \
<span dir="ltr">&lt;<a href="mailto:christoph@maxiom.de" \
target="_blank">christoph@maxiom.de</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;">

I was asked to restate my position on this thread.<br>
<br>
1. The namespace should be named KFontUtils as was the original intention.<br>
This is in line with KColorUtils and avoids the confusion with QFontMetrics. I<br>
suggest to move it to \
kdeui/fonts/kfontutils.{cpp|h}.<br></blockquote></div><div><br>I agree, ok will \
do.<br> <br></div><div class="im"><blockquote class="gmail_quote" style="margin: 0pt \
0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<br>
2. I share Parkers concern that passing a QPainter to the function is wrong.<br>
The reason given was that Qt has a bug where creating a QFont or<br>
QFontMetrics object for a specific paint device does not yield the same<br>
metrics as when using a QPainter for that paint device (bug number?). Qt bugs<br>
should not be reflected in the design decisions of an API. I don&#39;t have the<br>
patch at hand right now to check which name we used, but I suggest the<br>
signature to be KFontUtils::maxPointSizeF(const QFont &amp;font, const QSizeF<br>
&amp;size, const QString &amp;text).<br></blockquote></div><div><br>As Albert stated \
in his last message on the previous thread:<br><br>&quot;It&#39;s not a Qt bug, as \
far as i understand QFontMetrics calculates how much the <br>


font is going to use based on font information, given the same font you should <br>
get the same value in windows, mac, linux. On the other hand, when you render <br>
on a QImage you get freetype (or harfbuzz not sure) on linux and probably a <br>
different render for Mac and for Windows, and even the used geometry is *very* <br>
close, it&#39;s usually off by 1 or 2 pixels with what QFontMetrics returns <br>
because on how hinting and other weird font things work.<br>
Please if someone with more Qt/font rendering knowledge thinks i&#39;m wrong, just \
<br> tell, but this is the behaviour i&#39;ve been seeing since Qt3 times and afair \
it <br> was always justified this way.&quot;<br><br>So change the namespace and put \
into kdelibs/kdeui/fonts/ ?<br><br>Best Regards,<br><font color="#888888">Jeremy<br> \
</font></div><div><div></div><div class="h5"><blockquote class="gmail_quote" \
style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); \
padding-left: 1ex;">


<font color="#888888"><br>
Christoph Feck (kdepepo)<br>
</font><div><div></div><div><br>
On Saturday 01 January 2011 20:31:55 Albert Astals Cid wrote:<br>
&gt; A Dimarts, 28 de desembre de 2010, Jeremy Whiting va escriure:<br>
&gt; &gt; Albert Astals Cid &lt;aacid &lt;at&gt; <a href="http://kde.org" \
target="_blank">kde.org</a>&gt; writes:<br> &gt; &gt; &gt; &gt; &gt; Anyway it&#39;s \
obvious i&#39;m too late on this, let&#39;s just wait for KDE<br> &gt; &gt; &gt; &gt; \
&gt; 4.4<br> &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Maybe. I do not think I am in the position to stop you :) I have \
to<br> &gt; &gt; &gt; &gt; agree with Parker that the current suggested patch does \
not feel &quot;Qt<br> &gt; &gt; &gt; &gt; way&quot;, though.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Well, i&#39;ve done all you both have suggested, so don&#39;t know \
what more<br> &gt; &gt; &gt; you want.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Anyway, let&#39;s stop this, makes no sense keep discussing for \
something<br> &gt; &gt; &gt; that maybe we&#39;ll never ship.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Albert<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Albert<br>
&gt; &gt;<br>
&gt; &gt; Christoph, Albert, Others,<br>
&gt; &gt;<br>
&gt; &gt; I&#39;d like to see this happen in the 4.7 timeframe (sooner than \
later)<br> &gt; &gt; especially because it will help kdeedu/libkdeedu/kdeeduui \
disappear,<br> &gt; &gt; which removes a dependency of a couple of kdeedu \
applications prior to<br> &gt; &gt; the migration to git.<br>
&gt; &gt;<br>
&gt; &gt; Thoughts about the last patches sent by Albert? otherwise I suggest we<br>
&gt; &gt; move this class into kdelibs/kdeui where all kde applications can<br>
&gt; &gt; benefit from it.<br>
&gt;<br>
&gt; I&#39;m all for it, not sure if i fixed all of Christoph and Parker concerns<br>
&gt; though.<br>
&gt;<br>
&gt; Albert<br>
&gt;<br>
&gt; &gt; Best Regards,<br>
&gt; &gt; Jeremy<br>
</div></div></blockquote></div></div></div><br>
</blockquote></div><br>



_______________________________________________
kde-edu mailing list
kde-edu@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu


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

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