LazUtils: Fix LazFreeType glyph bounds. Issue , patch from circular.

git-svn-id: trunk@63126 -
This commit is contained in:
juha 2020-05-09 08:05:41 +00:00
parent 8fccfb64ef
commit d96645d9ff
2 changed files with 6 additions and 4 deletions
components/lazutils

View File

@ -347,7 +347,8 @@ const
(* Get an outline's bounding box *)
(* *)
function TT_Get_Outline_BBox( var out : TT_Outline;
var bbox : TT_Bbox ) : TT_Error;
var bbox : TT_Bbox;
nbPhantomPoints : integer = 0 ) : TT_Error;
(*****************************************************************)
(* Create a new glyph outline *)
@ -1337,7 +1338,8 @@ uses
(* Compute an outline's bounding box *)
(* *)
function TT_Get_Outline_BBox( var out : TT_Outline;
var bbox : TT_Bbox ) : TT_Error;
var bbox : TT_Bbox;
nbPhantomPoints : integer ) : TT_Error;
var
x, y : TT_Pos;
n : Int;
@ -1350,7 +1352,7 @@ uses
yMin := $7FFFFFFF;
yMax := -$80000000;
for n := 0 to out.n_points-1 do
for n := 0 to out.n_points-1-nbPhantomPoints do
begin
x := out.points^[n].x;
if x < xMin then xMin := x;

View File

@ -1233,7 +1233,7 @@ const
glyph^.outline.n_contours := num_contours;
glyph^.outline.second_pass := true;
TT_Get_Outline_BBox( glyph^.outline, glyph^.metrics.bbox );
TT_Get_Outline_BBox( glyph^.outline, glyph^.metrics.bbox, 2 );
glyph^.metrics.horiBearingX := glyph^.metrics.bbox.xMin - subglyph^.pp1.x;
glyph^.metrics.horiBearingY := glyph^.metrics.bbox.yMax;