Tobias,

Here are 2 screenshots from my Mac. I don't see quite the same spacing issues 
that see.

As you can see, in the prepatch screenshot, the TLabel text is wider than the 
TButton text. The screenshot with the patch shows that the TLabel's text has 
now been rendered with some of the inter-character spacing removed. See "be" 
and "some" and how the renderer has removed the extra pixel between b and e and 
between o and m. Probably what's happening here is the renderer, using font 
hints and other "smarts", figures out that even though the typographic width of 
"b" with this font on my screen is somewhere between two whole numbers, 
removing the extra pixel required to display the fractional part of the 
character actually improves the display of the word.

Also, to my eyes it looks like the renderer is using a slightly larger font 
with the TLabel, whereas in Tobias' original screenshot it appears as though 
it's using a slightly smaller font. That's probably a difference between our 
systems that we're seeing. I'm running OS X 10.4.10 on PowerPC. Display at 1056 
x 792.

I think this demonstrates the potential problems of trying to get simulated, 
non-native controls (TLabel) to look the same as native widget-based controls 
(TButton). If Apple were to change the way the button, edit, etc. are rendered 
in the future, then the TLabel would be off again. From Mattias' account, it 
sounds as though there might be some rendering surprises awaiting us in Leopard.

Thanks.

-Phil

-----Original Message-----
From: Tobias Giesen [mailto:[EMAIL PROTECTED] 
Sent: Sunday, November 04, 2007 2:23 PM
To: [email protected]
Subject: Re: [lazarus] Adding AllowFractionalPositioning to TCarbonDeviceContext

Hi Phil and others,

I think if we only make careful amendments to carboncanvas.pp and
nowhere else, then nobody needs to be horrified any more.

I did not see your screenshots! I can confirm that the text won't look
identical to the buttons even with my changes, but that is not so
important. It might be intended by Apple.

So if you could live with the change that Mattias proposed, I would go
ahead and prepare a patch to add this function:

> function SetFontFractionalPositioning(DC: HDC;
>   UseFractionalPositioning: boolean): boolean;
> to carboncanvas.pp

Which you would need to call just once for any Canvas involved.

Since this is Carbon-internal, we could include it in 0.9.23.

What do you think?

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & Co. KG
Lessingstr. 42
48485 Neuenkirchen, Germany
www.superflexible.com
www.tgtools.com

-----------------------------------------------------------
Registered at register court Steinfurt as HRA 5061
Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Hübl

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

<<attachment: CharSpacing-prepatch.gif>>

<<attachment: CharSpacing-tobiaspatch.gif>>

Reply via email to