ApiExamples.ExRendering.SetFontSubstitutes C# (CSharp) Метод

SetFontSubstitutes() приватный Метод

private SetFontSubstitutes ( ) : void
Результат void
        public void SetFontSubstitutes()
        {
            FontSettings fontSettings = new FontSettings();
            fontSettings.SetFontSubstitutes("Times New Roman", new string[] { "Slab", "Arvo" });
            
            Document doc = new Document(MyDir + "Rendering.doc");
            doc.FontSettings = fontSettings;

            MemoryStream dstStream = new MemoryStream();
            doc.Save(dstStream, SaveFormat.Docx);

            //Check that font source are default
            FontSourceBase[] fontSource = doc.FontSettings.GetFontsSources();
            Assert.AreEqual("SystemFonts", fontSource[0].Type.ToString());

            Assert.AreEqual("Times New Roman", doc.FontSettings.DefaultFontName);

            string[] alternativeFonts = doc.FontSettings.GetFontSubstitutes("Times New Roman");
            Assert.AreEqual(new string[] { "Slab", "Arvo" }, alternativeFonts);
        }