VectSharp 2.5.0
A light library for C# vector graphics
Loading...
Searching...
No Matches
VectSharp.FontFamily Class Reference

Represents a typeface. More...

Inheritance diagram for VectSharp.FontFamily:

Public Types

enum  StandardFontFamilies
 The 14 standard font families. More...
 

Public Member Functions

 FontFamily (string fileName)
 Create a new FontFamily. More...
 
 FontFamily (Stream ttfStream)
 Create a new FontFamily. More...
 
 FontFamily (TrueTypeFile ttf)
 Create a new FontFamily. More...
 
 FontFamily (StandardFontFamilies standardFontFamily)
 Create a new standard FontFamily. More...
 

Static Public Member Functions

static FontFamily ResolveFontFamily (string fontFamily)
 Create a new font family from the specified family name or true type file. If the family name or the true type file are not valid, an exception might be raised. Equivalent to DefaultFontLibrary.ResolveFontFamily. More...
 
static FontFamily ResolveFontFamily (StandardFontFamilies standardFontFamily)
 Create a new font family from the specified standard font family name. Equivalent to DefaultFontLibrary.ResolveFontFamily. More...
 
static FontFamily ResolveFontFamily (string fontFamily, params string[] fallback)
 Create a new font family from the specified family name or true type file. If the family name or the true type file are not valid, try to instantiate the font family using the fallback . If none of the fallback family names or true type files are valid, an exception might be raised. Equivalent to DefaultFontLibrary.ResolveFontFamily. More...
 
static FontFamily ResolveFontFamily (string fontFamily, StandardFontFamilies finalFallback, params string[] fallback)
 Create a new font family from the specified family name or true type file. If the family name or the true type file are not valid, try to instantiate the font family using the fallback . If none of the fallback family names or true type files are valid, instantiate a standard font family using the finalFallback . Equivalent to DefaultFontLibrary.ResolveFontFamily. More...
 

Static Public Attributes

static string[] StandardFamilies = new string[] { "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Helvetica-BoldOblique", "Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique", "Symbol", "ZapfDingbats" }
 The names of the 14 standard families that are guaranteed to be displayed correctly. More...
 
static string[] StandardFontFamilyResources
 The names of the resource streams pointing to the included TrueType font files for each of the standard 14 font families. More...
 

Properties

static IFontLibrary DefaultFontLibrary = new DefaultFontLibrary() [get, set]
 The default font library used to resolve font family names. More...
 
bool IsStandardFamily [get]
 Whether this is one of the 14 standard font families or not. More...
 
string FileName [get]
 Full path to the TrueType font file for this font family (or, if this is a standard font family, name of the font family). More...
 
string FamilyName [get]
 Name of the font family, including any variantes. More...
 
TrueTypeFile TrueTypeFile [get]
 Parsed TrueType font file for this font family. See also:

See also
VectSharp.TrueTypeFile

. More...

 
bool IsBold [get]
 Whether this font is bold or not. This is set based on the information included in the OS/2 table of the TrueType file. More...
 
bool IsItalic [get]
 Whether this font is italic or oblique or not. This is set based on the information included in the OS/2 table of the TrueType file. More...
 
bool IsOblique [get]
 Whether this font is oblique or not. This is set based on the information included in the OS/2 table of the TrueType file. More...
 

Detailed Description

Represents a typeface.

Definition at line 420 of file Font.cs.

Member Enumeration Documentation

◆ StandardFontFamilies

The 14 standard font families.

Definition at line 499 of file Font.cs.

Constructor & Destructor Documentation

◆ FontFamily() [1/4]

VectSharp.FontFamily.FontFamily ( string  fileName)

Create a new FontFamily.

Parameters
fileNameThe full path to the TrueType font file for this font family or the name of a standard font family.

Definition at line 608 of file Font.cs.

◆ FontFamily() [2/4]

VectSharp.FontFamily.FontFamily ( Stream  ttfStream)

Create a new FontFamily.

Parameters
ttfStreamA stream containing a file in TTF format.

Definition at line 633 of file Font.cs.

◆ FontFamily() [3/4]

VectSharp.FontFamily.FontFamily ( TrueTypeFile  ttf)

Create a new FontFamily.

Parameters
ttfA font file in TTF format.

Definition at line 653 of file Font.cs.

◆ FontFamily() [4/4]

VectSharp.FontFamily.FontFamily ( StandardFontFamilies  standardFontFamily)

Create a new standard FontFamily.

Parameters
standardFontFamilyThe standard font family.

Definition at line 674 of file Font.cs.

Member Function Documentation

◆ ResolveFontFamily() [1/4]

static FontFamily VectSharp.FontFamily.ResolveFontFamily ( StandardFontFamilies  standardFontFamily)
static

Create a new font family from the specified standard font family name. Equivalent to DefaultFontLibrary.ResolveFontFamily.

Parameters
standardFontFamilyThe standard name of the font family.
Returns
A FontFamily object corresponding to the specified font family.

◆ ResolveFontFamily() [2/4]

static FontFamily VectSharp.FontFamily.ResolveFontFamily ( string  fontFamily)
static

