Commit 5b5ad757 authored by Juha Manninen's avatar Juha Manninen
Browse files

LazUtils: Add OnCompare func for TFreeTypeFont's AVLTree. Prevents adding...

LazUtils: Add OnCompare func for TFreeTypeFont's AVLTree. Prevents adding glyphs many times. Issue #35627.

git-svn-id: trunk@61291 -
parent 837b7ebe
......@@ -488,6 +488,19 @@ begin
raise EFreeType.Create('FreeType cannot be initialized');
end;
function GlyphTableOnCompare(Item1, Item2: Pointer): Integer;
var
G1: TFreeTypeGlyph absolute Item1;
G2: TFreeTypeGlyph absolute Item2;
begin
if G1.Index > G2.Index then
Result := 1
else if G1.Index < G2.Index then
Result := -1
else
Result := 0;
end;
{ TFreeTypeRenderableFont }
procedure TFreeTypeRenderableFont.DefaultWordBreakHandler(var ABefore,
......@@ -1436,6 +1449,7 @@ begin
FPointSize := 10;
FDPI := 96;
FGlyphTable := TAvlTree.Create;
FGlyphTable.OnCompare := @GlyphTableOnCompare;
FHinted := true;
FWidthFactor := 1;
FClearType := false;
......
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="lazfreetypetest"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
......@@ -47,8 +49,6 @@
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
......
......@@ -14,7 +14,7 @@ object Form1: TForm1
OnPaint = FormPaint
OnShow = FormShow
Position = poDefault
LCLVersion = '1.9.0.0'
LCLVersion = '2.1.0.0'
object Panel_Option: TPanel
Left = 0
Height = 40
......
......@@ -139,8 +139,7 @@ begin
lazimg.Free;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);
begin
mx := X;
my := Y;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment