summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-04-01 20:07:04 +0200
committerSven Gothel <[email protected]>2011-04-01 20:07:04 +0200
commit5857d93e2d41608b247ec18cb9129f3a6624d9ac (patch)
tree38b1ab9b489b9e249a9d2495aa528db1fbee3288 /src/jogl/classes/jogamp
parent85c3bcac2ef65aa7c6a5a4990f1e2559d691a361 (diff)
Font Names: Expose name indices allowing user to pick all names ..
Diffstat (limited to 'src/jogl/classes/jogamp')
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java22
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java10
3 files changed, 11 insertions, 31 deletions
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
index 9829bb426..f702b981f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
@@ -35,7 +35,6 @@ import jogamp.graph.font.typecast.ot.table.CmapIndexEntry;
import jogamp.graph.font.typecast.ot.table.CmapTable;
import jogamp.graph.font.typecast.ot.table.HdmxTable;
import jogamp.graph.font.typecast.ot.table.ID;
-import jogamp.graph.font.typecast.ot.table.NameTable;
import jogamp.graph.geom.plane.AffineTransform;
import jogamp.graph.geom.plane.Path2D;
@@ -141,12 +140,11 @@ class TypecastFont implements FontInt {
char2Glyph = new IntObjectHashMap(cmapentries + cmapentries/4);
}
- public String getName() {
- return font.getName();
+ public String getName(int nameIndex) {
+ return font.getName(nameIndex);
}
-
- public String getAllNames(String separator) {
- return font.getAllNames(separator);
+ public StringBuffer getAllNames(StringBuffer buffer, String separator) {
+ return font.getAllNames(buffer, separator);
}
public Metrics getMetrics() {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
index 2ac7e97d9..17b5af594 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
@@ -101,27 +101,19 @@ public class OTFont {
public OTFont(OTFontCollection fc) {
_fc = fc;
}
-
- public String getName() {
- if(null != _name) {
- StringBuffer sb = new StringBuffer();
- sb.append(_name.getRecordsRecordString(NameTable.RECORD_FAMILY)).append(" - ")
- .append(_name.getRecordsRecordString(NameTable.RECORD_SUBFAMILY)).append(" - ")
- .append(_name.getRecordsRecordString(NameTable.RECORD_MANUFACTURER)) ;
- return sb.toString();
- }
- return Table.notAvailable;
+ public String getName(int nameIndex) {
+ return _name.getRecordsRecordString(nameIndex);
}
-
- public String getAllNames(String separator) {
+ public StringBuffer getAllNames(StringBuffer sb, String separator) {
if(null != _name) {
- StringBuffer sb = new StringBuffer();
+ if(null == sb) {
+ sb = new StringBuffer();
+ }
for(int i=0; i<_name.getNumberOfNameRecords(); i++) {
sb.append(_name.getRecord(i).getRecordString()).append(separator);
}
- return sb.toString();
}
- return Table.notAvailable;
+ return sb;
}
public Table getTable(int tableType) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
index 72fde956c..cfaa7a2bc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
@@ -63,16 +63,6 @@ import java.io.IOException;
* @author <a href="mailto:[email protected]">David Schweinsberg</a>
*/
public class NameTable implements Table {
-
- public static final int RECORD_COPYRIGHT = 0;
- public static final int RECORD_FAMILY = 1;
- public static final int RECORD_SUBFAMILY = 2;
- public static final int RECORD_UNIQUNAME = 3;
- public static final int RECORD_FULLNAME = 4;
- public static final int RECORD_VERSION = 5;
- public static final int RECORD_MANUFACTURER = 8;
- public static final int RECORD_DESIGNER = 9;
-
private DirectoryEntry _de;
private short _formatSelector;
private short _numberOfNameRecords;