From 89415fa39253acf6e9c33217d44d7263d3f0f433 Mon Sep 17 00:00:00 2001 From: juha Date: Tue, 31 Jul 2012 19:49:16 +0000 Subject: [PATCH] LCL, GTK2: Font with number got wrong size, issue #21775, patch from G. Zakrzewski git-svn-id: trunk@38097 - --- lcl/include/font.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lcl/include/font.inc b/lcl/include/font.inc index 06d1e48bab..41c6b073c3 100644 --- a/lcl/include/font.inc +++ b/lcl/include/font.inc @@ -534,6 +534,7 @@ var var c: char; validblank: boolean; + InitPos: Integer; function IsBlank: boolean; begin @@ -549,11 +550,13 @@ var Result := ''; validblank := true; ParsePos := Length(LongFontname); + InitPos := ParsePos; while ParsePos>0 do begin c := longFontName[ParsePos]; if IsBlank then if ValidBlank then begin dec(ParsePos); + dec(InitPos); continue end else break; @@ -561,8 +564,14 @@ var if IsDigit then begin Result := C + Result; dec(ParsePos); - end else + end else begin + if not IsBlank then + begin + Result := ''; + ParsePos := InitPos; + end; break; + end; end; end;