Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, February 2007
Getting fonts to look the same across platforms


Message 1 in thread

Is there any documentation covering how to get fonts to look
*identical* on all platforms? I am prepared to embed fonts, but am not
sure if using QFontDatabase to add app fonts like "arial" from
embedded ttf files will react when the font already exists? If I
specify "Arial 10" in my app it looks bigger on windows than on a mac,
which is a problem.

This seems like a show-stopper for a cross-platform toolkit, so I'm
sure there is some sort of method or solution to this sort of thing.

thanks!

-- 
 [ signature omitted ] 

Message 2 in thread

On Friday 02 February 2007 22:43:26 Patrick Stinson wrote:
> Is there any documentation covering how to get fonts to look
> *identical* on all platforms? I am prepared to embed fonts, but am not
> sure if using QFontDatabase to add app fonts like "arial" from
> embedded ttf files will react when the font already exists? If I
> specify "Arial 10" in my app it looks bigger on windows than on a mac,
> which is a problem.

One of the reasons why fonts have a different size on the mac than on windows 
is because they define different resolutions. On Windows the resolution of 
the display is always defined to 96 DPI, while I believe on Mac OS X it is 
always 72 DPI.

Simon

Attachment:

Attachment: pgpGeZIyESvSc.pgp
Description: PGP signature


Message 3 in thread

Hi,

> Is there any documentation covering how to get fonts to look
> *identical* on all platforms?

What do you mean by identical? Same size in pixels? Same size in mm?

--
 [ signature omitted ] 

Message 4 in thread

On 2/4/07, Dimitri <dimitri@xxxxxxxxxxxxx> wrote:
> Hi,
>
> > Is there any documentation covering how to get fonts to look
> > *identical* on all platforms?
>
> What do you mean by identical? Same size in pixels? Same size in mm?

identical in pixels, just like the pixmaps we are using to skin or
controls and backgrounds.

>
> --
> Dimitri
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>


-- 
 [ signature omitted ] 

Message 5 in thread

On Monday 05 February 2007, Patrick Stinson wrote:
> On 2/4/07, Dimitri <dimitri@xxxxxxxxxxxxx> wrote:
> > Hi,
> >
> > > Is there any documentation covering how to get fonts to look
> > > *identical* on all platforms?
> >
> > What do you mean by identical? Same size in pixels? Same size in mm?
>
> identical in pixels, just like the pixmaps we are using to skin or
> controls and backgrounds.
>
Then you should use QFont::setPixelSize() instead. This should produce the 
same size on all platforms - at least in relation to the pixmaps.

Bernd

--
 [ signature omitted ] 

Message 6 in thread

Yeah, I need to try that.

On 2/5/07, Bernd Brandstetter <bbrand@xxxxxxxxxx> wrote:
> On Monday 05 February 2007, Patrick Stinson wrote:
> > On 2/4/07, Dimitri <dimitri@xxxxxxxxxxxxx> wrote:
> > > Hi,
> > >
> > > > Is there any documentation covering how to get fonts to look
> > > > *identical* on all platforms?
> > >
> > > What do you mean by identical? Same size in pixels? Same size in mm?
> >
> > identical in pixels, just like the pixmaps we are using to skin or
> > controls and backgrounds.
> >
> Then you should use QFont::setPixelSize() instead. This should produce the
> same size on all platforms - at least in relation to the pixmaps.
>
> Bernd
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>


-- 
 [ signature omitted ] 

Message 7 in thread

If you want it to be identical, use PNGs instead. You could string a series
of PNGs together to do your text.

Enforcing a certain font (and size especially) on a user is usually a bad
idea. (Music fonts might be an exception.) Some users have larger fonts to
deal with poor eyesight. Some prefer the looks of some fonts over others. (I
prefer Andale Mono over Courier because I don't want the serifs when editing
code.)

Qt does a fantastic job of dealing with the font differences, yet retaining
the look and feel of each platform. THAT is what a cross=platform toolkit
should do, not enforce uniformity.

JMHO,
Keith

