Class TrueTypeFontSubSet
Builds a minimal subset of a TrueType font containing only the glyphs actually used,
rewriting the loca/glyf tables and reassembling the font for embedding (e.g. in PDF output).
Inheritance
TrueTypeFontSubSet
Assembly: Reportman.Drawing.dll
Syntax
public class TrueTypeFontSubSet
Constructors
View Source
TrueTypeFontSubSet(string, byte[], Dictionary<int, int[]>, uint)
Create a class to extact the subset stream of a font, given the glyphs used
Declaration
public TrueTypeFontSubSet(string fontname, byte[] rfarray, Dictionary<int, int[]> glyphsUsed, uint directoryOffset)
Parameters
Fields
View Source
directoryOffset
Declaration
protected uint directoryOffset
Field Value
View Source
fontPtr
Declaration
Field Value
View Source
glyfTableRealSize
Declaration
protected int glyfTableRealSize
Field Value
View Source
glyphsInList
Declaration
protected List<int> glyphsInList
Field Value
View Source
glyphsUsed
Declaration
protected Dictionary<int, int[]> glyphsUsed
Field Value
View Source
locaShortTable
Declaration
protected bool locaShortTable
Field Value
View Source
locaTable
Declaration
protected int[] locaTable
Field Value
View Source
locaTableRealSize
Declaration
protected int locaTableRealSize
Field Value
View Source
newGlyfTable
Declaration
protected byte[] newGlyfTable
Field Value
View Source
newLocaTable
Declaration
protected int[] newLocaTable
Field Value
View Source
newLocaTableOut
Declaration
protected byte[] newLocaTableOut
Field Value
View Source
outFont
Declaration
Field Value
View Source
rfarray
Declaration
Field Value
View Source
tableGlyphOffset
Declaration
protected int tableGlyphOffset
Field Value
View Source
tables
Declaration
protected SortedList<string, TableData> tables
Field Value
Methods
View Source
AssembleFont()
Declaration
protected void AssembleFont()
View Source
ByteArrayToInt(byte[], int, int)
Declaration
public static int ByteArrayToInt(byte[] b1, int index, int alen)
Parameters
| Type |
Name |
Description |
| byte[] |
b1 |
|
| int |
index |
|
| int |
alen |
|
Returns
View Source
ByteArrayToShort(byte[], int, int)
Declaration
public static short ByteArrayToShort(byte[] b1, int index, int alen)
Parameters
| Type |
Name |
Description |
| byte[] |
b1 |
|
| int |
index |
|
| int |
alen |
|
Returns
View Source
ByteArrayToUInt(byte[], int, int)
Converts a byte array to an uint value
Declaration
public static uint ByteArrayToUInt(byte[] b1, int index, int alen)
Parameters
| Type |
Name |
Description |
| byte[] |
b1 |
|
| int |
index |
|
| int |
alen |
|
Returns
View Source
ByteArrayToUShort(byte[], int, int)
Declaration
public static ushort ByteArrayToUShort(byte[] b1, int index, int alen)
Parameters
| Type |
Name |
Description |
| byte[] |
b1 |
|
| int |
index |
|
| int |
alen |
|
Returns
View Source
CalculateChecksum(byte[])
Declaration
protected int CalculateChecksum(byte[] b)
Parameters
| Type |
Name |
Description |
| byte[] |
b |
|
Returns
View Source
CheckGlyphComposite(int)
Declaration
protected void CheckGlyphComposite(int glyph)
Parameters
| Type |
Name |
Description |
| int |
glyph |
|
View Source
CreateNewGlyphTables()
Declaration
protected void CreateNewGlyphTables()
View Source
CreateTableDirectory()
Declaration
protected void CreateTableDirectory()
View Source
Execute()
Declaration
Returns
View Source
FlatGlyphs()
Declaration
protected void FlatGlyphs()
View Source
GetPostcriptName(int)
Declaration
public string GetPostcriptName(int offset)
Parameters
| Type |
Name |
Description |
| int |
offset |
|
Returns
View Source
LocaTobytes()
Declaration
protected void LocaTobytes()
View Source
ReadBytes(int, byte[], int, int)
Declaration
public void ReadBytes(int nindex, byte[] b, int off, int len)
Parameters
View Source
ReadLoca()
Declaration
protected void ReadLoca()
View Source
WriteFontInt(int)
Declaration
protected void WriteFontInt(int n)
Parameters
| Type |
Name |
Description |
| int |
n |
|
View Source
WriteFontShort(int)
Declaration
protected void WriteFontShort(int n)
Parameters
| Type |
Name |
Description |
| int |
n |
|
View Source
WriteFontString(string)
Declaration
protected void WriteFontString(string s)
Parameters
| Type |
Name |
Description |
| string |
s |
|