#!/usr/local/bin/fontforge
#Needs: fonts/mingliu.ttc, fonts/GillSans.dfont, fonts/ItalicHand.sfd, fonts/ItalicHand.svg, fonts/MunhwaGothic-Bold, fonts/Caliban.otf

names = FontsInFile("fonts/non-existant-file");
if ( SizeOf(names)!=0 )
  Error("Incorrect behavior on non existant font file" );
endif

names = FontsInFile("fonts/mingliu.ttc");
if ( SizeOf(names)!=2 )
  Error("Incorrect name count on mingliu.ttc" );
elseif ( names[0]!="MingLiU" || names[1]!="PMingLiU" )
  Error("Incorrect names read from mingliu.ttc ("+names[0]+","+names[1]+")" );
endif

names = FontsInFile("fonts/GillSans.dfont");
if ( SizeOf(names)!=6 )
  Error("Incorrect name count on GillSans.dfont" );
elseif ( names[0]!="Gill Sans Light" || names[1]!="Gill Sans Bold" || names[2]!="Gill Sans Light Italic" || names[3]!="Gill Sans Italic" || names[4]!="Gill Sans Bold Italic" || names[5]!="Gill Sans" )
  Error("Incorrect names read from GillSans.dfont ("+names[0]+","+names[1]+","+names[2]+","+names[3]+","+names[4]+","+names[5]+")" );
endif

names = FontsInFile("fonts/ItalicHand.sfd");
if ( SizeOf(names)!=1 )
  Error("Incorrect name count on ItalicHand.sfd" );
elseif ( names[0]!="ItalicHand" )
  Error("Incorrect names read from ItalicHand.sfd ("+names[0]+")" );
endif

names = FontsInFile("fonts/ItalicHand.svg");
if ( SizeOf(names)!=1 )
  Error("Incorrect name count on ItalicHand.svg" );
elseif ( names[0]!="ItalicHand" )
  Error("Incorrect names read from ItalicHand.svg ("+names[0]+")" );
endif

names = FontsInFile("fonts/MunhwaGothic-Bold");
if ( SizeOf(names)!=1 )
  Error("Incorrect name count on MunhwaGothic-Bold" );
elseif ( names[0]!="MunhwaGothic-Bold" )
  Error("Incorrect names read from MunhwaGothic-Bold ("+names[0]+")" );
endif

names = FontsInFile("fonts/Caliban.otf");
if ( SizeOf(names)!=1 )
  Error("Incorrect name count on Caliban.otf" );
elseif ( names[0]!="Caliban" )
  Error("Incorrect names read from Caliban.otf ("+names[0]+")" );
endif
