On Tue, 2006-10-03 at 03:48, Edward G.J. Lee wrote:
> Hello George,
>
> > > > CorrectDirection()
> > > > ExpandStroke(10, 0, 0, 0, 1)
> > >
> > > You will mess it up in some CJK glyph, because you don't
> > > know which contour you need remove. It's not always to
> > > remove internal contour.
> > I think, that since he's done a CorrectDirection first, it should always
> > be the internal contour.
>
> You can test this font(two glyphs only, U+6708/U+66F2),
> http://edt1023.sayya.org/fonts/tmp/ContourTest.sfd.gz
> If I select `Remove Internal Contour' and `Cleanup
> Self Intersect' then the direction will going wrong.
So it will
--- sinestroke.c~ 2006-10-08 19:36:04.000000000 -0700
+++ splinestroke.c 2006-10-08 19:48:04.000000000 -0700
@@ -1106,14 +1106,14 @@
}
static SplineSet *SSFixupOverlap(StrokeInfo *si,SplineChar *sc,
- SplineSet *ssplus,SplineSet *ssminus) {
+ SplineSet *ssplus,SplineSet *ssminus, int reversed) {
ssplus->next = ssminus;
ssplus = SplineSetRemoveOverlap(sc,ssplus,over_remove);
if ( si->removeinternal || si->removeexternal ) {
SplineSet *prev, *spl, *next;
prev = NULL;
for ( spl=ssplus; spl!=NULL; spl = next ) {
- int clock = SplinePointListIsClockwise(spl);
+ int clock = SplinePointListIsClockwise(spl) ^ reversed;
next = spl->next;
if (( !clock && si->removeinternal ) || ( clock &&
si->removeexternal )) {
SplinePointListFree(spl);
@@ -1627,7 +1627,7 @@
if ( ssplus != NULL )
SplineSetReverse(ssplus);
if ( si->removeoverlapifneeded && si->gottoobiglocal && ssplus!=NULL )
- ssplus = SSFixupOverlap(si,sc,ssplus,ssminus);
+ ssplus = SSFixupOverlap(si,sc,ssplus,ssminus,reversed);
else if ( si->removeinternal && ssplus!=NULL ) {
SplinePointListFree(ssminus);
} else if ( si->removeexternal ) {
_______________________________________________
Cjk maillist - [email protected]
http://lists.ffii.org/mailman/listinfo/cjk