|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TextRender
Rendering interface for text output.
Nested Class Summary | |
---|---|
static class |
TextRender.TextExtent
Support class for holding text extents. |
Field Summary | |
---|---|
static int |
ANTI_DEPEND
Antialiasing mode value: depends on output module color format. |
static java.lang.String |
ANTI_MODE
Property name: antialiasing mode. |
static int |
ANTI_OFF
Antialiasing mode value: force antialiasing off (even in RGBA output mode). |
static int |
ANTI_ON
Antialiasing mode value: force antialiasing on (even in RGB/Gray/.. output mode). |
static int |
CREATE_APPROX
The asked font was approximated. |
static int |
CREATE_EXACT
The asked font was created exactly. |
static int |
CREATE_FAIL
Font creation process has failed .. no font has been created. |
static int |
FONT_BOLD
Bold (heavy) font. |
static int |
FONT_DECORATIVE
Decorative font. |
static int |
FONT_ICON
Icon font (wingdings etc.). |
static int |
FONT_ITALIC
Italic (slanted) font. |
static int |
FONT_MONOSPACED
Monospaced (non-proportional) font. |
static int |
FONT_SCRIPT
Manuscript font. |
static int |
FONT_SERIF
Font with serifs. |
static int |
FONT_UNDERLINE
Underlined font. |
static int |
MAX_SLOT
Maximal number of font slots (excluding slot A). |
static int |
PROP_BITMAP
Font is not able to generate paths (bitmap, non-scalable font). |
static int |
PROP_FILL
Font path can be filled (filled font). |
static int |
PROP_MONOSPACED
Font is monospaced (non-proportional). |
static int |
PROP_STROKE
Font path can be stroked (stroked font). |
Fields inherited from interface cz.cuni.jagrlib.iface.Render |
---|
LINE_CAP, LINE_CAP_BUTT, LINE_CAP_ROUND, LINE_CAP_SQUARE, LINE_JOIN, LINE_JOIN_BEVEL, LINE_JOIN_DISJOINT, LINE_JOIN_MITER, LINE_JOIN_OVERLAP, LINE_JOIN_ROUND, LINE_WIDTH, PROJECTION, RENDER_STYLE, RENDER_STYLE_FLAT, RENDER_STYLE_GOURAUD, RENDER_STYLE_LINE, RENDER_STYLE_PHONG, RENDER_STYLE_TEXTURE |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Method Summary | |
---|---|
int |
createFont(java.lang.String name,
int style,
double size)
Creates a new font and places it in slot A (actual, working font). |
void |
drawText(double x0,
double y0,
java.lang.String text,
TextRender.TextExtent ext)
Draws the given text. |
double |
fontOrientation(double angle)
Changes the actual font's orientation. |
int |
fontProperties()
Returns properties (flags) of the actual font (slot A). |
void |
getFont(int slot)
Assigns the actual font (slot A) from the given slot. |
TextRender.TextExtent |
getKern(char c1,
char c2,
TextRender.TextExtent ext)
Returns the kerning (space correction) which should be used between two given characters. |
void |
putFont(int slot)
Puts the actual font (slot A) into the given slot. |
TextRender.TextExtent |
textExtent(double x0,
double y0,
java.lang.String text,
TextRender.TextExtent ext)
Computes the extent of the given text string (without any output change). |
void |
textPath(java.lang.String text)
Generates path of the given text string and appends it to the current path. |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit, get, set |
Field Detail |
---|
static final int FONT_BOLD
static final int FONT_ITALIC
static final int FONT_UNDERLINE
static final int FONT_SERIF
static final int FONT_SCRIPT
static final int FONT_DECORATIVE
static final int FONT_ICON
static final int FONT_MONOSPACED
static final int CREATE_EXACT
static final int CREATE_APPROX
static final int CREATE_FAIL
static final int MAX_SLOT
static final int PROP_STROKE
static final int PROP_FILL
static final int PROP_BITMAP
static final int PROP_MONOSPACED
static final java.lang.String ANTI_MODE
static final int ANTI_DEPEND
static final int ANTI_OFF
static final int ANTI_ON
Method Detail |
---|
int createFont(java.lang.String name, int style, double size)
name
- Font name.style
- Font style - used if exact font match was not successful
(bitwise OR of TextRender.FONT_* constants).size
- Font size (distance between two regularly spaced text lines).
FONT_BOLD
,
CREATE_EXACT
,
VCommand.CreateFont
double fontOrientation(double angle)
angle
- New font orientation (in degrees, counterclockwise).
VCommand.FontOrientation
void getFont(int slot)
slot
- Slot number (between 0 and MAX_SLOT-1).MAX_SLOT
,
VCommand.GetFont
void putFont(int slot)
slot
- Slot number (between 0 and MAX_SLOT-1).MAX_SLOT
,
VCommand.PutFont
int fontProperties()
PROP_STROKE
void textPath(java.lang.String text)
Does nothing if the actual font has neither PROP_STROKE nor PROP_FILL capability.
text
- The string to be drawn.textExtent(double, double, java.lang.String, cz.cuni.jagrlib.iface.TextRender.TextExtent)
,
drawText(double, double, java.lang.String, cz.cuni.jagrlib.iface.TextRender.TextExtent)
,
VCommand.MoveTo
,
VectorGraphics.moveTo(double, double)
,
VCommand.TextPath
void drawText(double x0, double y0, java.lang.String text, TextRender.TextExtent ext)
Works with both vector and bitmap fonts.
x0
- X coordinate of the starting reference point.y0
- Y coordinate of the starting reference point.text
- The string to be drawn.ext
- The TextExtent object to be filled (or null).TextRender.TextExtent
,
textExtent(double, double, java.lang.String, cz.cuni.jagrlib.iface.TextRender.TextExtent)
,
VCommand.DrawText
TextRender.TextExtent textExtent(double x0, double y0, java.lang.String text, TextRender.TextExtent ext)
x0
- X coordinate of the starting reference point.y0
- Y coordinate of the starting reference point.text
- The string to be drawn.ext
- The TextExtent object to be filled (or null).
TextRender.TextExtent
,
drawText(double, double, java.lang.String, cz.cuni.jagrlib.iface.TextRender.TextExtent)
TextRender.TextExtent getKern(char c1, char c2, TextRender.TextExtent ext)
c1
- First character.c2
- Second character.ext
- The TextExtent object to be filled (or null).
TextRender.TextExtent
,
textExtent(double, double, java.lang.String, cz.cuni.jagrlib.iface.TextRender.TextExtent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |