FontFactoryImp Public class
Description
If you are using True Type fonts, you can declare the paths of the different ttf- and ttc-files to this class first and then create fonts in your code using one of the getFont method without having to enter a path as parameter.
Diagram
flowchart LR classDef interfaceStyle stroke-dasharray: 5 5; classDef abstractStyle stroke-width:4px subgraph iTextSharp.text iTextSharp.text.FontFactoryImp[[FontFactoryImp]] iTextSharp.text.IFontProvider[[IFontProvider]] class iTextSharp.text.IFontProvider interfaceStyle; end iTextSharp.text.IFontProvider --> iTextSharp.text.FontFactoryImp
Members
Properties
Public properties
|
Type |
Name |
Methods |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Methods
Public methods
|
Returns |
Name |
|---|---|
|
|
( |
|
|
( |
|
|
( |
|
|
() |
|
|
( |
|
|
( |
Protected methods
|
Returns |
Name |
|---|---|
|
|
( |
|
|
( |
Details
Summary
If you are using True Type fonts, you can declare the paths of the different ttf- and ttc-files to this class first and then create fonts in your code using one of the getFont method without having to enter a path as parameter.
Inheritance
Constructors
FontFactoryImp
Source code
public FontFactoryImp()
Summary
Creates new FontFactory
Methods
GetFont [1/14]
Source code
public virtual Font GetFont(string fontname, string encoding, bool embedded, float size, int style, BaseColor color)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
encoding |
the encoding of the font |
|
|
embedded |
true if the font is to be embedded in the PDF |
|
|
size |
the size of this font |
|
|
style |
the style of this font |
|
|
color |
the BaseColor of this font |
Summary
Constructs a Font-object.
Returns
a Font object
GetFont [2/14]
Source code
public virtual Font GetFont(string fontname, string encoding, bool embedded, float size, int style, BaseColor color, bool cached)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
encoding |
the encoding of the font |
|
|
embedded |
true if the font is to be embedded in the PDF |
|
|
size |
the size of this font |
|
|
style |
the style of this font |
|
|
color |
the BaseColor of this font |
|
|
cached |
true if the font comes from the cache or is added to the cache if new, false if the font is always created new |
Summary
Constructs a Font-object.
Returns
a Font object
GetBaseFont
Source code
protected virtual BaseFont GetBaseFont(string fontname, string encoding, bool embedded, bool cached)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
|
|
|
encoding |
|
|
|
embedded |
|
|
|
cached |
GetFont [3/14]
Source code
public virtual Font GetFont(string fontname, string encoding, bool embedded, float size, int style)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
encoding |
the encoding of the font |
|
|
embedded |
true if the font is to be embedded in the PDF |
|
|
size |
the size of this font |
|
|
style |
the style of this font |
Summary
Constructs a Font-object.
Returns
a Font object
GetFont [4/14]
Source code
public virtual Font GetFont(string fontname, string encoding, bool embedded, float size)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
encoding |
the encoding of the font |
|
|
embedded |
true if the font is to be embedded in the PDF |
|
|
size |
the size of this font |
Summary
Constructs a Font-object.
Returns
GetFont [5/14]
Source code
public virtual Font GetFont(string fontname, string encoding, bool embedded)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
encoding |
the encoding of the font |
|
|
embedded |
true if the font is to be embedded in the PDF |
Summary
Constructs a Font-object.
Returns
a Font object
GetFont [6/14]
Source code
public virtual Font GetFont(string fontname, string encoding, float size, int style, BaseColor color)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
encoding |
the encoding of the font |
|
|
size |
the size of this font |
|
|
style |
the style of this font |
|
|
color |
the BaseColor of this font |
Summary
Constructs a Font-object.
Returns
a Font object
GetFont [7/14]
Source code
public virtual Font GetFont(string fontname, string encoding, float size, int style)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
encoding |
the encoding of the font |
|
|
size |
the size of this font |
|
|
style |
the style of this font |
Summary
Constructs a Font-object.
Returns
a Font object
GetFont [8/14]
Source code
public virtual Font GetFont(string fontname, string encoding, float size)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
encoding |
the encoding of the font |
|
|
size |
the size of this font |
Summary
Constructs a Font-object.
Returns
a Font object
GetFont [9/14]
Source code
public virtual Font GetFont(string fontname, string encoding)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
encoding |
the encoding of the font |
Summary
Constructs a Font-object.
Returns
a Font object
GetFont [10/14]
Source code
public virtual Font GetFont(string fontname, float size, int style, BaseColor color)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
size |
the size of this font |
|
|
style |
the style of this font |
|
|
color |
the BaseColor of this font |
Summary
Constructs a Font-object.
Returns
a Font object
GetFont [11/14]
Source code
public virtual Font GetFont(string fontname, float size, BaseColor color)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
size |
the size of this font |
|
|
color |
the BaseColor of this font |
Summary
Constructs a Font-object.
Returns
a Font object
GetFont [12/14]
Source code
public virtual Font GetFont(string fontname, float size, int style)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
size |
the size of this font |
|
|
style |
the style of this font |
Summary
Constructs a Font-object.
Returns
a Font object
GetFont [13/14]
Source code
public virtual Font GetFont(string fontname, float size)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
|
|
size |
the size of this font |
Summary
Constructs a Font-object.
Returns
a Font object
GetFont [14/14]
Source code
public virtual Font GetFont(string fontname)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font |
Summary
Constructs a Font-object.
Returns
a Font object
RegisterFamily
Source code
public virtual void RegisterFamily(string familyName, string fullName, string path)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
familyName |
|
|
|
fullName |
|
|
|
path |
Register [1/2]
Source code
public virtual void Register(string path)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
path |
the path to a ttf- or ttc-file |
Summary
Register a ttf- or a ttc-file.
Register [2/2]
Source code
public virtual void Register(string path, string alias)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
path |
the path to a ttf- or ttc-file |
|
|
alias |
the alias you want to use for the font |
Summary
Register a ttf- or a ttc-file and use an alias for the font contained in the ttf-file.
SaveCopyOfRegularFont
Source code
protected bool SaveCopyOfRegularFont(string regularFontName, string path)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
regularFontName |
|
|
|
path |
RegisterDirectory [1/2]
Source code
public virtual int RegisterDirectory(string dir)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
dir |
RegisterDirectory [2/2]
Source code
public virtual int RegisterDirectory(string dir, bool scanSubdirectories)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
dir |
|
|
|
scanSubdirectories |
RegisterDirectories
Source code
public virtual int RegisterDirectories()
IsRegistered
Source code
public virtual bool IsRegistered(string fontname)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fontname |
the name of the font that has to be checked |
Summary
Checks if a certain font is registered.
Returns
true if the font is found
Properties
RegisteredFonts
public virtual ICollection<string> RegisteredFonts { get; }
Summary
Gets a set of registered fontnames.
Value
a set of registered fontnames
RegisteredFamilies
public virtual ICollection<string> RegisteredFamilies { get; }
Summary
Gets a set of registered font families.
Value
a set of registered font families
DefaultEncoding
public virtual string DefaultEncoding { get; set; }
DefaultEmbedding
public virtual bool DefaultEmbedding { get; set; }
Generated with ModularDoc