Skip to content

Commit bb53a8f

Browse files
committed
Editor: reload bitmap font after import
1 parent 9495ed4 commit bb53a8f

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Editor/AGS.Editor/NativeProxy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ public void ImportSCIFont(string fileName, int fontSlot)
195195
_native.ImportSCIFont(fileName, fontSlot);
196196
}
197197

198-
public void ReloadTTFFont(int fontSlot)
198+
public void ReloadFont(int fontSlot)
199199
{
200-
_native.ReloadTTFFont(fontSlot);
200+
_native.ReloadFont(fontSlot);
201201
}
202202

203203
public void OnFontUpdated(Game game, int fontSlot, bool forceUpdate)

Editor/AGS.Editor/Panes/FontEditor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private void ImportTTFFont(string fileName, string newTTFName, string newWFNName
8282
{
8383
Factory.AGSEditor.DeleteFileOnDiskAndSourceControl(newWFNName);
8484
}
85-
Factory.NativeProxy.ReloadTTFFont(_item.ID);
85+
Factory.NativeProxy.ReloadFont(_item.ID);
8686
_item.PointSize = fontSize;
8787
_item.SizeMultiplier = 1;
8888
_item.SourceFilename = Utilities.GetRelativeToProjectPath(fileName);
@@ -112,7 +112,7 @@ private void ImportWFNFont(string fileName, string newTTFName, string newWFNName
112112
{
113113
Factory.NativeProxy.ImportSCIFont(fileName, _item.ID);
114114
}
115-
115+
Factory.NativeProxy.ReloadFont(_item.ID);
116116
_item.PointSize = 0;
117117
_item.SizeMultiplier = 1;
118118
_item.SourceFilename = Utilities.GetRelativeToProjectPath(fileName);

Editor/AGS.Native/NativeMethods.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ namespace AGS
238238
}
239239
}
240240

241-
void NativeMethods::ReloadTTFFont(int fontSlot)
241+
void NativeMethods::ReloadFont(int fontSlot)
242242
{
243243
if (!reload_font(fontSlot))
244244
{
245-
throw gcnew AGSEditorException("Unable to load the TTF font file. The renderer was unable to load the font.");
245+
throw gcnew AGSEditorException(String::Format("Unable to load font {0}. No supported font renderer was able to load the font.", fontSlot));
246246
}
247247
}
248248

Editor/AGS.Native/NativeMethods.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace AGS
5353
void Shutdown();
5454
Game^ ImportOldGameFile(String^ fileName);
5555
void ImportSCIFont(String ^fileName, int fontSlot);
56-
void ReloadTTFFont(int fontSlot);
56+
void ReloadFont(int fontSlot);
5757
void OnGameFontUpdated(Game^ game, int fontSlot, bool forceUpdate);
5858
Dictionary<int,Sprite^>^ LoadAllSpriteDimensions();
5959
void LoadNewSpriteFile();

0 commit comments

Comments
 (0)