Click or drag to resize

FontSettingsFontsBaseResourceLocation Property

Gets or sets the base resource location where component looks for fonts specified as resources inside the local or referenced assembly.

Read Remarks for details about the format of the FontsBaseResourceLocation for Windows and Web applications.

Namespace:  GemBox.Spreadsheet
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1132
Syntax
public static string FontsBaseResourceLocation { get; set; }

Property Value

Type: String
The base resource location where component looks for fonts specified as resources inside the local or referenced assembly.
Remarks
Important note Important

When you add fonts as resources to your application, make sure you are setting the <Resource> element, and not the <EmbeddedResource> element in your application's project file.

The <EmbeddedResource> element for the build action is not supported.

Following image shows an example of a Windows Console project structure with font files added as resources.

Packaging Fonts in Windows application

Following table illustrates the various base resource locations that you can specify to use fonts from the above Windows Console project structure.

Resource locations consist of required and adjustable parts.

Used fontFontsBaseResourceLocationNotes
Font1.ttf"/"Font resource files are in the root of local assembly.
Font2.ttf"/MyFonts/"Font resource files are in the subfolder of local assembly.
Font3.ttf"/MyClassLibrary;component/"Font resource files are in the root of referenced assembly.
Font4.ttf"/MyClassLibrary;component/MyFonts/"Font resource files are in the subfolder of referenced assembly.

Following image shows an example of a Web ASP.NET project structure with font files added as resources.

Packaging Fonts in Web application

Following table illustrates the various base resource locations that you can specify to use fonts from the above Web ASP.NET project structure.

Since ASP.NET assembly is actually a class library referenced from ASP.NET web server, resource location must always include ;component part.

Used fontFontsBaseResourceLocationNotes
Font1.ttf"/MyWebApplication;component/"Font resource files are in the root of local assembly.
Font2.ttf"/MyWebApplication;component/MyFonts/"Font resource files are in the subfolder of local assembly.
Font3.ttf"/MyClassLibrary;component/"Font resource files are in the root of referenced assembly.
Font4.ttf"/MyClassLibrary;component/MyFonts/"Font resource files are in the subfolder of referenced assembly.
See Also