http://www.eteks.com

com.eteks.awt
クラス PJAFontData

java.lang.Object
  |
  +--com.eteks.awt.PJAFontData
すべての実装インタフェース:
java.io.Serializable

public class PJAFontData
extends java.lang.Object
implements java.io.Serializable

Pure Java AWT Font data. From version 1.1, this class keeps all the data of a font to avoid using PJAFontMetrics which extends java.awt.FontMetrics (java.awt.FontMetrics requires awt library to be loaded). This class implements Serializable ; it implements readObject (ObjectInputStream) and writeObject (ObjectOutputStream) methods in such a way that they call the methods read (InputStream) and write (OutputStream) respectively of this class. As The methods read () and write () don't use serialization process, they can be use to restore and save the state of an instance of PJAFontData in Java environments where serialization isn't available (Java 1.0 and J2ME).

導入されたバージョン:
PJA1.1
バージョン:
2.3
作成者:
Emmanuel Puybaret
関連項目:
PJAGraphicsManager, PJAFontPeer, PJAFontCapture, 直列化された形式

フィールドの概要
static java.lang.String PJAF1_1_FILE_HEADER
           
static java.lang.String PJAF1_1_FONT_HEADER
           
 
コンストラクタの概要
PJAFontData(java.awt.Font font, int minChar, int maxChar)
          Creates a font data from font.
PJAFontData(java.io.InputStream in)
          Creates a font data from the in stream with read () method.
 
メソッドの概要
 boolean equals(java.lang.Object object)
          Returns true if this font peer and object have the same name, style and size.
 int getAscent()
          Returns the ascent of this font.
protected  int[] getCharBits()
          Provides direct access to bitset array for this font's pixels.
protected  int getCharBitsOffset(char ch)
          Retrieves the offset for the bit representing top-left pixel in the given char, within the bitset.
protected  int getCharBitsScanSize()
          Retrieves the scansize of the linear bit array, i.e., the number of bits in each very long scanline of pixels stored sequentially in the bitset
protected  int getCharOffsetAtBaseline(char ch)
          Returns the offset of the character ch to add at baseline.
protected  int[] getCharPixels(char ch)
          Returns the pixels array of the character ch.
protected  int getCharPixelsWidth(char ch)
          Returns the scansize of the pixels array of the character ch.
 int getCharsWidth(char[] data, int offset, int len)
          Returns the string width of a string in this font.
 int getCharWidth(int ch)
          Returns the char width of the character ch in this font.
 int getDescent()
          Returns the descent of this font.
 int getLeading()
          Returns the leading of this font.
 int getMaxAdvance()
          Returns the max advance of this font.
 int getMaxAscent()
          Returns the max ascent of this font.
 int getMaxDescent()
          Returns the max descent of this font.
 java.lang.String getName()
          Returns the name of this font.
 int getSize()
          Returns the size of this font.
 int getStyle()
          Returns the style of this font.
 int hashCode()
           
 void read(java.io.InputStream in)
          Reads the fields of this object from in.
static java.lang.String styleToString(int style)
           
 java.lang.String toString()
           
 void write(java.io.OutputStream out)
          Writes the fields of this object to out.
 
クラス java.lang.Object から継承したメソッド
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

PJAF1_1_FILE_HEADER

public static final java.lang.String PJAF1_1_FILE_HEADER

PJAF1_1_FONT_HEADER

public static final java.lang.String PJAF1_1_FONT_HEADER
コンストラクタの詳細

PJAFontData

public PJAFontData(java.io.InputStream in)
            throws java.io.IOException
Creates a font data from the in stream with read () method.
パラメータ:
in - An opened input stream.
例外:
java.io.EOFException - End of in is reached.
java.io.IOException - The object fields couldn't be read correctly from in.
関連項目:
read(java.io.InputStream)

PJAFontData

public PJAFontData(java.awt.Font font,
                   int minChar,
                   int maxChar)
