UpdateAmbiguousTextFont

SaveOptions.UpdateAmbiguousTextFont property

Определяет, будут ли изменяться атрибуты шрифта в соответствии с используемым кодом символа.

public bool UpdateAmbiguousTextFont { get; set; }

Примеры

Показывает, как обновить шрифт в соответствии с используемым кодом символа.

Document doc = new Document(MyDir + "Special symbol.docx");
Run run = doc.FirstSection.Body.FirstParagraph.Runs[0];
Console.WriteLine(run.Text); // ฿
Console.WriteLine(run.Font.Name); // Ариал

OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
saveOptions.UpdateAmbiguousTextFont = true;
doc.Save(ArtifactsDir + "OoxmlSaveOptions.UpdateAmbiguousTextFont.docx", saveOptions);

doc = new Document(ArtifactsDir + "OoxmlSaveOptions.UpdateAmbiguousTextFont.docx");
run = doc.FirstSection.Body.FirstParagraph.Runs[0];
Console.WriteLine(run.Text); // ฿
Console.WriteLine(run.Font.Name); // Ангсана Нью

Смотрите также