OpenAPI 1.0

com.aquafold.openapi.type
Interface AQFont


public interface AQFont

AQFont represents an immutable font object, based on java.awt.Font.

An instance of this interface can be obtained via one of the newFont() methods in AQFontFactory,

Example:
var fontFactory = aqua.type.font;
var arial = fontFactory.newFont("Arial", fontFactory.BOLD, 12);
var helvetica = fontFactory.newFont("Helvetica");


Field Summary
static int BOLD
          The bold style constant.
static int ITALIC
          The italicized style constant.
static int PLAIN
          The plain style constant.
 
Method Summary
 AQFont deriveFont(int style, float size)
          Creates a new AQFont object by replicating this AQFont object and applying a new style and size.
 AQFont deriveFontBySize(float size)
          Creates a new AQFont object by replicating this AQFont object and applying a new size to it.
 AQFont deriveFontByStyle(int style)
          Creates a new AQFont object by replicating this AQFont object and applying a new style to it.
 String getFamily()
          Returns the family name of this AQFont.
 String getFontName()
          Returns the font face name of this AQFont.
 Font getJavaFont()
          Returns the underlying java.awt.Font object.
 String getName()
          Returns the logical name of this AQFont.
 int getSize()
          Returns the point size of this AQFont, rounded to an integer.
 int getStyle()
          Returns the style of this AQFont.
 boolean isBold()
          Indicates whether or not this AQFont object's style is BOLD.
 boolean isItalic()
          Indicates whether or not this AQFont object's style is ITALIC.
 boolean isPlain()
          Indicates whether or not this AQFont object's style is PLAIN.
 

Field Detail

BOLD

static final int BOLD
The bold style constant.

See Also:
Constant Field Values

ITALIC

static final int ITALIC
The italicized style constant.

See Also:
Constant Field Values

PLAIN

static final int PLAIN
The plain style constant.

See Also:
Constant Field Values
Method Detail

deriveFont

AQFont deriveFont(int style,
                  float size)
Creates a new AQFont object by replicating this AQFont object and applying a new style and size.

Parameters:
style - the style for the new AQFont
size - the size for the new AQFont

deriveFontBySize

AQFont deriveFontBySize(float size)
Creates a new AQFont object by replicating this AQFont object and applying a new size to it.

Parameters:
size - the size for the new AQFont

deriveFontByStyle

AQFont deriveFontByStyle(int style)
Creates a new AQFont object by replicating this AQFont object and applying a new style to it.

Parameters:
style - the style for the new AQFont

getFamily

String getFamily()
Returns the family name of this AQFont.

The family name of a font is font specific. Two fonts such as Helvetica Italic and Helvetica Bold have the same family name, Helvetica, whereas their font face names are Helvetica Bold and Helvetica Italic.

Use getName() to get the logical name of the font. Use getFontName() to get the font face name of the font.


getName

String getName()
Returns the logical name of this AQFont.

Use getFamily() to get the family name of the font. Use getFontName() to get the font face name of the font.


getFontName

String getFontName()
Returns the font face name of this AQFont. For example, Helvetica Bold could be returned as a font face name.

Use getFamily() to get the family name of the font. Use getName() to get the logical name of the font.


getSize

int getSize()
Returns the point size of this AQFont, rounded to an integer.

Returns:
the point size of this AQFont in 1/72 of an inch units

getStyle

int getStyle()
Returns the style of this AQFont. The style can be PLAIN, BOLD, ITALIC, or BOLD+ITALIC.


getJavaFont

Font getJavaFont()
Returns the underlying java.awt.Font object.


isBold

boolean isBold()
Indicates whether or not this AQFont object's style is BOLD.


isItalic

boolean isItalic()
Indicates whether or not this AQFont object's style is ITALIC.


isPlain

boolean isPlain()
Indicates whether or not this AQFont object's style is PLAIN.


OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.