private int ValidateFont(Validator v, string fpath, SafeFileHandle hFile,int i,int n)
{
string sReportFile = "";
OTFileVal fontFile;
int ret = 0;
// create a FontFile Object
fontFile = new OTFileVal(v);
m_callbacks.OnOTFileValChange(fontFile);
// open the report file
sReportFile = m_callbacks.GetReportFileName(fpath);
OpenXmlReportFile(sReportFile, fpath);
m_callbacks.OnOpenReportFile(sReportFile, fpath);
// open the font file and validate it
#if !OLD_INTERFACE
bool isvalid = (hFile == null) ? fontFile.open(fpath) : fontFile.open(hFile);
#else
bool isvalid = fontFile.open(fpath);
#endif
//if the font file is invalid, we just do not go on with validation and output the results
//this apparently fixed a lot of bugs (1231, 1429, 934, 1335)
//Check if the sample font files are really invalid
if (isvalid)
{
m_callbacks.OnBeginFontTest(fpath, i, n);
#if !OLD_INTERFACE
if (!fontFile.Validate())
{
ret = 1;
}
#else
fontFile.Validate();
#endif
fontFile.close();
}
else
{
ret = 1;
}
fontFile = null;
m_callbacks.OnOTFileValChange(fontFile);
CloseXmlReportFile();
m_callbacks.OnCloseReportFile(sReportFile);
return ret;
}