public final class PDF16RichTextFormatter 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) or format(AttributedRun, int, int, boolean) method.
| Modifier and Type | Method and Description |
|---|---|
int |
format(AttributedRun run,
int start,
int limit)
Format an
AttributedRun by resolving the styling constraints
to actual fonts, glyphs and positions for those glyphs. |
int |
format(AttributedRun run,
int start,
int limit,
boolean shouldKern)
Format an
AttributedRun by resolving the styling constraints
to actual fonts, glyphs and positions for those glyphs. |
static CSS20FontSet |
getFontSetInstance()
Create a CSS20FontSet for use with a PDF16RichTextFormatter.
|
static CSS20FontSet |
getFontSetInstance(CSS20FontSet original)
Create a copy of a CSS20FontSet for use with a PDF16RichTextFormatter.
|
static CSS20FontSet |
getFontSetInstance(FamilyNameNormalizer normalizer)
Create a CSS20FontSet for use with a PDF16RichTextFormatter.
|
static PDF16RichTextFormatter |
getFormatterInstance(CSS20FontSet fontSet)
Create a PDF16RichTextFormatter for formatting text.
|
int |
preFormat(AttributedRun run,
int start,
int limit)
Preformat an
AttributedRun. |
public static PDF16RichTextFormatter getFormatterInstance(CSS20FontSet fontSet)
fontSet - A CSS20FontSet that has had all fonts and fallbacks fonts that are relevant to the
caller added.public static CSS20FontSet getFontSetInstance()
CSS20FontSet interface that is returned from this method offers some tighter
thread safety guarantees than that guaranteed by the CSS20FontSet interface. It is safe
to use the CSS20FontSet
object for font resolution from multiple threads at one time as long as the methods which
change the state of the CSS20FontSet object are not called at any time that
the PDF16RichTextFormatter objects
to which it has been given may be using it for font resolution. There is no mechanism
within CSSPPDF16Formatter or
CSS20FontSet to guarantee that this doesn't occur. A client program can guarantee this by modifying the
CSS20FontSet object fully before giving it to one or more PDF16RichTextFormatter objects in one or more
threads. A client program could also use some synchronization constructs of its own to guarantee this.
This means that the addFont(), setFallbackFonts(), setGenericFont(),
and setResolutionPriority() methods can not be called while there is any chance that the CSS20FontSet
object may be being used for font resolution.
It is also safe to copy this CSS20FontSet object except when it is possible that it may be being modified.
It is again the responsibility of the client to ensure that this doesn't happen.public static CSS20FontSet getFontSetInstance(FamilyNameNormalizer normalizer)
FamilyNameNormalizer object
that is used to modify the font family name of every Font object
added to the CSS20FontSet. It is also used to modify the font names inside of any search request.
CSS20FontSet interface that is returned from this method offers some tighter
thread safety guarantees than that guaranteed by the CSS20FontSet interface. It is safe
to use the CSS20FontSet
object for font resolution from multiple threads at one time as long as the methods which
change the state of the CSS20FontSet object are not called at any time that
the PDF16RichTextFormatter objects
to which it has been given may be using it for font resolution. There is no mechanism
within CSSPPDF16Formatter or
CSS20FontSet to guarantee that this doesn't occur. A client program can guarantee this by modifying the
CSS20FontSet object fully before giving it to one or more PDF16RichTextFormatter objects in one or more
threads. A client program could also use some synchronization constructs of its own to guarantee this.
This means that the addFont(), setFallbackFonts(), setGenericFont(),
and setResolutionPriority() methods can not be called while there is any chance that the CSS20FontSet
object may be being used for font resolution.
It is also safe to copy this CSS20FontSet object except when it is possible that it may be being modified.
It is again the responsibility of the client to ensure that this doesn't happen.normalizer - A FamilyNameNormalizer
used for adjusting font family names.public static CSS20FontSet getFontSetInstance(CSS20FontSet original)
CSS20FontSet interface that is returned from this method offers some tighter
thread safety guarantees than that guaranteed by the CSS20FontSet interface. It is safe
to use the CSS20FontSet
object for font resolution from multiple threads at one time as long as the methods which
change the state of the CSS20FontSet object are not called at any time that
the PDF16RichTextFormatter objects
to which it has been given may be using it for font resolution. There is no mechanism
within CSSPPDF16Formatter or
CSS20FontSet to guarantee that this doesn't occur. A client program can guarantee this by modifying the
CSS20FontSet object fully before giving it to one or more PDF16RichTextFormatter objects in one or more
threads. A client program could also use some synchronization constructs of its own to guarantee this.
This means that the addFont(), setFallbackFonts(), setGenericFont(),
and setResolutionPriority() methods can not be called while there is any chance that the CSS20FontSet
object may be being used for font resolution.
It is also safe to copy this CSS20FontSet object except when it is possible that it may be being modified.
It is again the responsibility of the client to ensure that this doesn't happen.original - the CSS20FontSet to copypublic 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)
or format(AttributedRun, int, int, 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) throws FontException, FormattingException
AttributedRun by resolving the styling constraints
to actual fonts, 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.
ElementAttribute.locale set
ElementAttribute.bidiLevel set
ElementAttribute.joiningType set
ElementAttribute.CSS20Attribute set
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.font set to the
actual font to use
ElementAttribute.pointSize set to
the actual point size to use
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)UnsupportedFontExceptionInvalidFontExceptionFormattingExceptionFontLoadingExceptionFontExceptionpublic int format(AttributedRun run, int start, int limit, boolean shouldKern) throws FontException, FormattingException
AttributedRun by resolving the styling constraints
to actual fonts, 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.
ElementAttribute.locale set
ElementAttribute.bidiLevel set
ElementAttribute.joiningType set
ElementAttribute.CSS20Attribute set
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.font set to the
actual font to use
ElementAttribute.pointSize set to
the actual point size to use
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)shouldKern - whether or not to apply kerning to the glyphsUnsupportedFontExceptionInvalidFontExceptionFormattingExceptionFontLoadingExceptionFontExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved