Class PDF16PlainTextFormatter
- java.lang.Object
-
- com.adobe.fontengine.inlineformatting.PDF16PlainTextFormatter
-
public final class PDF16PlainTextFormatter extends java.lang.ObjectInline formatter for PDF 1.6 plain text form fields.The client must first pass a run corresponding to a whole paragraph to the
preFormat(com.adobe.fontengine.inlineformatting.AttributedRun, int, int)method. It can then pass fragments of the run to theformat(AttributedRun, int, int, boolean)orformat(AttributedRun, int, int, boolean, boolean)method.
-
-
Field Summary
Fields Modifier and Type Field Description static InterElementAttributenewCombInterelement attribute to mark comb boundaries.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intformat(AttributedRun run, int start, int limit, boolean onComb)Format anAttributedRunby resolving the styling constraints to glyphs and positions for those glyphs.intformat(AttributedRun run, int start, int limit, boolean onComb, boolean shouldKern)Format anAttributedRunby resolving the styling constraints to glyphs and positions for those glyphs.static PDF16PlainTextFormattergetFormatterInstance(FallbackFontSet fallbackFontSet)Create a PDF16PlainTextFormatter for formatting text.intpreFormat(AttributedRun run, int start, int limit)Preformat anAttributedRun.
-
-
-
Field Detail
-
newComb
public static final InterElementAttribute newComb
Interelement attribute to mark comb boundaries. The value of this attribute is aBoolean. The preceding and following elements should be in the same comb iff this attribute has the valueBoolean.FALSE
-
-
Method Detail
-
getFormatterInstance
public static PDF16PlainTextFormatter getFormatterInstance(FallbackFontSet fallbackFontSet)
Create a PDF16PlainTextFormatter for formatting text.Concurrency
The PDF16PlainTextFormatter instance that is returned from this method is not in general thread safe.- Parameters:
fallbackFontSet- the fonts to use for character fallback- Returns:
- A PDF16PlainTextFormatter to be used for formatting text
-
preFormat
public int preFormat(AttributedRun run, int start, int limit) throws FontException, FormattingException
Preformat anAttributedRun. This method should be called on a portion of an AttributedRun corresponding to a whole paragraph, before theformat(AttributedRun, int, int, boolean)orformat(AttributedRun, int, int, boolean, boolean)method.- Parameters:
run- an AttributedRun that contains the text to be formattedstart- the index in the AttributedRun to start formatting fromlimit- the index in the AttributedRun at which formatting should cease (one more than the last position that formatting should done to)- Returns:
- The new limit of the original range in the AttributedRun after the formatting operation.
- Throws:
FontExceptionFormattingException
-
format
public int format(AttributedRun run, int start, int limit, boolean onComb) throws FontException, FormattingException
Format anAttributedRunby resolving the styling constraints to glyphs and positions for those glyphs.This method should be called after the
preFormat(com.adobe.fontengine.inlineformatting.AttributedRun, int, int)method.On input:
- each element must be a character, i.e. must have the
ElementAttribute.isGlyphattribute set toBoolean.FALSE - each element must have
ElementAttribute.localeset - each element must have
ElementAttribute.bidiLevelset - each element must have
ElementAttribute.fontset to the desired font - each element must have
ElementAttribute.pointSizeset to the desired point size - each character element can have
ElementAttribute.fontStyleset; if not set, equivalent toFontStyle.NORMAL - each character element can have
ElementAttribute.typographicCaseset; if not set, interpreted asTypographicCase.NONE. - each character element can have
ElementAttribute.digitCaseset; if not set, equivalent toDigitCase.DEFAULT - each character element can have
ElementAttribute.digitWidthset; if not set, equivalent toDigitWidth.DEFAULT - each interelement can have
InterElementAttribute.ligatureLevelset; if not set, equivalent toLigatureLevel.COMMON
At some point during formatting,
startWorkingWithPositionswill be called on the run.On output:
- each element in the run will be a glyph, i.e.
ElementAttribute.isGlyphwill beBoolean.TRUE - each element will have a placement and advance vector
- each element will have
ElementAttribute.fontset to the actual font to use - each element will have
ElementAttribute.pointSizeset to the actual point size to use - if
onCombis true, then each interelement will have thenewCombattribute set
- Parameters:
run- an AttributedRun that contains the text to be formattedstart- the index in the AttributedRun to start formatting fromlimit- the index in the AttributedRun at which formatting should cease (one more than the last position that formatting should done to)onComb- true iff the attributed run is displayed in a comb- Returns:
- The new limit of the original range in the AttributedRun after the formatting operation.
- Throws:
FontExceptionFormattingException
- each element must be a character, i.e. must have the
-
format
public int format(AttributedRun run, int start, int limit, boolean onComb, boolean shouldKern) throws FontException, FormattingException
Format anAttributedRunby resolving the styling constraints to glyphs and positions for those glyphs.This method should be called after the
preFormat(com.adobe.fontengine.inlineformatting.AttributedRun, int, int)method.On input:
- each element must be a character, i.e. must have the
ElementAttribute.isGlyphattribute set toBoolean.FALSE - each element must have
ElementAttribute.localeset - each element must have
ElementAttribute.bidiLevelset - each element must have
ElementAttribute.fontset to the desired font - each element must have
ElementAttribute.pointSizeset to the desired point size - each character element can have
ElementAttribute.fontStyleset; if not set, equivalent toFontStyle.NORMAL - each character element can have
ElementAttribute.typographicCaseset; if not set, interpreted asTypographicCase.NONE. - each character element can have
ElementAttribute.digitCaseset; if not set, equivalent toDigitCase.DEFAULT - each character element can have
ElementAttribute.digitWidthset; if not set, equivalent toDigitWidth.DEFAULT - each interelement can have
InterElementAttribute.ligatureLevelset; if not set, equivalent toLigatureLevel.COMMON
At some point during formatting,
startWorkingWithPositionswill be called on the run.On output:
- each element in the run will be a glyph, i.e.
ElementAttribute.isGlyphwill beBoolean.TRUE - each element will have a placement and advance vector
- each element will have
ElementAttribute.fontset to the actual font to use - each element will have
ElementAttribute.pointSizeset to the actual point size to use - if
onCombis true, then each interelement will have thenewCombattribute set
- Parameters:
run- an AttributedRun that contains the text to be formattedstart- the index in the AttributedRun to start formatting fromlimit- the index in the AttributedRun at which formatting should cease (one more than the last position that formatting should done to)onComb- true iff the attributed run is displayed in a combshouldKern- whether or not kerning should be applied to the glyphs- Returns:
- The new limit of the original range in the AttributedRun after the formatting operation.
- Throws:
FontExceptionFormattingException
- each element must be a character, i.e. must have the
-
-