bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text drawing bug - gaps after 16th character in scaled view


From: Alexander Malmberg
Subject: Re: Text drawing bug - gaps after 16th character in scaled view
Date: Fri, 27 Jun 2003 18:37:39 +0200

Pete French wrote:
[snip]
> > The text system currently draws glyphs in batches of (up to) 16. The
> > small gaps add up, so when the text system sets the position for the
> > 17th glyph explicitly (using the layout information), there'll be a big
> > gap.
> 
> No easy way to fix that then - aside from maybe laying out all the glyphs
> explicity (i.e. make them batches of size 1) which should fix it ?

Then you would have many small gaps, so it wouldn't be as noticeable. It
would probably hurt performance, but I haven't done much benchmarking of
it.

> > The solution is to not use screen fonts when drawing scaled or rotated
> 
> I just tried this:
> 
> [attrDict setObject:[[NSFont systemFontOfSize:10.0] printerFont]
>                         forKey:NSFontAttributeName];
> 
> which should force the use of a printer font surely ? 

NSFont will return a printer font most of the time (always? even if
there is no printer font? there's no useful documentation, so we could
pick any behavior (always printer, always screen, undefined); most of
the time -gui would convert it to the right kind before using it, so it
wouldn't matter much).

> But I got the same
> result, and printing out the addresses it looks like sending
> 'printerFont' to that object returns the same object.

NSLayoutManager automatically substitutes the font with a screen font.
To turn this off, you need to call [layoutManager setUsesScreenFonts:
NO].

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]