Class PdfSimpleFont<T>
public abstract class PdfSimpleFont<T> : PdfFont where T : FontProgram
Type Parameters
T
- Inheritance
-
PdfSimpleFont<T>
- Derived
- Inherited Members
Constructors
PdfSimpleFont()
protected PdfSimpleFont()
PdfSimpleFont(PdfDictionary)
protected PdfSimpleFont(PdfDictionary fontDictionary)
Parameters
fontDictionary
PdfDictionary
Fields
fontEncoding
protected FontEncoding fontEncoding
Field Value
forceWidthsOutput
Forces the output of the width array.
protected bool forceWidthsOutput
Field Value
Remarks
Forces the output of the width array. Only matters for the 14 built-in fonts.
toUnicode
Currently only exists for the fonts that are parsed from the document.
protected CMapToUnicode toUnicode
Field Value
Remarks
Currently only exists for the fonts that are parsed from the document. In the future, we might provide possibility to add custom mappings after a font has been created from a font file.
usedGlyphs
The array used with single byte encodings.
protected byte[] usedGlyphs
Field Value
- byte[]
Methods
AddFontStream(PdfDictionary)
protected abstract void AddFontStream(PdfDictionary fontDescriptor)
Parameters
fontDescriptor
PdfDictionary
AppendAnyGlyph(string, int, IList<Glyph>)
public override int AppendAnyGlyph(string text, int from, IList<Glyph> glyphs)
Parameters
Returns
AppendDecodedCodesToGlyphsList(IList<Glyph>, PdfString)
public override bool AppendDecodedCodesToGlyphsList(IList<Glyph> list, PdfString characterCodes)
Parameters
Returns
AppendGlyphs(string, int, int, IList<Glyph>)
public override int AppendGlyphs(string text, int from, int to, IList<Glyph> glyphs)
Parameters
Returns
BuildWidthsArray(int, int)
protected virtual PdfArray BuildWidthsArray(int firstChar, int lastChar)
Parameters
Returns
ConvertToBytes(string)
public override byte[] ConvertToBytes(string text)
Parameters
text
string
Returns
- byte[]
ConvertToBytes(Glyph)
public override byte[] ConvertToBytes(Glyph glyph)
Parameters
glyph
Glyph
Returns
- byte[]
ConvertToBytes(GlyphLine)
public override byte[] ConvertToBytes(GlyphLine glyphLine)
Parameters
glyphLine
GlyphLine
Returns
- byte[]
CreateGlyphLine(string)
public override GlyphLine CreateGlyphLine(string content)
Parameters
content
string
Returns
Decode(PdfString)
public override string Decode(PdfString content)
Parameters
content
PdfString
Returns
DecodeIntoGlyphLine(PdfString)
public override GlyphLine DecodeIntoGlyphLine(PdfString content)
Parameters
content
PdfString
Returns
FlushFontData(string, PdfName)
protected virtual void FlushFontData(string fontName, PdfName subtype)
Parameters
GetContentWidth(PdfString)
public override float GetContentWidth(PdfString content)
Parameters
content
PdfString
Returns
GetFontDescriptor(string)
Generates the font descriptor for this font or null if it is one of the 14 built in fonts.
protected override PdfDictionary GetFontDescriptor(string fontName)
Parameters
fontName
string
Returns
- PdfDictionary
the PdfDictionary containing the font descriptor or null.
GetFontEncoding()
Get the font encoding.
public virtual FontEncoding GetFontEncoding()
Returns
GetToUnicode()
Get the mapping of character codes to unicode values based on /ToUnicode entry of font dictionary.
public virtual CMapToUnicode GetToUnicode()
Returns
- CMapToUnicode
the CMapToUnicode built based on /ToUnicode, or null if /ToUnicode is not available
IsBuiltInFont()
Indicates that the font is built in, i.e. it is one of the 14 Standard fonts
protected virtual bool IsBuiltInFont()
Returns
IsBuiltWith(string, string)
public override bool IsBuiltWith(string fontProgram, string encoding)
Parameters
Returns
IsForceWidthsOutput()
Gets the state of the property.
public virtual bool IsForceWidthsOutput()
Returns
- bool
value of property forceWidthsOutput
SetFontProgram(T)
protected virtual void SetFontProgram(T fontProgram)
Parameters
fontProgram
T
SetForceWidthsOutput(bool)
Set to true to force the generation of the widths array.
public virtual void SetForceWidthsOutput(bool forceWidthsOutput)
Parameters
WriteText(string, PdfOutputStream)
public override void WriteText(string text, PdfOutputStream stream)
Parameters
text
stringstream
PdfOutputStream
WriteText(GlyphLine, int, int, PdfOutputStream)
public override void WriteText(GlyphLine text, int from, int to, PdfOutputStream stream)
Parameters
text
GlyphLinefrom
intto
intstream
PdfOutputStream