SupportFontFaceRules

HtmlLoadOptions.SupportFontFaceRules property

Ottiene o imposta un valore che indica se supportare le regole @font-face e se caricare i font dichiarati. Il valore predefinito è falso .

public bool SupportFontFaceRules { get; set; }

Osservazioni

Se questa opzione è abilitata, i font dichiarati nelle regole @font-face vengono caricati e incorporati nelle definizioni dei font del documento risultante (vedereFontInfos ). Questo rende i font caricati disponibili per il rendering, ma non abilita automaticamente l’incorporamento dei font al momento del salvataggio. Per salvare il documento con i font caricati, ilEmbedTrueTypeFonts proprietà delFontInfos La raccolta dovrebbe essere impostata suVERO .

I formati di font supportati sono TTF, EOT e WOFF.

Le regole @font-face non sono supportate durante il caricamento di immagini SVG.

Esempi

Mostra come caricare le regole “@font-face” dichiarate.

HtmlLoadOptions loadOptions = new HtmlLoadOptions();
loadOptions.SupportFontFaceRules = true;
Document doc = new Document(MyDir + "Html with FontFace.html", loadOptions);

Assert.AreEqual("Squarish Sans CT Regular", doc.FontInfos[0].Name);

Guarda anche