Mattias Gaertner ha scritto:
On Sun, 04 Nov 2007 15:15:41 +0100
Tobias Giesen <[EMAIL PROTECTED]> wrote:
Hello,
if we add the property to TCarbonDeviceContext, is that accessible
from a custom component in a reasonable way? Would Phil be willing to
change a property in TCarbonDeviceContext using the appropriate
typecasts?
Fractional positioning should never be turned off globally for the
application, since I am sure Phil's applications will use TLabels
too. So the property must be in each canvas or DC.
You can add for example
function SetFontFractionalPositioning(DC: HDC;
UseFractionalPositioning: boolean): boolean;
to carboncanvas.pp
Then you can use
{$IFDEF LCLcarbon}
uses carboncanvas;
{$ENDIF}
function SetFontFractionalPositioning(DC: HDC;
UseFractionalPositioning: boolean): boolean;
begin
{$IFDEF LCLcarbon}
Result:=carboncanvas....
{$ELSE}
Result:=true;
{$ENDIF}
end;
I followed this discussion, and I must confess that I'm a bit horrified.
There's a Font property, Pitch, which is intended exactly for this purpose.
Its possible values are fpdefault (i.e. use the font pitch as defined in
the font itself), fpfixed (i.e. force the font to be monospace even if
it isn't), and fpvariable (i.e. force the font to be variable even if it
isn't). According Delphi manual this property (together with the other
properties) is used to find the best match and the best setting among
the available fonts.
If Lazarus is supposed to be Delphi compatible, or at least decently
self consistent, the only reasonable thing to do is just to use this
property (maybe adding a further value fpFractional, but I don't believe
it necessary from what I read up to now), and let the components with
special needs (or the users with special needs), to force the Pitch of
the font according their needs.
If basic component properties are unused and/or overridden here and
there, the usability of Lazarus for anything other than academic
exercise becomes highly questionable.
Giuliano
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives