505 |
*/ |
*/ |
506 |
public void getWidths(float[] w) { putFontWidths(getId(), w); } |
public void getWidths(float[] w) { putFontWidths(getId(), w); } |
507 |
} |
} |
508 |
|
|
509 |
|
static String defaultFontFile = "/usr/share/fonts/type1/gsfonts/n019004l.pfb"; |
510 |
|
|
511 |
/** Create a new font. |
/** Create a new font. |
512 |
* @param name Filename to load the font from. |
* @param name Filename to load the font from. |
513 |
|
* null for default. |
514 |
* @param loadPt The pixel size to load the font at. |
* @param loadPt The pixel size to load the font at. |
515 |
*/ |
*/ |
516 |
static public Font createFont(String name, int loadPt) { |
static public Font createFont(String name, int loadPt) { |
517 |
return new Font(createFontImpl(name, loadPt)); |
return new Font(createFontImpl( |
518 |
|
name == null ? defaultFontFile : name, |
519 |
|
loadPt)); |
520 |
} |
} |
521 |
|
|
522 |
|
|
523 |
|
static private native int createFontImpl(String filename, int loadPt); |
524 |
static private native float getFontHeight(int id); |
static private native float getFontHeight(int id); |
525 |
static private native float getFontYOffs(int id); |
static private native float getFontYOffs(int id); |
|
static private native int createFontImpl(String name, int loadPt); |
|
526 |
static private native void deleteFont(int id); |
static private native void deleteFont(int id); |
527 |
static private native void putFontWidths(int id, float[] w); |
static private native void putFontWidths(int id, float[] w); |
528 |
|
|