From ed90ab82a880d9b63d5adecdc23c5cd5020addc1 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Tue, 13 Dec 2016 08:13:29 +1100 Subject: [PATCH] font/sfnt: add a comment about contour ordering. Change-Id: I591c735cc1c3108aa806b0a7be6c54152fe2029e Reviewed-on: https://go-review.googlesource.com/34174 Reviewed-by: Dave Day --- font/sfnt/sfnt_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/font/sfnt/sfnt_test.go b/font/sfnt/sfnt_test.go index fe43d32..38f0789 100644 --- a/font/sfnt/sfnt_test.go +++ b/font/sfnt/sfnt_test.go @@ -87,8 +87,13 @@ func TestPostScript(t *testing.T) { } // wants' vectors correspond 1-to-1 to what's in the CFFTest.sfd file, - // although for some unknown reason, FontForge reverses the order somewhere - // along the way when converting from SFD to OpenType/CFF. + // although OpenType/CFF and FontForge's SFD have reversed orders. + // https://fontforge.github.io/validation.html says that "All paths must be + // drawn in a consistent direction. Clockwise for external paths, + // anti-clockwise for internal paths. (Actually PostScript requires the + // exact opposite, but FontForge reverses PostScript contours when it loads + // them so that everything is consistant internally -- and reverses them + // again when it saves them, of course)." // // The .notdef glyph isn't explicitly in the SFD file, but for some unknown // reason, FontForge generates a .notdef glyph in the OpenType/CFF file.