using Newtonsoft.Json; using SixLabors.Fonts; using SixLabors.ImageSharp.PixelFormats; namespace ClockExtension { public class ClockData { public static ClockData Load(string extDir,FontCollection coll) { string fontDir = Path.Combine(extDir,"Fonts"); if(Directory.Exists(fontDir)){ foreach(var ttf in Directory.GetFiles(fontDir,"*.ttf")) { coll.Add(ttf); } } string extInfoFile=Path.Combine(extDir,"ext_info.json"); if(File.Exists(extInfoFile)) { string extInfoFileString = File.ReadAllText(extInfoFile); var cd=JsonConvert.DeserializeObject(extInfoFileString); if(cd != null) { cd.FilePath = extInfoFile; FontFamily[] fam = coll.Families.ToArray(); for(int i = 0;i