예제 #1
0
 public static string InvalidateFontsAction()
 {
     if (AppDomain.CurrentDomain.FriendlyName.Contains("Orange"))
     {
         return("Run this command from Tangerine!");
     }
     foreach (var configPath in EnumerateFontConfigs(AssetPath.Combine(The.Workspace.AssetsDirectory, "Fonts/")))
     {
         Console.WriteLine($"Processing {configPath}..");
         try {
             var tftPath = Path.ChangeExtension(configPath, "tft");
             if (
                 File.Exists(tftPath) &&
                 new System.IO.FileInfo(configPath).LastWriteTime <=
                 new System.IO.FileInfo(tftPath).LastWriteTime
                 )
             {
                 Console.WriteLine($"{tftPath} is up to date.");
                 continue;
             }
             FontGenerator.UpdateCharSetsAndGenerateFont(
                 new Uri(The.Workspace.AssetsDirectory + "\\").MakeRelativeUri(new Uri(configPath)).OriginalString,
                 The.Workspace.AssetsDirectory
                 );
         } catch (Exception e) {
             Console.WriteLine($"Failed to generate font using {configPath} config");
             Console.WriteLine(e);
         }
     }
     return(null);
 }
예제 #2
0
 public static string InvalidateFontsAction()
 {
     foreach (var configPath in EnumerateFontConfigs(AssetPath.Combine(The.Workspace.AssetsDirectory, "Fonts/")))
     {
         Console.WriteLine($"Processing {configPath}..");
         try {
             var tftPath = Path.ChangeExtension(configPath, "tft");
             FontGenerator.UpdateCharSetsAndGenerateFont(
                 new Uri(The.Workspace.AssetsDirectory + "\\").MakeRelativeUri(new Uri(configPath)).OriginalString,
                 The.Workspace.AssetsDirectory
                 );
         } catch (Exception e) {
             Console.WriteLine($"Failed to generate font using {configPath} config");
             Console.WriteLine(e);
         }
     }
     return(null);
 }