Package org.jzy3d.painters
Class Font
java.lang.Object
org.jzy3d.painters.Font
A Font subset supported both by OpenGL 1 and AWT. These fonts can be used both for charts based
on native OpenGL and charts based on raw AWT.
Painters such as
,
, etc).
Painters such as
will apply.
NativeDesktopPainter
use OpenGL for font rendering and address a font
name AND size through a font ID (e.g
invalid @link
IPainter#BITMAP_HELVETICA_10
invalid @link
IPainter#BITMAP_HELVETICA_12
EmulGLPainter
use AWT for font rendering and may support more font names
and size than those provided as default to fit OpenGL 1 spec. To use other fonts than the
defaults (e.g. Helvetica_12
), simply build them as follow
Font font = new org.jzy3d.painters.Painter.Font("Arial", 11);
Font names not supported by OpenGL 1 will be ignored. Instead, the default font
invalid @link
IPainter#BITMAP_HELVETICA_12
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected int
protected int
protected static final String
static final Font
static final Font
static final Font
protected String
protected static final int
protected static final int
protected int
protected static final String
static final Font
static final Font
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
protected void
detectFontNameFromOpenGLCode
(int code) protected void
detectOpenGLFontCodeFromName
(String name, int height) boolean
static Font
getById
(int id) Load a font from its IDint
getCode()
int
getName()
int
getStyle()
int
hashCode()
void
setHeight
(int height) toString()
-
Field Details
-
STROKE_ROMAN
protected static final int STROKE_ROMAN- See Also:
-
STROKE_MONO_ROMAN
protected static final int STROKE_MONO_ROMAN- See Also:
-
BITMAP_9_BY_15
protected static final int BITMAP_9_BY_15- See Also:
-
BITMAP_8_BY_13
protected static final int BITMAP_8_BY_13- See Also:
-
BITMAP_TIMES_ROMAN_10
protected static final int BITMAP_TIMES_ROMAN_10- See Also:
-
BITMAP_TIMES_ROMAN_24
protected static final int BITMAP_TIMES_ROMAN_24- See Also:
-
BITMAP_HELVETICA_10
protected static final int BITMAP_HELVETICA_10- See Also:
-
BITMAP_HELVETICA_12
protected static final int BITMAP_HELVETICA_12- See Also:
-
BITMAP_HELVETICA_18
protected static final int BITMAP_HELVETICA_18- See Also:
-
Helvetica_10
-
Helvetica_12
-
Helvetica_18
-
TimesRoman_10
-
TimesRoman_24
-
TIMES_NEW_ROMAN
- See Also:
-
HELVETICA
- See Also:
-
name
-
code
protected int code -
height
protected int height -
style
protected int style
-
-
Constructor Details
-
Font
protected Font() -
Font
public Font(int code, int height) -
Font
-
Font
Build a font from its name. Its OpenGL code will be guessed to ensure the font is usable with OpenGL 1 renderer supporting a limited font set. If the font name is not recognized among such set, the defaultBITMAP_HELVETICA_12
will be loaded. See alsoinvalid @link
{@link AWTFont.toAWT(font)
- Parameters:
name
-style
- a style value. May not be supported by the text rendererheight
-
-
-
Method Details
-
getName
-
getCode
public int getCode() -
getHeight
public int getHeight() -
getStyle
public int getStyle() -
setHeight
public void setHeight(int height) -
detectFontNameFromOpenGLCode
protected void detectFontNameFromOpenGLCode(int code) -
detectOpenGLFontCodeFromName
-
getById
Load a font from its ID -
hashCode
public int hashCode() -
equals
-
toString
-
clone
-