ExportFontFormat

ExportFontFormat enumeration

HTML sabit biçimine dönüştürülürken yazı tiplerini dışa aktarmak için kullanılan biçimi belirtir.

public enum ExportFontFormat

değerler

İsimDeğerTanım
Woff0WOFF (Web Açık Yazı Tipi Biçimi).
Ttf1TTF (TrueType Yazı Tipi biçimi).

Örnekler

Bir belgeyi HTML’e kaydederken yalnızca hedef makinedeki yazı tiplerinin nasıl kullanılacağını gösterir.

Document doc = new Document(MyDir + "Bullet points with alternative font.docx");

HtmlFixedSaveOptions saveOptions = new HtmlFixedSaveOptions
{
    ExportEmbeddedCss = true,
    UseTargetMachineFonts = useTargetMachineFonts,
    FontFormat = ExportFontFormat.Ttf,
    ExportEmbeddedFonts = false,
};

doc.Save(ArtifactsDir + "HtmlFixedSaveOptions.UsingMachineFonts.html", saveOptions);

string outDocContents = File.ReadAllText(ArtifactsDir + "HtmlFixedSaveOptions.UsingMachineFonts.html");

if (useTargetMachineFonts)
    Assert.False(Regex.Match(outDocContents, "@font-face").Success);
else
    Assert.True(Regex.Match(outDocContents,
        "@font-face { font-family:'Arial'; font-style:normal; font-weight:normal; src:local[(]'☺'[)], " +
        "url[(]'HtmlFixedSaveOptions.UsingMachineFonts/font001.ttf'[)] format[(]'truetype'[)]; }").Success);

Ayrıca bakınız