Beispiel #1
0
 public static FontUtil GetInstance()
 {
     if (inst == null)
     {
         inst = new FontUtil();
         inst.GetAllFonts();
     }
     return inst;
 }
Beispiel #2
0
        public static void CopyFontToResources(string fontName, string resourceFolder)
        {
            char   ds         = Path.DirectorySeparatorChar;
            string fontPath   = FontUtil.GetInstance().FontMap[fontName];
            string fileName   = fontPath.Substring(fontPath.LastIndexOf(ds));
            string targetPath = resourceFolder + ds + fileName;

            IOUtils.EnsurePath(targetPath);
            if (!File.Exists(targetPath))
            {
                File.Copy(fontPath, targetPath);
            }
        }