EmbeddedFontStyle Enumeration |
Specifies the style of an embedded font inside a
FontInfo object.
Namespace:
Aspose.Words.Fonts
Assembly:
Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax[FlagsAttribute]
public enum EmbeddedFontStyle
<FlagsAttribute>
Public Enumeration EmbeddedFontStyle
[FlagsAttribute]
public enum class EmbeddedFontStyle
[<FlagsAttribute>]
type EmbeddedFontStyle
Members
| Member name | Value | Description |
---|
| Regular | 0 |
Specifies the Regular embedded font.
|
| Bold | 1 |
Specifies the Bold embedded font.
|
| Italic | 2 |
Specifies the Italic embedded font.
|
| BoldItalic | 3 |
Specifies the Bold-Italic embedded font.
|
ExamplesShows how to extract embedded font from a document.
Document doc = new Document(MyDir + "Embedded font.docx");
FontInfo embeddedFont = doc.FontInfos["Alte DIN 1451 Mittelschrift"];
byte[] embeddedFontBytes = embeddedFont.GetEmbeddedFont(EmbeddedFontFormat.OpenType, EmbeddedFontStyle.Regular);
Assert.IsNotNull(embeddedFontBytes);
File.WriteAllBytes(ArtifactsDir + "Alte DIN 1451 Mittelschrift.ttf", embeddedFontBytes);
doc = new Document(MyDir + "Embedded font.doc");
Assert.IsNull(doc.FontInfos["Alte DIN 1451 Mittelschrift"].GetEmbeddedFont(EmbeddedFontFormat.OpenType, EmbeddedFontStyle.Regular));
Assert.IsNotNull(doc.FontInfos["Alte DIN 1451 Mittelschrift"].GetEmbeddedFont(EmbeddedFontFormat.EmbeddedOpenType, EmbeddedFontStyle.Regular));
See Also