IFontCharactersMerger

public interface IFontCharactersMerger

Declares helpers functionality to merge TrueType fonts. Font which is passed by parameter font1 considered as primary. It means that many characteristics, related to final merged font, such as metrics, encoding structure and others, will be taken from this primary font.

Methods

MethodDescription
mergeFonts(GlyphId[] font1Glyphs, GlyphId[] font2Glyphs, String newFontName)Merges fonts based on glyphs lists passed.
mergeFonts(long[] font1CharCodes, long[] font2CharCodes, String newFontName)Merges fonts based on character codes lists passed.
mergeFonts(Map<Long,GlyphId> font1Dict, Map<Long,GlyphId> font2Dict, String newFontName)This method version designed for cases when you want to set character codes for glyphs in resultant font explicitly.

mergeFonts(GlyphId[] font1Glyphs, GlyphId[] font2Glyphs, String newFontName)

public abstract TtfFont mergeFonts(GlyphId[] font1Glyphs, GlyphId[] font2Glyphs, String newFontName)

Merges fonts based on glyphs lists passed. Searches for a character code for every glyph passed and add found character code with correspondent glyph into resultant new font.

Parameters:

ParameterTypeDescription
font1GlyphsGlyphId[]List of glyphs from first font
font2GlyphsGlyphId[]List of glyphs from second font
newFontNamejava.lang.StringDesired name for resultant font

Returns: TtfFont - Merged font

mergeFonts(long[] font1CharCodes, long[] font2CharCodes, String newFontName)

public abstract TtfFont mergeFonts(long[] font1CharCodes, long[] font2CharCodes, String newFontName)

Merges fonts based on character codes lists passed. To create desired resultant font just pass symbol codes from original fonts you want to include into resultant font. Glyphs related to codes passed will be found automatically. For example, if you want to include into resultant font glyphs related to letters A and B from first font and glyphs, related to letters C and D from second font, just call this method like this: MergeFonts(new uint[] { ‘A’, ‘B’ }, new uint[] { ‘C’, ‘D’ }, “NewFont”)

Parameters:

ParameterTypeDescription
font1CharCodeslong[]Codes to take from first font
font2CharCodeslong[]Codes to take from second font
newFontNamejava.lang.StringDesired name for resultant font

Returns: TtfFont - Merged font

mergeFonts(Map<Long,GlyphId> font1Dict, Map<Long,GlyphId> font2Dict, String newFontName)

public abstract TtfFont mergeFonts(Map<Long,GlyphId> font1Dict, Map<Long,GlyphId> font2Dict, String newFontName)

This method version designed for cases when you want to set character codes for glyphs in resultant font explicitly. It’s not mandatory that code for glyph you provided is included in original font. The sense of code passed is that it will be associated with correspondent glyph identifier in resultant font. So, rule to process every pair passed by dictionary parameter[code, glyph ideitifier] is that only glyph identifer will be taken from original font and then it will be linked with correspondent code in resultant font. It can be helpful when some codes from first font conflict with same codes from second font.

Parameters:

ParameterTypeDescription
font1Dictjava.util.Map<java.lang.Long,com.aspose.font.GlyphId>Dictionary with pairs [symbol code, glyph identifier] from first font
font2Dictjava.util.Map<java.lang.Long,com.aspose.font.GlyphId>Dictionary with pairs [symbol code, glyph identifier] from second font
newFontNamejava.lang.StringDesired name for resultant font

Returns: TtfFont - Merged font