Create a new font family from the specified family name or true type file. If the family name or the true type file are not valid, an exception might be raised. Equivalent to DefaultFontLibrary.ResolveFontFamily.

Parameters
fontFamilyThe name of the font family to create, or the path to a TTF file.
Returns
If the font family name or the true type file is valid, a FontFamily object corresponding to the specified font family.

◆ ResolveFontFamily() [3/4]

static FontFamily VectSharp.FontFamily.ResolveFontFamily ( string  fontFamily,
params string[]  fallback 
)
static

Create a new font family from the specified family name or true type file. If the family name or the true type file are not valid, try to instantiate the font family using the fallback . If none of the fallback family names or true type files are valid, an exception might be raised. Equivalent to DefaultFontLibrary.ResolveFontFamily.

Parameters
fontFamilyThe name of the font family to create, or the path to a TTF file.
fallbackNames of additional font families or TTF files, which will be tried if the first fontFamily is not valid.
Returns
A FontFamily object corresponding to the first of the specified font families that is valid.

◆ ResolveFontFamily() [4/4]

static FontFamily VectSharp.FontFamily.ResolveFontFamily ( string  fontFamily,
StandardFontFamilies  finalFallback,
params string[]  fallback 
)
static

Create a new font family from the specified family name or true type file. If the family name or the true type file are not valid, try to instantiate the font family using the fallback . If none of the fallback family names or true type files are valid, instantiate a standard font family using the finalFallback . Equivalent to DefaultFontLibrary.ResolveFontFamily.

Parameters
fontFamilyThe name of the font family to create, or the path to a TTF file.
fallbackNames of additional font families or TTF files, which will be tried if the first fontFamily is not valid.
finalFallbackThe standard name of the font family that will be used if none of the fallback families are valid.
Returns
A FontFamily object corresponding to the first of the specified font families that is valid.

Member Data Documentation

◆ StandardFamilies

string [] VectSharp.FontFamily.StandardFamilies = new string[] { "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Helvetica-BoldOblique", "Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique", "Symbol", "ZapfDingbats" }
static

The names of the 14 standard families that are guaranteed to be displayed correctly.

Definition at line 478 of file Font.cs.

◆ StandardFontFamilyResources

string [] VectSharp.FontFamily.StandardFontFamilyResources
static
Initial value:
= new string[]
{
"VectSharp.StandardFonts.Tinos-Regular.ttf", "VectSharp.StandardFonts.Tinos-Bold.ttf", "VectSharp.StandardFonts.Tinos-Italic.ttf", "VectSharp.StandardFonts.Tinos-BoldItalic.ttf",
"VectSharp.StandardFonts.Arimo-Regular.ttf", "VectSharp.StandardFonts.Arimo-Bold.ttf", "VectSharp.StandardFonts.Arimo-Italic.ttf", "VectSharp.StandardFonts.Arimo-BoldItalic.ttf",
"VectSharp.StandardFonts.Cousine-Regular.ttf", "VectSharp.StandardFonts.Cousine-Bold.ttf", "VectSharp.StandardFonts.Cousine-Italic.ttf", "VectSharp.StandardFonts.Cousine-BoldItalic.ttf",
"VectSharp.StandardFonts.SymbolNeu_GB.ttf", "VectSharp.StandardFonts.Levibats-Regular_GB.ttf"
}

The names of the resource streams pointing to the included TrueType font files for each of the standard 14 font families.

Definition at line 483 of file Font.cs.

Property Documentation

◆ DefaultFontLibrary

IFontLibrary VectSharp.FontFamily.DefaultFontLibrary = new DefaultFontLibrary()
staticgetset

The default font library used to resolve font family names.

Definition at line 425 of file Font.cs.

◆ FamilyName

string VectSharp.FontFamily.FamilyName
get

Name of the font family, including any variantes.

Definition at line 580 of file Font.cs.

◆ FileName

string VectSharp.FontFamily.FileName
get

Full path to the TrueType font file for this font family (or, if this is a standard font family, name of the font family).

Definition at line 575 of file Font.cs.

◆ IsBold

bool VectSharp.FontFamily.IsBold
get

Whether this font is bold or not. This is set based on the information included in the OS/2 table of the TrueType file.

Definition at line 591 of file Font.cs.

◆ IsItalic

bool VectSharp.FontFamily.IsItalic
get

Whether this font is italic or oblique or not. This is set based on the information included in the OS/2 table of the TrueType file.

Definition at line 596 of file Font.cs.

◆ IsOblique

bool VectSharp.FontFamily.IsOblique
get

Whether this font is oblique or not. This is set based on the information included in the OS/2 table of the TrueType file.

Definition at line 601 of file Font.cs.

◆ IsStandardFamily

bool VectSharp.FontFamily.IsStandardFamily
get

Whether this is one of the 14 standard font families or not.

Definition at line 494 of file Font.cs.

◆ TrueTypeFile

TrueTypeFile VectSharp.FontFamily.TrueTypeFile
get

Parsed TrueType font file for this font family. See also:

See also
VectSharp.TrueTypeFile

.

Definition at line 586 of file Font.cs.


The documentation for this class was generated from the following file: