freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master e52d328: [ftgrid] Fix dot position and shape.


From: Alexei Podtelezhnikov
Subject: [freetype2-demos] master e52d328: [ftgrid] Fix dot position and shape.
Date: Wed, 03 Feb 2016 03:54:44 +0000

branch: master
commit e52d32886828a3dbe4fcbcc33db40548fdc064b1
Author: Alexei Podtelezhnikov <address@hidden>
Commit: Alexei Podtelezhnikov <address@hidden>

    [ftgrid] Fix dot position and shape.
    
    * src/ftgrid.c (circle_draw): Correct subpixel positioning.
    (ft_outline_new_circle): Correct circle approximation.
---
 ChangeLog    |    7 +++++++
 src/ftgrid.c |    6 ++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9802084..0ac1e43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-02-02  Alexei Podtelezhnikov  <address@hidden>
+
+       [ftgrid] Fix dot position and shape.
+
+       * src/ftgrid.c (circle_draw): Correct subpixel positioning.
+       (ft_outline_new_circle): Correct circle approximation.
+
 2016-02-01  Nikolaus Waxweiler  <address@hidden>
 
        [ftview] Fix toggling of `force auto-hinter' in light mode.
diff --git a/src/ftgrid.c b/src/ftgrid.c
index 86339b9..0deaae2 100644
--- a/src/ftgrid.c
+++ b/src/ftgrid.c
@@ -474,7 +474,8 @@
   {
     char*       tag;
     FT_Vector*  vec;
-    FT_F26Dot6  disp = (FT_F26Dot6)( radius * 0.6781 );
+    FT_F26Dot6  disp = (FT_F26Dot6)( radius * 0.5523 );
+    /* so that Bézier curve touches circle at 0, 45, and 90 degrees */
 
 
     FT_Outline_New( handle->library, 12, 1, outline );
@@ -512,7 +513,8 @@
 
 
     ft_outline_new_circle( &outline, radius, handle );
-    FT_Outline_Translate( &outline, center_x & 63, center_y & 63 );
+    /* subpixel adjustment considering downward direction of y-axis */
+    FT_Outline_Translate( &outline, center_x & 63, -( center_y & 63 ) );
 
     ft_outline_draw( &outline, 1., ( center_x >> 6 ), ( center_y >> 6 ),
                      handle, display, color );



reply via email to

[Prev in Thread] Current Thread [Next in Thread]