Apime v1.0

com.java4ever.apime.ui.font
Class ImageFont

java.lang.Object
  extended bycom.java4ever.apime.ui.IFont
      extended bycom.java4ever.apime.ui.font.ImageFont

public class ImageFont
extends IFont

Fuente generada a partir de una imagen.


Constructor Summary
ImageFont(javax.microedition.lcdui.Image image, byte[] widths, int height, int leading, char init, char end)
          Crea la fuente.
ImageFont(javax.microedition.lcdui.Image image, int width, int height, int leading, char init, char end)
          Crea la fuente (monospaced).
 
Method Summary
 int charWidth(char c)
          Devuelve el ancho de un caracter.
 void drawSubstring(javax.microedition.lcdui.Graphics g, java.lang.String s, int offset, int length, int x, int y, int anchor)
          Dibuja una subcadena de texto (1 línea).
 int getHeight()
          Devuelve la altura de la fuente.
 int getLeading()
          Devuelve el espacio entre líneas.
 int substringWidth(java.lang.String s, int offset, int length)
          Devuelve el ancho en pixels de una subcadena de texto.
 
Methods inherited from class com.java4ever.apime.ui.IFont
addFont, calculateLines, drawString, drawString, drawString, getFont, getLineHeight, getName, removeFont, stringWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageFont

public ImageFont(javax.microedition.lcdui.Image image,
                 int width,
                 int height,
                 int leading,
                 char init,
                 char end)
Crea la fuente (monospaced).

Parameters:
image - Imagen
width - Ancho de cada caracter
height - Alto de cada caracter
leading - Espacio entre líneas
init - Código del primer caracter
end - Código del último caracter

ImageFont

public ImageFont(javax.microedition.lcdui.Image image,
                 byte[] widths,
                 int height,
                 int leading,
                 char init,
                 char end)
Crea la fuente.

Parameters:
image - Imagen
widths - Array con el ancho de cada caracter
height - Alto de cada caracter
leading - Espacio entre líneas
init - Código del primer caracter
end - Código del último caracter
Method Detail

substringWidth

public int substringWidth(java.lang.String s,
                          int offset,
                          int length)
Description copied from class: IFont
Devuelve el ancho en pixels de una subcadena de texto.

Overrides:
substringWidth in class IFont
Parameters:
s - Subcadena de texto
offset - Indice del primer caracter
length - Longitud de la subcadena

charWidth

public int charWidth(char c)
Description copied from class: IFont
Devuelve el ancho de un caracter.

Specified by:
charWidth in class IFont
Parameters:
c - Caracter

getHeight

public int getHeight()
Description copied from class: IFont
Devuelve la altura de la fuente.

Specified by:
getHeight in class IFont

getLeading

public int getLeading()
Description copied from class: IFont
Devuelve el espacio entre líneas.

Specified by:
getLeading in class IFont

drawSubstring

public void drawSubstring(javax.microedition.lcdui.Graphics g,
                          java.lang.String s,
                          int offset,
                          int length,
                          int x,
                          int y,
                          int anchor)
Description copied from class: IFont
Dibuja una subcadena de texto (1 línea).

Specified by:
drawSubstring in class IFont
Parameters:
g - Contexto gráfico
s - Subcadena de texto
offset - Indice del primer caracter
length - Longitud de la subcadena
x - Coordenada X
y - Coordenada Y
anchor - Punto de referencia
See Also:
Graphics

Apime v1.0

Copyright 2004 Java4Ever.com. All Rights Reserved.