Fonts
Vue de l’ensemble
‘Font’ est une classe dans Aspose.PDF FOSS pour .NET. hérite de: ‘Contact’.
Type alias pour FontInfo, correspondant au nom de classe Font.
Cette classe fournit 5 méthodes pour travailler avec des objets de Font dans les programmes .NET. Les méthodologies disponibles comprennent: ‘FromFontData’, ‘GetGlyphWidth’, GatLastFonEmbeddingError', ‘MeasureString’, 'Save'. Tous les membres publics sont accessibles à n'importe quelle application .Net après l'installation du Aspose.PDF FOSS pour le package .net. Propriétés: BaseFonte’, ‘‘DecodedFontaineName’,‘‘DefaultHelvetica’,`Encoding’, ‘’FoncteNome’,’’Options’ et 10 autres.
Propriétés
| Name | Type | Access | Description |
|---|---|---|---|
BaseFont | string | Read | Gets the base font. |
FontName | string | Read | Gets the font name. |
DecodedFontName | string | Read | Gets the decoded font name. |
IsEmbedded | bool | Read/Write | Gets or sets the is embedded. |
IsSubset | bool | Read/Write | Gets or sets the is subset. |
IsAccessible | bool | Read | Gets the is accessible. |
FontOptions | IFontOptions | Read | Gets the font options. |
iPdfFont | PdfFontView | Read | Lower-level PDF-font view of this Font. |
DefaultHelvetica | Font | Read | Default Helvetica font for detached text fragments. |
ResourceName | string | Read | Resource name in the page’s font dictionary (e.g., “F1”). |
UniqueId | string | Read | Unique identifier combining resource name and base font. |
Subtype | string | Read | Font subtype (Type1, TrueType, Type0, Type3, etc.). |
Encoding | string? | Read | Encoding name (WinAnsiEncoding, Identity-H, etc.). |
IsItalic | bool | Read | Whether the font is italic. |
IsBold | bool | Read | Whether the font is bold. |
IsCid | bool | Read | Whether the font is a CID (Type0) font — used for Arabic, CJK, etc. |
méthodes
| Signature | Description |
|---|---|
GetLastFontEmbeddingError() | Last error encountered embedding this font in a PDF; empty when none. |
MeasureString(str: string, fontSize: float) | Measure the rendered width of a string at the given size, in points. |
Save(stream: System.IO.Stream) | Write the raw font file data to a stream. |
FromFontData(fontData: FontData) | Create a FontInfo from a FontData (system font found via FontRepository.FindFont). |
GetGlyphWidth(charCode: int) | Get the width of a character code in 1/1000 text space units. |
Voir aussi
- Aspose.PDF pour .NET — API d’entreprise