public void ReloadData() { this.needsReload = false; if (this.Characters == CharacterSet.Dynamic || this.pixelData == null) { this.ReleaseResources(); this.UpdateInternalFont(); this.maxGlyphWidth = 0; this.height = 0; this.ascent = 0; this.bodyAscent = 0; this.descent = 0; this.baseLine = 0; this.glyphs = new GlyphData[SupportedChars.Length]; this.GenerateResources(); // Monospace offset adjustments if (this.monospace) { for (int i = 0; i < SupportedChars.Length; ++i) { this.glyphs[i].offsetX -= (int)Math.Round((this.maxGlyphWidth - this.glyphs[i].width) / 2.0f); } } // Kerning data this.UpdateKerningData(); } else { Init(this.pixelData); CreateInternalTexture(); CreateInternalMaterial(); this.needsReload = true; } }
public void ImportFile(string srcFile, string targetName, string targetDir) { string[] output = this.GetOutputFiles(srcFile, targetName, targetDir); Font res = new Font(); res.LoadCustomFamilyData(srcFile); res.ReloadData(); res.Save(output[0]); }