synedit: applied patch #0012606: Carbon : Editor font rendering badly damaged for default font, point size 14 on PowerPC rev 17304 #80581bd7cb from Brad Campbell

git-svn-id: trunk@17319 -
This commit is contained in:
tombo 2008-11-10 15:25:21 +00:00
parent 632c4008bd
commit 838dd9d2c9

View File

@ -395,6 +395,18 @@ end;
{$ENDIF}
{$ENDIF}
{$IFDEF SYN_LAZARUS}
function GetStyleIndex(Value: TFontStyles): Integer;
var
item: TFontStyle;
begin
result := 0;
for item := low (TFontStyle) to high(TFontStyle) do
if item in Value then
result := result + 1 shr ord(item);
end;
{$ENDIF}
{ TheFontsInfoManager }
procedure TheFontsInfoManager.LockFontsInfo(
@ -873,7 +885,11 @@ begin
{$ELSE}
ASSERT(SizeOf(TFontStyles) = 1);
{$ENDIF}
{$IFDEF SYN_LAZARUS}
idx := GetStyleIndex(Value);
{$ELSE}
idx := PByte(@Value)^;
{$ENDIF}
ASSERT(idx <= High(TheStockFontPatterns));
UseFontHandles;
@ -1202,7 +1218,11 @@ procedure TheTextDrawer2.SetStyle(Value: TFontStyles);
var
idx: Integer;
begin
{$IFDEF SYN_LAZARUS}
idx := GetStyleIndex(Value);
{$ELSE}
idx := PByte(@Value)^;
{$ENDIF}
if FFonts[idx] <> 0 then
begin
FCrntFont := FFonts[idx];