Packages
 In this topic

*Constructors

*Methods

*Fields

 

Packages   PreviousThis PackageNext
Package com.ms.fx   Previous This
Package
Next

 


Class FxOutlineFont

public class FxOutlineFont extends FxFont
{
  // Fields
  protected Color backColor;
  protected Color color;

  // Constructors
  public FxOutlineFont();
  public FxOutlineFont(String name, int style, int size);
  public FxOutlineFont(String name, int style, int size, int flags);

  // Methods
  public boolean drawBytesCallback(FxGraphics g, byte data[],
        int offset, int length, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[]);
  public boolean drawCharsCallback(FxGraphics g, char data[],
        int offset, int length, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[]);
  public boolean drawOutlineChar(FxGraphics g, int xOrig,
        int yOrig, GlyphOutline go);
  public boolean drawStringCallback(FxGraphics g, String str,
        int x, int y, Rectangle optionRect, int options,
        int dx[], int dy[]);
  public static String[] getAttributeList();
  public static String[] getAttributeList(String faceName);
  public static int getFlagsVal(String face, String attribute);
  public static Font getFont(String face, Vector v, int size);
  public static Font getFont(String face, int style, int size,
        int flags);
  public static String[] getFontList();
  public GlyphOutline getGlyphOutlineCallback(FxGraphics g,
        char ch);
  public static int getStyleVal(String face, String attribute);
  public void setBackgroundCallback(Color c);
  public void setColorCallback(Color c);
}

This class produces user-defined outline font objects. FxOutlineFont specifically uses GlyphMetrics, GlyphOutline, OutlineCurve, and OutlinePolygon objects to perform its operations on fonts.

Note FxOutlineFont is derived from FxFont and may be selected into a graphics context the same way that a Font is selected. Like other extended objects in the com.ms.fx package, FxOutlineFont performs all its operations for an FxGraphics object internally by using callback methods. For more information on the callback methods in this documentation, see the beginning of this package.

Font
  |
  +--FxFont
    |
    +--FxOutlineFont

Constructors

FxOutlineFont

public FxOutlineFont();

Constructs a generic font.

This is the constructor used by JavaBeans objects.

FxOutlineFont

public FxOutlineFont(String name, int style, int size);

Creates an FxOutlineFont object with the specified style and size.

ParameterDescription
name The font's name.
style The font's style.
size The font's size (in points).

FxOutlineFont

public FxOutlineFont(String name, int style, int size, int flags);

Creates an FxOutlineFont object with the specified style, size, and flags.

ParameterDescription
name The font's name.
style The font's style.
size The font's size (in points).
flags This parameter can be one or a combination of the following flags:
OUTLINE STRIKEOUT UNDERLINE
ROTATABLE ANTIALIAS

Methods

drawBytesCallback

public boolean drawBytesCallback(FxGraphics g, byte data[], int offset, int
        length, int x, int y, Rectangle optionRect, int options, int dx[],
        int dy[]);

Draws an array of bytes when called by an FxGraphics object.

Note This method is called by FxGraphics if drawBytes is called and an FxOutlineFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. This method is made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object to use.
data The array of bytes.
offset The offset to use.
length The length of the array used.
x The x coordinate of the location where the bytes are drawn.
y The y coordinate of the location where the bytes are drawn.
optionRect An optional rectangle used for clipping or opaquing.
options The options used for this method.
dx An array of dx values.
dy An array of dy values.

Overrides:

drawBytesCallback(FxGraphics,byte[],int,int,int,int,Rectangle,int,int[],int[]) in FxFont.

See Also: com.ms.fx.FxFont.drawBytesCallback, com.ms.fx.FxGraphics.drawBytes

drawCharsCallback

public boolean drawCharsCallback(FxGraphics g, char data[], int offset, int
        length, int x, int y, Rectangle optionRect, int options, int dx[],
        int dy[]);

Draws an array of characters when called by an FxGraphics object.

Note This method is called by FxGraphics if drawChars is called and an FxOutlineFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
data The array of characters.
offset The offset.
length The length of the array used.
x The x coordinate of the location where the characters are drawn.
y The y coordinate of the location where the characters are drawn.
optionRect An optional rectangle used for clipping or opaquing.
options The options used for this method.
dx An array of dx values.
dy An array of dy values.

See Also: com.ms.fx.FxFont.drawCharsCallback, com.ms.fx.FxGraphics.drawChars

drawOutlineChar

