public class FontFallbackIterator
extends java.lang.Object
Instances can be reused for different texts or preferred fonts -
each start
method invocation initiates a new iteration.
All required font-related properties for a given iteration should be set before corresponding
start
method invocation.
Sample usage scenario:
char[] text = getSourceText();
FontFallbackIterator it = new FontFallbackIterator();
it.start(text, 0, text.length);
while (!it.atEnd()) {
processFragment(new String(text, it.getStart(), it.getEnd()), it.getFont()));
it.advance();
}
Constructor and Description |
---|
FontFallbackIterator() |
Modifier and Type | Method and Description |
---|---|
void |
advance() |
boolean |
atEnd() |
int |
getEnd() |
java.awt.Font |
getFont() |
FontInfo |
getFontInfo() |
int |
getStart() |
FontFallbackIterator |
setFontRenderContext(java.awt.font.FontRenderContext fontRenderContext) |
FontFallbackIterator |
setFontStyle(int fontStyle) |
FontFallbackIterator |
setPreferredFont(java.lang.String familyName,
int size) |
FontFallbackIterator |
setPreferredFonts(FontPreferences fontPreferences) |
void |
start(char [] text,
int start,
int end) |
void |
start(java.lang.CharSequence text,
int start,
int end) |
public FontFallbackIterator setPreferredFonts(FontPreferences fontPreferences)
public FontFallbackIterator setPreferredFont(java.lang.String familyName, int size)
public FontFallbackIterator setFontStyle(int fontStyle)
public FontFallbackIterator setFontRenderContext(java.awt.font.FontRenderContext fontRenderContext)
public void start(java.lang.CharSequence text, int start, int end)
public void start(char [] text, int start, int end)
public boolean atEnd()
public void advance()
public int getStart()
public int getEnd()
public FontInfo getFontInfo()
public java.awt.Font getFont()