aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/graph/font
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/font')
-rw-r--r--src/jogl/classes/com/jogamp/graph/font/Font.java35
-rw-r--r--src/jogl/classes/com/jogamp/graph/font/FontFactory.java20
-rw-r--r--src/jogl/classes/com/jogamp/graph/font/FontSet.java16
3 files changed, 36 insertions, 35 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/font/Font.java b/src/jogl/classes/com/jogamp/graph/font/Font.java
index 64a3a3e6c..a4a8fd53d 100644
--- a/src/jogl/classes/com/jogamp/graph/font/Font.java
+++ b/src/jogl/classes/com/jogamp/graph/font/Font.java
@@ -31,10 +31,10 @@ import com.jogamp.opengl.math.geom.AABBox;
/**
* Interface wrapper for font implementation.
- *
+ *
* TrueType Font Specification:
* http://developer.apple.com/fonts/ttrefman/rm06/Chap6.html
- *
+ *
* TrueType Font Table Introduction:
* http://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter08
*/
@@ -50,22 +50,22 @@ public interface Font {
public static final int NAME_VERSION = 5;
public static final int NAME_MANUFACTURER = 8;
public static final int NAME_DESIGNER = 9;
-
-
+
+
/**
* Metrics for font
- *
+ *
* Depending on the font's direction, horizontal or vertical,
* the following tables shall be used:
- *
+ *
* Vertical http://developer.apple.com/fonts/TTRefMan/RM06/Chap6vhea.html
* Horizontal http://developer.apple.com/fonts/TTRefMan/RM06/Chap6hhea.html
*/
- public interface Metrics {
+ public interface Metrics {
float getAscent(float pixelSize);
float getDescent(float pixelSize);
float getLineGap(float pixelSize);
- float getMaxExtend(float pixelSize);
+ float getMaxExtend(float pixelSize);
float getScale(float pixelSize);
AABBox getBBox(float pixelSize);
}
@@ -74,12 +74,12 @@ public interface Font {
* Glyph for font
*/
public interface Glyph {
- // reserved special glyph IDs
+ // reserved special glyph IDs
// http://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter08#ba57949e
public static final int ID_UNKNOWN = 0;
public static final int ID_CR = 2;
public static final int ID_SPACE = 3;
-
+
public Font getFont();
public char getSymbol();
public AABBox getBBox(float pixelSize);
@@ -89,25 +89,26 @@ public interface Font {
public String getName(int nameIndex);
public StringBuilder getName(StringBuilder string, int nameIndex);
-
+
/** Shall return the family and subfamily name, separated a dash.
* <p>{@link #getName(StringBuilder, int)} w/ {@link #NAME_FAMILY} and {@link #NAME_SUBFAMILY}</p>
* <p>Example: "{@code Ubuntu-Regular}"</p> */
public StringBuilder getFullFamilyName(StringBuilder buffer);
-
+
public StringBuilder getAllNames(StringBuilder string, String separator);
-
+
public float getAdvanceWidth(int i, float pixelSize);
public Metrics getMetrics();
public Glyph getGlyph(char symbol);
public int getNumGlyphs();
-
+
public float getStringWidth(CharSequence string, float pixelSize);
public float getStringHeight(CharSequence string, float pixelSize);
public AABBox getStringBounds(CharSequence string, float pixelSize);
-
- public boolean isPrintableChar( char c );
-
+
+ public boolean isPrintableChar( char c );
+
/** Shall return {@link #getFullFamilyName()} */
+ @Override
public String toString();
} \ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
index d2824b9dc..884662e6e 100644
--- a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
+++ b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
@@ -49,13 +49,13 @@ import jogamp.graph.font.UbuntuFontLoader;
public class FontFactory {
private static final String FontConstructorPropKey = "jogamp.graph.font.ctor";
private static final String DefaultFontConstructor = "jogamp.graph.font.typecast.TypecastFontConstructor";
-
+
/** Ubuntu is the default font family */
public static final int UBUNTU = 0;
-
+
/** Java fonts are optional */
public static final int JAVA = 1;
-
+
private static final FontConstructor fontConstr;
static {
@@ -63,18 +63,18 @@ public class FontFactory {
* For example:
* "jogamp.graph.font.typecast.TypecastFontFactory" (default)
* "jogamp.graph.font.ttf.TTFFontImpl"
- */
+ */
String fontImplName = PropertyAccess.getProperty(FontConstructorPropKey, true);
if(null == fontImplName) {
fontImplName = DefaultFontConstructor;
}
fontConstr = (FontConstructor) ReflectionUtil.createInstance(fontImplName, FontFactory.class.getClassLoader());
}
-
+
public static final FontSet getDefault() {
return get(UBUNTU);
}
-
+
public static final FontSet get(int font) {
switch (font) {
case JAVA:
@@ -83,15 +83,15 @@ public class FontFactory {
return UbuntuFontLoader.get();
}
}
-
+
public static final Font get(File file) throws IOException {
return fontConstr.create(file);
}
public static final Font get(final URLConnection conn) throws IOException {
return fontConstr.create(conn);
- }
-
+ }
+
public static boolean isPrintableChar( char c ) {
if( Character.isWhitespace(c) ) {
return true;
@@ -101,5 +101,5 @@ public class FontFactory {
}
final Character.UnicodeBlock block = Character.UnicodeBlock.of( c );
return block != null && block != Character.UnicodeBlock.SPECIALS;
- }
+ }
}
diff --git a/src/jogl/classes/com/jogamp/graph/font/FontSet.java b/src/jogl/classes/com/jogamp/graph/font/FontSet.java
index d376922ab..17b8b2136 100644
--- a/src/jogl/classes/com/jogamp/graph/font/FontSet.java
+++ b/src/jogl/classes/com/jogamp/graph/font/FontSet.java
@@ -34,29 +34,29 @@ public interface FontSet {
/** Font family REGULAR **/
public static final int FAMILY_REGULAR = 0;
-
+
/** Font family LIGHT **/
public static final int FAMILY_LIGHT = 1;
-
+
/** Font family MEDIUM **/
public static final int FAMILY_MEDIUM = 2;
-
+
/** Font family CONDENSED **/
public static final int FAMILY_CONDENSED = 3;
-
+
/** Font family MONO **/
public static final int FAMILY_MONOSPACED = 4;
-
+
/** SERIF style/family bit flag. Fallback to Sans Serif. */
public static final int STYLE_SERIF = 1 << 1;
-
+
/** BOLD style bit flag */
public static final int STYLE_BOLD = 1 << 2;
-
+
/** ITALIC style bit flag */
public static final int STYLE_ITALIC = 1 << 3;
Font getDefault() throws IOException ;
-
+
Font get(int family, int stylebits) throws IOException ;
}