aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/graph/font
diff options
context:
space:
mode:
authorRami Santina <[email protected]>2011-03-29 01:11:44 +0300
committerRami Santina <[email protected]>2011-03-29 01:11:44 +0300
commitd6aedbf7677e4375d09d0995d3f9c14c5104091b (patch)
tree8f776e37c8e1bffcf2bf2fd9f73300cd60673b82 /src/com/jogamp/graph/font
parentc0eb49806a35c0618af8a61c99ba783d688fc09d (diff)
parentb73de5a53e2e81e2acc5f8f5064e2b0b27a9804e (diff)
Merge with changes done for unit tests
Diffstat (limited to 'src/com/jogamp/graph/font')
-rw-r--r--src/com/jogamp/graph/font/Font.java44
-rw-r--r--src/com/jogamp/graph/font/FontFactory.java6
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