#!@abs_top_builddir@/fontforgeexe/fontforge
#Needs: fonts/QuadraticConversionBug.sfd, fonts/CourierNew.ttf
#Make sure quadratic conversion works...

Open("@abs_srcdir@/fonts/QuadraticConversionBug.sfd");
# the following use to crash (when in a script)
SetFontOrder(2);
Save("@abs_builddir@/results/QuadraticConversionBug2.sfd")
Close()
# this used to give us IErrors
Open("@abs_builddir@/results/QuadraticConversionBug2.sfd")
Close()

# Ok. We can do the conversion without egregious errors. But are the glyphs similar?
Open("@abs_srcdir@/fonts/QuadraticConversionBug.sfd");
Reencode("Original");
SelectAll()
Copy()
SetFontOrder(2);
CompareGlyphs(-1,1.5)
Close()

#Now can we go to cubic?
Open("@abs_srcdir@/fonts/CourierNew.ttf");
Generate("@abs_builddir@/results/CourierNew.pfb")
SetFontOrder(3);
Save("@abs_builddir@/results/CourierNew.sfd")
Close()
Open("@abs_builddir@/results/CourierNew.pfb")
Close()
Open("@abs_builddir@/results/CourierNew.sfd")
Close()

Quit()
