[Fontconfig] fontconfig: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 20 06:59:36 UTC 2019


 src/fcweight.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f2d4291d12ca1a2146d90da32a399fffff3e8227
Author: Egmont Koblinger <egmont at gmail.com>
Date:   Wed Jun 19 11:45:05 2019 +0200

    Fix the linear interpolation during weight mapping
    
    Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/164

diff --git a/src/fcweight.c b/src/fcweight.c
index 276b467..224299e 100644
--- a/src/fcweight.c
+++ b/src/fcweight.c
@@ -46,7 +46,7 @@ static double lerp(double x, int x1, int x2, int y1, int y2)
   int dx = x2 - x1;
   int dy = y2 - y1;
   assert (dx > 0 && dy >= 0 && x1 <= x && x <= x2);
-  return y1 + (dy*(x-x1) + dx/2) / dx;
+  return y1 + (x-x1) * dy / dx;
 }
 
 double


More information about the Fontconfig mailing list