mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 01:19:37 +02:00
LCL carbon: fixed calculating text extent for cached text layouts
git-svn-id: trunk@13891 -
This commit is contained in:
parent
6f0fd6986d
commit
aefeb828a2
@ -923,8 +923,16 @@ procedure TCarbonTextLayoutArray.Apply(ADC: TCarbonContext);
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
FAscent := FFont.FCachedLayouts[Ord(FText[1])].FAscent;
|
||||
FDescent := FFont.FCachedLayouts[Ord(FText[1])].FDescent;
|
||||
FTextBefore := FFont.FCachedLayouts[Ord(FText[1])].FTextBefore;
|
||||
FTextAfter := FTextBefore;
|
||||
|
||||
for I := 1 to Length(FText) do
|
||||
begin
|
||||
FFont.FCachedLayouts[Ord(FText[I])].Apply(ADC);
|
||||
FTextAfter := FTextAfter + Long2Fix(FFont.FCachedLayouts[Ord(FText[I])].GetWidth);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCarbonTextLayoutArray.Draw(X, Y: Integer): Boolean;
|
||||
@ -1104,10 +1112,15 @@ function TCarbonFont.CreateTextLayout(const Text: String;
|
||||
function IsTextASCII: Boolean;
|
||||
var
|
||||
I: Integer;
|
||||
C: Byte;
|
||||
begin
|
||||
Result := False;
|
||||
for I := 1 to Length(Text) do
|
||||
if Ord(Text[I]) > 127 then Exit;
|
||||
begin
|
||||
C := Ord(Text[I]);
|
||||
if (C > 127) or (C = 10) or (C = 13) then Exit;
|
||||
end;
|
||||
|
||||
Result := True;
|
||||
end;
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user