public final class JHelpFont extends java.lang.Object implements ConstantsGUI
Modifier and Type | Field and Description |
---|---|
private java.awt.Font |
font
Embeded font
|
private java.awt.FontMetrics |
fontMetrics
Metrics for measure strings
|
static char |
SMILEY_HAPPY
Character unicode for the smiley :)
|
static char |
SMILEY_SAD
Character unicode for the smiley :(
|
private boolean |
underline
Underline information
|
AFFINE_TRANSFORM, FLATNESS, FONT_RENDER_CONTEXT
Constructor and Description |
---|
JHelpFont(java.lang.String familly,
int size)
Create a new instance of JHelpFont not bold, not italic, not underline
|
JHelpFont(java.lang.String familly,
int size,
boolean bold)
Create a new instance of JHelpFont not italic, not underline
|
JHelpFont(java.lang.String familly,
int size,
boolean bold,
boolean italic)
Create a new instance of JHelpFont not underline
|
JHelpFont(java.lang.String familly,
int size,
boolean bold,
boolean italic,
boolean underline)
Create a new instance of JHelpFont
|
Modifier and Type | Method and Description |
---|---|
java.awt.Shape |
computeShape(java.lang.String string,
int x,
int y)
Compute shape of a string
|
Pair<java.util.List<JHelpTextLine>,java.awt.Dimension> |
computeTextLines(java.lang.String text,
JHelpTextAlign textAlign)
Compute text lines representation with this font
|
Pair<java.util.List<JHelpTextLine>,java.awt.Dimension> |
computeTextLines(java.lang.String text,
JHelpTextAlign textAlign,
int limitWidth)
Compute text lines representation with this font
|
Pair<java.util.List<JHelpTextLine>,java.awt.Dimension> |
computeTextLines(java.lang.String text,
JHelpTextAlign textAlign,
int limitWidth,
int limitHeight)
Compute text lines representation with this font
|
JHelpMask |
createMask(java.lang.String string)
Create a mask from a string
|
java.lang.String |
getFamily()
Font family
|
int |
getHeight()
Font height
|
int |
getSize()
Font size
|
boolean |
isBold()
Indicates if font is bold
|
boolean |
isItalic()
Indicates if font is italic
|
boolean |
isUnderline()
Underline status
|
java.awt.Dimension |
stringSize(java.lang.String string)
Compute size of a string
|
int |
stringWidth(java.lang.String string)
Compute string width
|
int |
underlinePosition(java.lang.String string,
int y)
Compute underline position
|
public static final char SMILEY_HAPPY
public static final char SMILEY_SAD
private final java.awt.Font font
private final java.awt.FontMetrics fontMetrics
private final boolean underline
public JHelpFont(java.lang.String familly, int size)
familly
- Font family namesize
- Font sizepublic JHelpFont(java.lang.String familly, int size, boolean bold)
familly
- Font family namesize
- Font sizebold
- Indicates if bold or notpublic JHelpFont(java.lang.String familly, int size, boolean bold, boolean italic)
familly
- Font family namesize
- Font sizebold
- Bold enable/disableitalic
- Italic enable/disablepublic JHelpFont(java.lang.String familly, int size, boolean bold, boolean italic, boolean underline)
familly
- Font family namesize
- Font sizebold
- Bold enable/disableitalic
- Italic enable/disableunderline
- Underline enable/disablepublic java.awt.Shape computeShape(java.lang.String string, int x, int y)
string
- Stringx
- X position of top-lefty
- Y position of top-leftpublic Pair<java.util.List<JHelpTextLine>,java.awt.Dimension> computeTextLines(java.lang.String text, JHelpTextAlign textAlign)
text
- Text to usetextAlign
- Align to usepublic Pair<java.util.List<JHelpTextLine>,java.awt.Dimension> computeTextLines(java.lang.String text, JHelpTextAlign textAlign, int limitWidth)
text
- Text to usetextAlign
- Align to uselimitWidth
- Number maximum of pixels in widthpublic Pair<java.util.List<JHelpTextLine>,java.awt.Dimension> computeTextLines(java.lang.String text, JHelpTextAlign textAlign, int limitWidth, int limitHeight)
text
- Text to usetextAlign
- Align to uselimitWidth
- Number maximum of pixels in widthlimitHeight
- Limit height in pixelspublic JHelpMask createMask(java.lang.String string)
string
- String to convert in maskpublic java.lang.String getFamily()
public int getHeight()
public int getSize()
public boolean isBold()
true
if font is boldpublic boolean isItalic()
true
if font is italicpublic boolean isUnderline()
public java.awt.Dimension stringSize(java.lang.String string)
string
- String to measurepublic int stringWidth(java.lang.String string)
string
- String to measurepublic int underlinePosition(java.lang.String string, int y)
string
- Stringy
- Y of top