On 02-02-2007 3:43 PM, "Patrick Stinson" wrote:

> Is there any documentation covering how to get fonts to look
> *identical* on all platforms? I am prepared to embed fonts, but am not
> sure if using QFontDatabase to add app fonts like "arial" from
> embedded ttf files will react when the font already exists? If I
> specify "Arial 10" in my app it looks bigger on windows than on a mac,
> which is a problem.
> 
> This seems like a show-stopper for a cross-platform toolkit, so I'm
> sure there is some sort of method or solution to this sort of thing.
> 
> thanks!


--
 [ signature omitted ] 

Message 8 in thread

Keith Esau wrote:
> If you want it to be identical, use PNGs instead. You could string a series
> of PNGs together to do your text.

Another option is to render your text to off-screen pixmaps using 
Freetype directly. Freetype is portable and can produce very consistent 
text across platforms.

> Enforcing a certain font (and size especially) on a user is usually a bad
> idea.

I couldn't agree more. I _detest_ applications that try to force a fixed 
(and usually microscopic) font size on the user because:

	- I have a 120dpi laptop display
	- I work with mildly vision-impaired users who just need larger
	  type to work comfortably
	- I also work on extremely large panels where it can be useful
           to set smaller than usual type sizes.

so I would suggest thinking REALLY HARD about whether there's any 
alternative to fixed font sizes and rendering in your particular situation.

If it's a layout issue, just use Qt's dynamic layout features and let it 
take care of it. Layout is not a good enough reason to use fixed fonts 
if you're coding with a half-decent GUI toolkit.

> Qt does a fantastic job of dealing with the font differences, yet retaining
> the look and feel of each platform. THAT is what a cross=platform toolkit
> should do, not enforce uniformity.

I couldn't agree more.

I'm also looking forward to the fact that since Qt is portable to 
platforms with non-broken display resolution handling, it should be easy 
to make Qt apps produce proper resolution-scaled text under Win Vista.

--
 [ signature omitted ] 

Message 9 in thread

The question of usability does not apply here. There are plenty of
applications that need pixel-to-pixel similarity, and ours is one of
them. We are writing an application that makes heavy use of pixmaps
for skinning, and so naturally when we are writing for more than one
platform we need our fonts to match the look across platforms, too.
That's what we are after.

The freetype idea is the best one I heave heard so far, but I am a
little surprised that there is not a great deal of code in qt to at
least offere a workaround (embedding fonts in a resource file and
rendering them exactly on all platforms).

On 2/4/07, Craig Ringer <craig@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Keith Esau wrote:
> > If you want it to be identical, use PNGs instead. You could string a series
> > of PNGs together to do your text.
>
> Another option is to render your text to off-screen pixmaps using
> Freetype directly. Freetype is portable and can produce very consistent
> text across platforms.
>
> > Enforcing a certain font (and size especially) on a user is usually a bad
> > idea.
>
> I couldn't agree more. I _detest_ applications that try to force a fixed
> (and usually microscopic) font size on the user because:
>
>         - I have a 120dpi laptop display
>         - I work with mildly vision-impaired users who just need larger
>           type to work comfortably
>         - I also work on extremely large panels where it can be useful
>            to set smaller than usual type sizes.
>
> so I would suggest thinking REALLY HARD about whether there's any
> alternative to fixed font sizes and rendering in your particular situation.
>
> If it's a layout issue, just use Qt's dynamic layout features and let it
> take care of it. Layout is not a good enough reason to use fixed fonts
> if you're coding with a half-decent GUI toolkit.
>
> > Qt does a fantastic job of dealing with the font differences, yet retaining
> > the look and feel of each platform. THAT is what a cross=platform toolkit
> > should do, not enforce uniformity.
>
> I couldn't agree more.
>
> I'm also looking forward to the fact that since Qt is portable to
> platforms with non-broken display resolution handling, it should be easy
> to make Qt apps produce proper resolution-scaled text under Win Vista.
>
> --
> Craig Ringer
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>


-- 
 [ signature omitted ]