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>
<br>BR,<br>Jeremy<br><br><div class="gmail_quote">On Tue, Jan 4, 2011 at 9:23 AM, Jeremy Whiting <span dir="ltr"><<a href="mailto:jpwhiting@kde.org">jpwhiting@kde.org</a>></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"><<a href="mailto:christoph@maxiom.de" target="_blank">christoph@maxiom.de</a>></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'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 &font, const QSizeF<br>
&size, const QString &text).<br></blockquote></div><div><br>As Albert stated in his last message on the previous thread:<br><br>"It'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'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'm wrong, just <br>
tell, but this is the behaviour i've been seeing since Qt3 times and afair it <br>
was always justified this way."<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>
> A Dimarts, 28 de desembre de 2010, Jeremy Whiting va escriure:<br>
> > Albert Astals Cid <aacid <at> <a href="http://kde.org" target="_blank">kde.org</a>> writes:<br>
> > > > > Anyway it's obvious i'm too late on this, let's just wait for KDE<br>
> > > > > 4.4<br>
> > > ><br>
> > > > Maybe. I do not think I am in the position to stop you :) I have to<br>
> > > > agree with Parker that the current suggested patch does not feel "Qt<br>
> > > > way", though.<br>
> > ><br>
> > > Well, i've done all you both have suggested, so don't know what more<br>
> > > you want.<br>
> > ><br>
> > > Anyway, let's stop this, makes no sense keep discussing for something<br>
> > > that maybe we'll never ship.<br>
> > ><br>
> > > Albert<br>
> > ><br>
> > > > > Albert<br>
> ><br>
> > Christoph, Albert, Others,<br>
> ><br>
> > I'd like to see this happen in the 4.7 timeframe (sooner than later)<br>
> > especially because it will help kdeedu/libkdeedu/kdeeduui disappear,<br>
> > which removes a dependency of a couple of kdeedu applications prior to<br>
> > the migration to git.<br>
> ><br>
> > Thoughts about the last patches sent by Albert? otherwise I suggest we<br>
> > move this class into kdelibs/kdeui where all kde applications can<br>
> > benefit from it.<br>
><br>
> I'm all for it, not sure if i fixed all of Christoph and Parker concerns<br>
> though.<br>
><br>
> Albert<br>
><br>
> > Best Regards,<br>
> > Jeremy<br>
</div></div></blockquote></div></div></div><br>
</blockquote></div><br>