Class FontSize
A collection of fonts and there size in pixels used when determining auto widths for columns. This is used as .NET and Excel does not measure font widths in pixels in a similar way.
Inherited Members
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
Syntax
public class FontSize
Fields
DefaultFont
Default font used in EPPlus
Declaration
public const string DefaultFont = "Aptos Narrow"
Field Value
| Type | Description |
|---|---|
| string |
FontHeights
Dictionary containing default Font Heights in pixels for the row height calculates. You can add your own fonts and sizes here.
Declaration
public static Dictionary<string, Dictionary<float, short>> FontHeights
Field Value
| Type | Description |
|---|---|
| Dictionary<string, Dictionary<float, short>> |
FontWidths
Dictionary containing Font Width in pixels. You can add your own fonts and sizes here.
Declaration
public static Dictionary<string, Dictionary<float, short>> FontWidths
Field Value
| Type | Description |
|---|---|
| Dictionary<string, Dictionary<float, short>> |
NonExistingFont
Font used in EPPlus if the font name supplied cannot be found
Declaration
public const string NonExistingFont = "Arial"
Field Value
| Type | Description |
|---|---|
| string |
Methods
LoadAllFontsFromResource()
Load the fonts default heights/widths from the internal resource file
Declaration
public static void LoadAllFontsFromResource()
LoadFontsFromResource(string, bool)
Load the specified fonts default heights/widths from the internal resource file
Declaration
public static void LoadFontsFromResource(string fontName, bool disposeStream = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fontName | The name of the font. |
| bool | disposeStream | If false the stream is loading the font is kept open to load other fonts faster. It true the font-stream is disposed on exit. |