Search Results for

    Show / Hide Table of Contents

    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
    object
    TrueTypeFontSubSet
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Reportman.Drawing
    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
    Type Name Description
    string fontname
    byte[] rfarray
    Dictionary<int, int[]> glyphsUsed
    uint directoryOffset

    Fields

    View Source

    directoryOffset

    Declaration
    protected uint directoryOffset
    Field Value
    Type Description
    uint
    View Source

    fontPtr

    Declaration
    protected int fontPtr
    Field Value
    Type Description
    int
    View Source

    glyfTableRealSize

    Declaration
    protected int glyfTableRealSize
    Field Value
    Type Description
    int
    View Source

    glyphsInList

    Declaration
    protected List<int> glyphsInList
    Field Value
    Type Description
    List<int>
    View Source

    glyphsUsed

    Declaration
    protected Dictionary<int, int[]> glyphsUsed
    Field Value
    Type Description
    Dictionary<int, int[]>
    View Source

    locaShortTable

    Declaration
    protected bool locaShortTable
    Field Value
    Type Description
    bool
    View Source

    locaTable

    Declaration
    protected int[] locaTable
    Field Value
    Type Description
    int[]
    View Source

    locaTableRealSize

    Declaration
    protected int locaTableRealSize
    Field Value
    Type Description
    int
    View Source

    newGlyfTable

    Declaration
    protected byte[] newGlyfTable
    Field Value
    Type Description
    byte[]
    View Source

    newLocaTable

    Declaration
    protected int[] newLocaTable
    Field Value
    Type Description
    int[]
    View Source

    newLocaTableOut

    Declaration
    protected byte[] newLocaTableOut
    Field Value
    Type Description
    byte[]
    View Source

    outFont

    Declaration
    protected byte[] outFont
    Field Value
    Type Description
    byte[]
    View Source

    rfarray

    Declaration
    protected byte[] rfarray
    Field Value
    Type Description
    byte[]
    View Source

    tableGlyphOffset

    Declaration
    protected int tableGlyphOffset
    Field Value
    Type Description
    int
    View Source

    tables

    Declaration
    protected SortedList<string, TableData> tables
    Field Value
    Type Description
    SortedList<string, TableData>

    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
    Type Description
    int
    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
    Type Description
    short
    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
    Type Description
    uint
    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
    Type Description
    ushort
    View Source

    CalculateChecksum(byte[])

    Declaration
    protected int CalculateChecksum(byte[] b)
    Parameters
    Type Name Description
    byte[] b
    Returns
    Type Description
    int
    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
    public byte[] Execute()
    Returns
    Type Description
    byte[]
    View Source

    FlatGlyphs()

    Declaration
    protected void FlatGlyphs()
    View Source

    GetPostcriptName(int)

    Declaration
    public string GetPostcriptName(int offset)
    Parameters
    Type Name Description
    int offset
    Returns
    Type Description
    string
    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
    Type Name Description
    int nindex
    byte[] b
    int off
    int len
    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
    • View Source
    In this article
    Back to top Generated by DocFX