summaryrefslogtreecommitdiffstats
path: root/86.patch
blob: 97b15079f66ca3fece0904f2534245284236a714 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From c99f35ad120aa9f8cc95f1262b4f5ecf8ef7598a Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 24 Jun 2020 11:06:47 +0200
Subject: [PATCH] fix #85 regression in DrawSetTextInterlineSpacing

revert 77849ee5a5f0481e0bfd67f72f6b7e07c5d2ba46
revert 147e71502f8f08f986c35bb1387dc0e7543dbcb7

also fix https://github.com/ImageMagick/ImageMagick/issues/2178
---
 magick/annotate.c | 7 ++-----
 magick/draw.c     | 1 +
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/magick/annotate.c b/magick/annotate.c
index 32a08e767..89b06ba36 100644
--- a/magick/annotate.c
+++ b/magick/annotate.c
@@ -324,11 +324,8 @@ MagickExport MagickBooleanType AnnotateImage(Image *image,
     (void) CloneString(&annotate->text,textlist[i]);
     if ((metrics.width == 0) || (annotate->gravity != NorthWestGravity))
       (void) GetTypeMetrics(image,annotate,&metrics);
-    height=(size_t) ceil(metrics.ascent-metrics.descent+
-      draw_info->interline_spacing-0.5);
-    if (height == 0)
-      height=(size_t) ceil(draw_info->pointsize+draw_info->interline_spacing-
-        0.5);
+    height=(ssize_t) (metrics.ascent-metrics.descent+
+      draw_info->interline_spacing+0.5);
     switch (annotate->gravity)
     {
       case UndefinedGravity:
diff --git a/magick/draw.c b/magick/draw.c
index 5950d6ff2..194a9ee27 100644
--- a/magick/draw.c
+++ b/magick/draw.c
@@ -5781,6 +5781,7 @@ MagickExport void GetDrawInfo(const ImageInfo *image_info,DrawInfo *draw_info)
   draw_info->pointsize=12.0;
   if (fabs(clone_info->pointsize) >= MagickEpsilon)
     draw_info->pointsize=clone_info->pointsize;
+  draw_info->interline_spacing=draw_info->pointsize;
   draw_info->undercolor.opacity=(Quantum) TransparentOpacity;
   draw_info->border_color=clone_info->border_color;
   draw_info->compose=OverCompositeOp;