diff options
Diffstat (limited to 'src/com/jogamp/graph/font')
-rw-r--r-- | src/com/jogamp/graph/font/Font.java | 44 | ||||
-rw-r--r-- | src/com/jogamp/graph/font/FontFactory.java | 6 |
2 files changed, 23 insertions, 27 deletions
diff --git a/src/com/jogamp/graph/font/Font.java b/src/com/jogamp/graph/font/Font.java index 0abaad5b5..fbdf1f474 100644 --- a/src/com/jogamp/graph/font/Font.java +++ b/src/com/jogamp/graph/font/Font.java @@ -29,46 +29,44 @@ package com.jogamp.graph.font; import com.jogamp.graph.geom.AABBox; +/** + * Interface wrapper for font implementation. + * + * TrueType Font Specification: + * http://developer.apple.com/fonts/ttrefman/rm06/Chap6.html + */ + public interface Font { /** - * Metrics for font based on pixel size ! - * - * If no pixelSize is given, this font's static pixelSize is being used. - * - * value = Table.value * fontSize * 1.0f / HeadTable.UnitsPerEm + * Metrics for font */ public interface Metrics { - public float getAscent(); - public float getDescent(); - public float getLineGap(); - public float getScale(); - public float getScaleForPixelSize(float pixelSize); - public AABBox getBBox(); + float getAscent(float pixelSize); + float getDescent(float pixelSize); + float getLineGap(float pixelSize); + float getScale(float pixelSize); + AABBox getBBox(float pixelSize); } /** - * Glyph for font symbols based on pixel size ! - * - * If no pixelSize is given, this font's static pixelSize is being used. + * Glyph for font */ public interface Glyph { public Font getFont(); public char getSymbol(); - public AABBox getBBox(); - public float getAdvance(); - public float getAdvanceForPixelSize(float pixelSize, boolean useFrationalMetrics); + public AABBox getBBox(float pixelSize); + public float getAdvance(float pixelSize, boolean useFrationalMetrics); } public String getName(); - public float getSize(); + public Metrics getMetrics(); public Glyph getGlyph(char symbol); - - public float getStringWidth(String string); - public float getStringHeight(String string); - public AABBox getStringBounds(CharSequence string); - public int getNumGlyphs(); + + public float getStringWidth(String string, float pixelSize); + public float getStringHeight(String string, float pixelSize); + public AABBox getStringBounds(CharSequence string, float pixelSize); }
\ No newline at end of file diff --git a/src/com/jogamp/graph/font/FontFactory.java b/src/com/jogamp/graph/font/FontFactory.java index a96dac1b8..b595413ba 100644 --- a/src/com/jogamp/graph/font/FontFactory.java +++ b/src/com/jogamp/graph/font/FontFactory.java @@ -35,10 +35,8 @@ public interface FontFactory { String[] families, String style, String variant, - String weight, - String size); + String weight); Font createFont(Vertex.Factory<? extends Vertex> factory, - String name, - int size); + String name); }
\ No newline at end of file |