DynamicPDF by ceTe Software

com.cete.dynamicpdf.text
Class OpenTypeFont

java.lang.Object
  extended by com.cete.dynamicpdf.Resource
      extended by com.cete.dynamicpdf.Font
          extended by com.cete.dynamicpdf.text.OpenTypeFont
All Implemented Interfaces:
IFontSubsettable

public class OpenTypeFont
extends Font
implements IFontSubsettable

Represents a OpenTypeFont font.

Licensing:
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:

View Example


Constructor Summary
OpenTypeFont(byte[] bytes, LineBreaker lineBreaker)
          Intializes a new instance of OpenTypeFont class.
OpenTypeFont(java.lang.String filePath)
          Intializes a new instance of OpenTypeFont class.
OpenTypeFont(java.lang.String filePath, LineBreaker lineBreaker)
          Intializes a new instance of OpenTypeFont class.
 
Method Summary
 void draw(DocumentWriter writer)
          Draw the opentype font data to the DocumentWriter.
 short getAscender()
          Gets the ascender for the font.
 short getDescender()
          Gets the descender for the font.
 boolean getEmbed()
          Gets a value indicating whether the font need to be embedded in to the pdf.
 FontSubsetter getFontSubsetter()
          Returns a font subsetter for the opentype font.
 int getGlyphWidth(char glyph)
          Returns the mwidth of the given char.
 float getKernValue(char left, char right)
          Returns the kern value corresponding to the given glyph combination.
 LineBreaker getLineBreaker()
          Gets the instance of LineBreaker used for the font.
 short getLineGap()
          Gets the line gap for the font.
 java.lang.String getName()
          Gets the font name for the file given.
 com.cete.dynamicpdf.text.opentypefonttables.OutLineType getOutLineType()
          Gets the OutLineType of the opentype font.
 int getRequiredPdfObjects()
          Gets the required pdf objects.
 ResourceType getResourceType()
          Gets the value of ResourceType.
 boolean getSubset()
          Gets a value indicating whether the font need to subset while embedding.
 boolean hasKerning()
          Returns whether the font has inbuilt kerning pairs.
 void setEmbed(boolean value)
          Sets a value indicating whether the font need to be embedded in to the pdf.
 void setSubset(boolean value)
          Sets a value indicating whether the font need to subset while embedding.
 
Methods inherited from class com.cete.dynamicpdf.Font
getAscender, getBaseLine, getCeTeBullets, getCourier, getCourierBold, getCourierBoldOblique, getCourierOblique, getDefaultLeading, getDescender, getEncoder, getFormFontName, getHanyangSystemsGothicMedium, getHanyangSystemsShinMyeongJoMedium, getHeiseiKakuGothicW5, getHeiseiMinchoW3, getHelvetica, getHelveticaBold, getHelveticaBoldOblique, getHelveticaOblique, getLineGap, getMonotypeHeiMedium, getMonotypeSungLight, getSinoTypeSongLight, getSymbol, getTextLines, getTextLines, getTextWidth, getTextWidth, getTimesBold, getTimesBoldItalic, getTimesItalic, getTimesRoman, getZapfDingbats
 
Methods inherited from class com.cete.dynamicpdf.Resource
getUid, newUid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenTypeFont

public OpenTypeFont(java.lang.String filePath)
Intializes a new instance of OpenTypeFont class.

Parameters:
filePath - Physical file path of the OpenType font file.
See Also:
OpenTypeFont

OpenTypeFont

public OpenTypeFont(java.lang.String filePath,
                    LineBreaker lineBreaker)
Intializes a new instance of OpenTypeFont class.

Parameters:
filePath - Physical file path of the opentype / truetype font file.
lineBreaker - Line breaker to use for the opentype font.
See Also:
OpenTypeFont

OpenTypeFont

public OpenTypeFont(byte[] bytes,
                    LineBreaker lineBreaker)
Intializes a new instance of OpenTypeFont class.

Parameters:
bytes - bytes containg the opentype / truetype font file.
lineBreaker - Line breaker to use for the opentype font.
See Also:
OpenTypeFont
Method Detail

draw

public void draw(DocumentWriter writer)
Draw the opentype font data to the DocumentWriter.

Specified by:
draw in class Resource
Parameters:
writer - DocumentWriter object used to receive the opentype font output.
See Also:
DocumentWriter

getGlyphWidth

public int getGlyphWidth(char glyph)
Returns the mwidth of the given char.

Specified by:
getGlyphWidth in class Font
Parameters:
glyph - Glyph whose mwidth is required.
Returns:
mwdith of the given glyph.

getFontSubsetter

public FontSubsetter getFontSubsetter()
Returns a font subsetter for the opentype font.

Specified by:
getFontSubsetter in interface IFontSubsettable
Returns:
FontSubsetter object used for the font.
See Also:
FontSubsetter

hasKerning

public boolean hasKerning()
Returns whether the font has inbuilt kerning pairs.

Overrides:
hasKerning in class Font
Returns:
true, if the font has inbuilt kerning pair.

getKernValue

public float getKernValue(char left,
                          char right)
Returns the kern value corresponding to the given glyph combination.

Overrides:
getKernValue in class Font
Parameters:
left - Left glyph.
right - Right glyph.
Returns:
Kern value corresponds to the combination given.

getLineBreaker

public LineBreaker getLineBreaker()
Gets the instance of LineBreaker used for the font.

Specified by:
getLineBreaker in class Font
Returns:
LineBreaker default line breaker for the font.
See Also:
LineBreaker

getName

public java.lang.String getName()
Gets the font name for the file given.

Specified by:
getName in class Font
Returns:
name of the font.

getRequiredPdfObjects

public int getRequiredPdfObjects()
Gets the required pdf objects.

Overrides:
getRequiredPdfObjects in class Resource
Returns:
the required pdf objects.

getResourceType

public ResourceType getResourceType()
Gets the value of ResourceType.

Overrides:
getResourceType in class Font
Returns:
the value of ResourceType.
See Also:
ResourceType

getLineGap

public short getLineGap()
Gets the line gap for the font.

Overrides:
getLineGap in class Font
Returns:
short line gap for the font.

getAscender

public short getAscender()
Gets the ascender for the font.

Specified by:
getAscender in class Font
Returns:
short ascender for the font.

getDescender

public short getDescender()
Gets the descender for the font.

Specified by:
getDescender in class Font
Returns:
short descender for the font.

getEmbed

public boolean getEmbed()
Gets a value indicating whether the font need to be embedded in to the pdf.

Returns:
value indicating whether the font need to be embedded in to the pdf.

setEmbed

public void setEmbed(boolean value)
Sets a value indicating whether the font need to be embedded in to the pdf.

Parameters:
value - boolean value indicating whether the font need to be embedded in to the pdf.

getSubset

public boolean getSubset()
Gets a value indicating whether the font need to subset while embedding.

Returns:
a value indicating whether the font need to subset while embedding.

setSubset

public void setSubset(boolean value)
Sets a value indicating whether the font need to subset while embedding.

Parameters:
value - boolean value indicating whether the font need to subset while embedding.

getOutLineType

public com.cete.dynamicpdf.text.opentypefonttables.OutLineType getOutLineType()
Gets the OutLineType of the opentype font.

Returns:
outLineType of opentype font.
See Also:
OutLineType

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.04 for Java generated on September 25, 2019
© Copyright 2019, ceTe Software