public boolean drawOutlineChar(FxGraphics g, int xOrig, int yOrig,
        GlyphOutline go);

Draws an outline character.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
xOrig The x coordinate of the location to draw the character.
yOrig The y coordinate of the location to draw the character.
go The outline character to draw.

drawStringCallback

public boolean drawStringCallback(FxGraphics g, String str, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[]);

Draws a string when called by an FxGraphics object.

Note This method is called by FxGraphics if drawString is called and an FxOutlineFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
str The string to draw.
x The x coordinate of the location where the bytes are drawn.
y The y coordinate of the location where the bytes are drawn.
optionRect An optional rectangle used for clipping or opaquing.
options The options used for this method.
dx An array of dx values.
dy An array of dy values.

Overrides:

drawStringCallback(FxGraphics,String,int,int,Rectangle,int,int[],int[]) in FxFont.

See Also: com.ms.fx.FxFont.drawStringCallback, com.ms.fx.FxGraphics.drawString

getAttributeList

public static String[] getAttributeList();

Retrieves a list of the generic attributes that the font supports.

Return Value:

Returns the list of attributes that the font supports.

Overrides:

getAttributeList() in FxFont.

getAttributeList

public static String[] getAttributeList(String faceName);

Retrieves a list of the attributes that the font supports.

Return Value:

Returns null.

ParameterDescription
faceName The font's name.

Remarks:

Currently, this method is not implemented.

Overrides:

getAttributeList(String) in FxFont.

getFlagsVal

public static int getFlagsVal(String face, String attribute);

Retrieves a value of the flags of the given face name.

Return Value:

Returns 0.

ParameterDescription
face The font's name.
attribute A string that contains the attributes of the font (for example, "Rotatable").

Remarks:

Currently, this method is not implemented.

Overrides:

getFlagsVal(String,String) in FxFont.

getFont

public static Font getFont(String face, Vector v, int size);

Retrieves a font if an exact match is made when given the face, vector, and size.

Return Value:

Returns null.

ParameterDescription
face The font's face name ("Helvetica", for example).
v A list of style names.
size The size of the font (in points).

Remarks:

Currently, this method is not implemented.

Overrides:

getFont(String,Vector,int) in FxFont.

getFont

public static Font getFont(String face, int style, int size, int flags);

Retrieves a font if an exact match is made when given the face, style, size and flags.

Return Value:

Returns a Font object that matches the given parameters.

ParameterDescription
face The font's face name ("Helvetica", for example).
style The font's style.
size The size of the font (in points).
flags The font's flags. This parameter can be one or a combination of the following: EMBEDDED, STRIKEOUT, or UNDERLINE.

Overrides:

getFont(String,int,int,int) in FxFont.

getFontList

public static String[] getFontList();

Retrieves a list of the faces that the font supports.

Return Value:

Returns null.

Remarks:

Currently, this method is not implemented.

Overrides:

getFontList() in FxFont.

getGlyphOutlineCallback

public GlyphOutline getGlyphOutlineCallback(FxGraphics g, char ch);

Retrieves a glyph outline of the character.

Note The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes may extend the callback functionality.

Return Value:

Returns a character GlyphOutline object.

ParameterDescription
g The graphics object to use.
ch The character, whose outline is requested.

Overrides:

getGlyphOutlineCallback(FxGraphics,char) in FxFont.

getStyleVal

public static int getStyleVal(String face, String attribute);

Retrieves a value for the style flags of the given face name.

Return Value:

Returns 0.

ParameterDescription
face The font's name.
attribute A string that contains the attributes of the font (for example, "Rotatable").

Remarks:

Currently, this method is not implemented.

Overrides:

getStyleVal(String,String) in FxFont.

setBackgroundCallback

public void setBackgroundCallback(Color c);

Sets the text background color when called by an FxGraphics object.

Note This method is called by FxGraphics if setTextBackground is called and an FxOutlineFont(IntelliFont) object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

No return value.

ParameterDescription
c The background color.

Overrides:

setBackgroundCallback(Color) in FxFont.

See Also: com.ms.fx.FxGraphics.setTextBackground

setColorCallback

public void setColorCallback(Color c);

Sets the foreground color of the font when called by an FxGraphics object.

Note This method is called by FxGraphics if setColor is called and an FxOutlineFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

No return value.

ParameterDescription
c The foreground color.

Overrides:

setColorCallback(Color) in FxFont.

See Also: java.awt.Graphics.setColor

Fields

backColor
The background color.
color
The foreground color.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.