Package: fontforge
Version: 0.0.20050502-1
Severity: minor
Tags: patch

[I originally intended to send this report to the fontforge-devel mailing
list, but somehow I'm unable to subscribe to it.]

I'm trying to use fontforge to convert Metafont fonts to type1 and
truetype. To this end, I use mf2pt3[1] to generate a type3 font. Then, I
use fontforge to convert the strokes to outlines, and remove overlaps.

There is a problem with the orientation of the resulting outlines in
certain cases. I'm attaching a minimal test case and a patch.

The test case is two variations of the drop-shaped part of an
exclamation-mark. They differ only in the orientation of the stroke. With
the current version of fontforge in debian, both versions are converted to
two concentric shapes instead of the expected single shape.

The patch fixes the problem, but I have no way of knowing whether it breaks
anything (it doesn't seem to). The rationale for the patch is as follows:
After converting a stroke to splines, there are four cases. In all but one
of these cases, the splines are reversed. The shapes in the test file
trigger the case where they are not. I have added reversal of the splines
in that case.

[1] http://www.tug.org/tex-archive/fonts/utilities/mf2pt3/

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-powerpc
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages fontforge depends on:
ii  libc6                    2.3.2.ds1-22    GNU C Library: Shared libraries an
ii  libfreetype6             2.1.10-1        FreeType 2 font engine, shared lib
ii  libice6                  4.3.0.dfsg.1-14 Inter-Client Exchange library
ii  libjpeg62                6b-10           The Independent JPEG Group's JPEG 
ii  libpng12-0               1.2.8rel-1      PNG library - runtime
ii  libsm6                   4.3.0.dfsg.1-13 X Window System Session Management
ii  libtiff4                 3.7.2-3         Tag Image File Format (TIFF) libra
ii  libungif4g               4.1.3-2         shared library for GIF images (run
ii  libx11-6                 4.3.0.dfsg.1-13 X Window System protocol client li
ii  libxi6                   4.3.0.dfsg.1-13 X Window System Input extension li
ii  xlibs                    4.3.0.dfsg.1-13 X Keyboard Extension (XKB) configu
ii  zlib1g                   1:1.2.2-5       compression library - runtime

fontforge recommends no packages.

-- no debconf information
diff -r -u fontforge-20050502/fontforge/splinestroke.c fontforge-mvz/fontforge/splinestroke.c
--- fontforge-20050502/fontforge/splinestroke.c	2005-01-31 03:11:19.000000000 +0100
+++ fontforge-mvz/fontforge/splinestroke.c	2005-06-09 00:36:03.900358773 +0200
@@ -1560,9 +1560,11 @@
 	/* I can't always detect an overlap, so let's always do the remove */
 		/* Sigh, no. That is still too dangerous */
 	/* Note: SSFixupOverlap will remove internal/external as needed */
-	if ( si->removeoverlapifneeded && si->gottoobiglocal && ssplus!=NULL )
+	if ( si->removeoverlapifneeded && si->gottoobiglocal && ssplus!=NULL ) {
+	    SplineSetReverse(ssplus);
+	    SplineSetReverse(ssminus);
 	    ssplus = SSFixupOverlap(si,sc,ssplus,ssminus);
-	else if ( si->removeinternal && ssplus!=NULL ) {
+	} else if ( si->removeinternal && ssplus!=NULL ) {
 	    SplinePointListFree(ssminus);
 	    SplineSetReverse(ssplus);
 	} else if ( si->removeexternal ) {

Attachment: tstr10.pt3
Description: PostScript document

Reply via email to