public final class PDF16PlainTextFormatter extends Object
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 the
format(AttributedRun, int, int, boolean) or format(AttributedRun, int, int, boolean, boolean) method.
| Modifier and Type | Field and Description |
|---|---|
static InterElementAttribute |
newComb
Interelement attribute to mark comb boundaries.
|
| Modifier and Type | Method and Description |
|---|---|
int |
format(AttributedRun run,
int start,
int limit,
boolean onComb)
Format an
AttributedRun by resolving the styling constraints
to glyphs and positions for those glyphs. |
int |
format(AttributedRun run,
int start,
int limit,
boolean onComb,
boolean shouldKern)
Format an
AttributedRun by resolving the styling constraints
to glyphs and positions for those glyphs. |
static PDF16PlainTextFormatter |
getFormatterInstance(FallbackFontSet fallbackFontSet)
Create a PDF16PlainTextFormatter for formatting text.
|
int |
preFormat(AttributedRun run,
int start,
int limit)
Preformat an
AttributedRun. |
public static final InterElementAttribute newComb
Boolean. The preceding and
following elements should be in the same comb iff this attribute
has the value Boolean.FALSEpublic static PDF16PlainTextFormatter getFormatterInstance(FallbackFontSet fallbackFontSet)
fallbackFontSet - the fonts to use for character fallbackpublic int preFormat(AttributedRun run, int start, int limit) throws FontException, FormattingException
AttributedRun.
This method should be called on a portion of an AttributedRun
corresponding to a whole paragraph, before the format(AttributedRun, int, int, boolean)
or format(AttributedRun, int, int, boolean, boolean) method.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)FontExceptionFormattingExceptionpublic int format(AttributedRun run, int start, int limit, boolean onComb) throws FontException, FormattingException
AttributedRun by 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:
ElementAttribute.isGlyph attribute set to Boolean.FALSE
ElementAttribute.locale set
ElementAttribute.bidiLevel set
ElementAttribute.font set to the
desired font
ElementAttribute.pointSize set to
the desired point size
ElementAttribute.fontStyle set;
if not set, equivalent to FontStyle.NORMAL
ElementAttribute.typographicCase set;
if not set, interpreted as TypographicCase.NONE.
ElementAttribute.digitCase set;
if not set, equivalent to DigitCase.DEFAULT
ElementAttribute.digitWidth set;
if not set, equivalent to DigitWidth.DEFAULT
InterElementAttribute.ligatureLevel set;
if not set, equivalent to LigatureLevel.COMMON
At some point during formatting,
startWorkingWithPositions
will be called on the run.
On output:
ElementAttribute.isGlyph will be Boolean.TRUE
ElementAttribute.font set to the
actual font to use
ElementAttribute.pointSize set to
the actual point size to use
onComb is true, then each interelement will have
the newComb attribute set
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 combFontExceptionFormattingExceptionpublic int format(AttributedRun run, int start, int limit, boolean onComb, boolean shouldKern) throws FontException, FormattingException
AttributedRun by 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:
ElementAttribute.isGlyph attribute set to Boolean.FALSE
ElementAttribute.locale set
ElementAttribute.bidiLevel set
ElementAttribute.font set to the
desired font
ElementAttribute.pointSize set to
the desired point size
ElementAttribute.fontStyle set;
if not set, equivalent to FontStyle.NORMAL
ElementAttribute.typographicCase set;
if not set, interpreted as TypographicCase.NONE.
ElementAttribute.digitCase set;
if not set, equivalent to DigitCase.DEFAULT
ElementAttribute.digitWidth set;
if not set, equivalent to DigitWidth.DEFAULT
InterElementAttribute.ligatureLevel set;
if not set, equivalent to LigatureLevel.COMMON
At some point during formatting,
startWorkingWithPositions
will be called on the run.
On output:
ElementAttribute.isGlyph will be Boolean.TRUE
ElementAttribute.font set to the
actual font to use
ElementAttribute.pointSize set to
the actual point size to use
onComb is true, then each interelement will have
the newComb attribute set
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 glyphsFontExceptionFormattingExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved