private void ImportTTFFont(string fileName, string newTTFName, string newWFNName)
{
int fontSize = NumberEntryDialog.Show("Font size", "Select the font size to import this TTF font at:", DEFAULT_IMPORTED_FONT_SIZE, 1);
if (fontSize > 0)
{
File.Copy(fileName, newTTFName, true);
try
{
if (File.Exists(newWFNName))
{
Factory.AGSEditor.DeleteFileOnDiskAndSourceControl(newWFNName);
}
Factory.NativeProxy.ReloadFont(_item.ID);
_item.PointSize = fontSize;
_item.SizeMultiplier = 1;
_item.SourceFilename = Utilities.GetRelativeToProjectPath(fileName);
}
catch (AGSEditorException ex)
{
Factory.GUIController.ShowMessage("Unable to import the font.\n\n" + ex.Message, MessageBoxIcon.Warning);
File.Delete(newTTFName);
}
}
}