Mising KGlobalSettings::smallFont()

Boyd Stephen Smith Jr. bss03 at volumehost.net
Sun Jun 17 23:29:05 BST 2007


On Sunday 17 June 2007, Alex Merry <huntedhacker at tiscali.co.uk> wrote 
about 'Re: Mising KGlobalSettings::smallFont()':
> On Sunday 17 Jun 2007, Boyd Stephen Smith Jr. wrote:
> > On Saturday 16 June 2007, Alex Merry <huntedhacker at tiscali.co.uk>
> > wrote
> > about 'Re: Mising KGlobalSettings::smallFont()':
> > > On Saturday 16 Jun 2007, Thomas Zander wrote:
> > > > On Friday 15 June 2007 18:58:25 Jaroslaw Staniek wrote:
> > > > > static QFont KGlobalSettings::smallFont()
> > > >
> > > > I think it makes sense to have a 'smallest reasonable font', but
> > > > the suggested method name doesn't show that it does that.
> > > > Better think of a more matching name.
> >
> > QFont KGlobalSettings::minimizeFont(const QFont &)
>
> I like the general idea, but surely you would be using this to make sure
> a font wasn't too small, not to make it as small as possible.

I can see reasons to do either...

> For example, with the original one, I assume the usual use case would be
> to compare the sizes of the font you were intending to use with the
> size of the QFont returned by smallFont().

> So something like
> QFont KGlobalSettings::ensureFontReadable(const QFont &)
> would be better.  Although the name feels a little clumsy.  This would
> take a font, and if it was big enough, just return it straight away.
> If it was deemed to small to be legible, it would be increased to the
> minimum allowed size before being returned.

Sounds good as well. While the name is long, it is descriptive which is a 
good thing.  It's clear that minimizeFont and be implemented trivially on 
top of this method with something like:

QFont myFont = /* Some stuff to get a font face. */;
myFont.setPointSizeF(numeric_limits<qreal>::epsilon());
myFont = ensureFontReadable(myFont);

and it's not clear to me how to implement ensureFontReadable on top of 
minimizeFont, so ensureFontReable sound like what we need.

-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
bss03 at volumehost.net                      ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.org/                      \_/     
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070617/320acc5a/attachment.sig>


More information about the kde-core-devel mailing list