Creates a font data from font. The pixels of all the characters between minChar and maxChar are grabbed and stored in internal fields.
パラメータ:
font - A valid font object.
minChar - The first character to be grabbed.
maxChar - The last character to be grabbed.
メソッドの詳細

getName

public java.lang.String getName()
Returns the name of this font.

getStyle

public int getStyle()
Returns the style of this font.

getSize

public int getSize()
Returns the size of this font.

getLeading

public int getLeading()
Returns the leading of this font.
関連項目:
PJAGraphicsExtension.getFontLeading()

getAscent

public int getAscent()
Returns the ascent of this font.
関連項目:
PJAGraphicsExtension.getFontAscent()

getDescent

public int getDescent()
Returns the descent of this font.
関連項目:
PJAGraphicsExtension.getFontDescent()

getMaxAscent

public int getMaxAscent()
Returns the max ascent of this font.
関連項目:
PJAGraphicsExtension.getFontMaxAscent()

getMaxDescent

public int getMaxDescent()
Returns the max descent of this font.
関連項目:
PJAGraphicsExtension.getFontMaxDescent()

getMaxAdvance

public int getMaxAdvance()
Returns the max advance of this font.
関連項目:
PJAGraphicsExtension.getFontMaxAdvance()

getCharWidth

public int getCharWidth(int ch)
Returns the char width of the character ch in this font.
パラメータ:
ch - The character to measure.
関連項目:
PJAGraphicsExtension.getCharWidth(char)

getCharsWidth

public int getCharsWidth(char[] data,
                         int offset,
                         int len)
Returns the string width of a string in this font.
関連項目:
PJAGraphicsExtension.getStringWidth(java.lang.String)

getCharPixels

protected int[] getCharPixels(char ch)
Returns the pixels array of the character ch.
関連項目:
PJAGraphics.drawString(java.lang.String, int, int), getCharPixelsWidth(char)

getCharBits

protected int[] getCharBits()
Provides direct access to bitset array for this font's pixels.
戻り値:
array of ints containing a linear sequence of bits, which represent the pixels all the characters in this font displayed side by side and scanned horizontally left-to-right and then top-to-bottom
導入されたバージョン:
PJA2.3

getCharBitsOffset

protected int getCharBitsOffset(char ch)
Retrieves the offset for the bit representing top-left pixel in the given char, within the bitset.
導入されたバージョン:
PJA2.3

getCharBitsScanSize

protected int getCharBitsScanSize()
Retrieves the scansize of the linear bit array, i.e., the number of bits in each very long scanline of pixels stored sequentially in the bitset
導入されたバージョン:
PJA2.3

getCharPixelsWidth

protected int getCharPixelsWidth(char ch)
Returns the scansize of the pixels array of the character ch.
関連項目:
PJAGraphics.drawString(java.lang.String, int, int), getCharPixels(char)

getCharOffsetAtBaseline

protected int getCharOffsetAtBaseline(char ch)
Returns the offset of the character ch to add at baseline. When font is italic, some characters have some pixels at the left of the x coordinate of their drawing point.
関連項目:
PJAGraphics.drawString(java.lang.String, int, int), getCharPixels(char)

write

public void write(java.io.OutputStream out)
           throws java.io.IOException
Writes the fields of this object to out. It does the same as serialization.

read

public void read(java.io.InputStream in)
          throws java.io.IOException
Reads the fields of this object from in. It does the same as serialization.

equals

public boolean equals(java.lang.Object object)
Returns true if this font peer and object have the same name, style and size.
オーバーライド:
クラス java.lang.Object 内の equals

hashCode

public int hashCode()
オーバーライド:
クラス java.lang.Object 内の hashCode

styleToString

public static java.lang.String styleToString(int style)

toString

public java.lang.String toString()
オーバーライド:
クラス java.lang.Object 内の toString

© 1997-2001 eTeks - All rights reserved