freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] [PATCH 1/2] Improve FT_Outline_Embolden for the unintende


From: Byeongsik Jeon
Subject: Re: [ft-devel] [PATCH 1/2] Improve FT_Outline_Embolden for the unintended arfifacts problem (#45597).
Date: Fri, 5 Oct 2018 05:05:27 +0900
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

Hi.

+  det == 0 case:
+     i.x == i.y == 0, or
+     o.x == o.y == 0, or
+     abs( gradient i ) == abs( gradient o )
+

+        /* The shift vector is only calculated from the corner type segment.
+           Other points -- zero length segment, forward straight segment,
+           wrong forward and backward mixed straight segment -- use this
+           shift vector as it is. Note the "in.x * out.y - in.y * out.x".
+
+           wrong forward and backward mixed straight segment:
+             one of the causes of unintended artifact generation.
+         */

It's the segnemts of zero length.
The other problem is the worng frward-backward mixed straight segment (Bauhaus 'O'). This is abs( gradient i ) == abs (gradient o), or det == 0.


+        /* The large shift value creates a cross point, which appears
+           as one of the artifacts. The shift value limitation inhibits
+           the occurrence of artifacts. */
+        shift.x = FT_MAX( FT_MIN( shift.x, strength.x ), -strength.x );
+        shift.y = FT_MAX( FT_MIN( shift.y, strength.y ), -strength.y );
+

Maybe, it is threshold on the determinant. This inhibits the sarpen corner, and the cross point artifacts.


On Thu, 4 Oct 2018 15:29:42 -0400, Alexei Podtelezhnikov <address@hidden> wrote:
+  two coalition equation solution:
+    det = i.y * o.x - i.x * o.y , det != 0
+    shift.x = strength * ( i.x - o.x ) / det
+    shift.y = strength * ( i.y - o.y ) / det

So your algorithm is exactly the same as the one implemented
currently. The tricky part is how you deal with very short collapsing
segments, the segments of zero length, and your threshold on the
determinant. Can you please elaborate on that and explain why your
algorithm is superior?




reply via email to

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