From 824f9ac5d99aabb2bfaaa056edfd05f9284a1c3c Mon Sep 17 00:00:00 2001 From: juha Date: Sat, 23 May 2015 12:44:54 +0000 Subject: [PATCH] LazUtils: Call LazFreeType.CheckInstance in GetCharIndex and make it public. Issue #28163, patch from Johann. git-svn-id: trunk@49146 - --- components/lazutils/easylazfreetype.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/lazutils/easylazfreetype.pas b/components/lazutils/easylazfreetype.pas index d11fe3a8c6..4165ccbe3d 100644 --- a/components/lazutils/easylazfreetype.pas +++ b/components/lazutils/easylazfreetype.pas @@ -275,7 +275,6 @@ type procedure FetchNames; function GetCollection: TCustomFreeTypeFontCollection; function CheckFace: boolean; - function CheckInstance: boolean; public Quality : TGlyphRenderQuality; SmallLinePadding: boolean; @@ -293,6 +292,7 @@ type function CharsWidth(AText: string): ArrayOfSingle; function CharsPosition(AText: string): ArrayOfCharPosition; overload; function CharsPosition(AText: string; AAlign: TFreeTypeAlignments): ArrayOfCharPosition; overload; + function CheckInstance: boolean; property Name: String read FName write SetName; property DPI: integer read GetDPI write SetDPI; property SizeInPoints: single read FPointSize write SetPointSize; @@ -946,6 +946,11 @@ end; function TFreeTypeFont.GetCharIndex(AUnicodeChar: integer): integer; begin + if not CheckInstance then + begin + result := 0; + exit; + end; if FCharmapOk then begin if FCharmapSymbol then