Duality.Resources.Font.LoadCustomFamilyData C# (CSharp) 메소드

LoadCustomFamilyData() 공개 메소드

Replaces the Fonts custom font family with a new dataset that has been retrieved from file.
public LoadCustomFamilyData ( string path = null ) : void
path string The path of the file from which to retrieve the new font family data.
리턴 void
        public void LoadCustomFamilyData(string path = null)
        {
            if (path == null) path = this.sourcePath;

            this.sourcePath = path;

            if (String.IsNullOrEmpty(this.sourcePath) || !File.Exists(this.sourcePath))
                this.sourcePath = null;
            else
            {
                this.customFamilyData = File.ReadAllBytes(this.sourcePath);
                this.familyName = LoadFontFamilyFromMemory(this.customFamilyData).Name;
            }
        }

Usage Example

예제 #1
0
 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]);
 }