mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 00:19:22 +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
|
var
|
||||||
I: Integer;
|
I: Integer;
|
||||||
begin
|
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
|
for I := 1 to Length(FText) do
|
||||||
|
begin
|
||||||
FFont.FCachedLayouts[Ord(FText[I])].Apply(ADC);
|
FFont.FCachedLayouts[Ord(FText[I])].Apply(ADC);
|
||||||
|
FTextAfter := FTextAfter + Long2Fix(FFont.FCachedLayouts[Ord(FText[I])].GetWidth);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCarbonTextLayoutArray.Draw(X, Y: Integer): Boolean;
|
function TCarbonTextLayoutArray.Draw(X, Y: Integer): Boolean;
|
||||||
@ -1104,10 +1112,15 @@ function TCarbonFont.CreateTextLayout(const Text: String;
|
|||||||
function IsTextASCII: Boolean;
|
function IsTextASCII: Boolean;
|
||||||
var
|
var
|
||||||
I: Integer;
|
I: Integer;
|
||||||
|
C: Byte;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
for I := 1 to Length(Text) do
|
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;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
var
|
var
|
||||||
|
Loading…
Reference in New Issue
Block a user