summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-04-14 17:42:57 +0200
committerSven Gothel <[email protected]>2023-04-14 17:42:57 +0200
commite4bddd1682233257a20eb73e22b068d5d4694860 (patch)
treeb441834342426601c966d1f7dc8cfd44202b4674 /src/jogl/classes/jogamp/graph
parentbe865f7fdb672ce41110231ba71903671942268b (diff)
Typecast: Expose (new) getGlyphCount(): GlyfTable.getSize() -> (OTFont,Font).getGlyphCount()
Diffstat (limited to 'src/jogl/classes/jogamp/graph')
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java3
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/TTFont.java3
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java4
4 files changed, 13 insertions, 1 deletions
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
index 26952ce9a..d981e09aa 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
@@ -189,6 +189,9 @@ class TypecastFont implements Font {
}
@Override
+ public int getGlyphCount() { return font.getGlyphCount(); }
+
+ @Override
public Glyph getGlyph(final int glyph_id) {
TypecastGlyph result = (TypecastGlyph) idToGlyph.get(glyph_id);
if (null == result) {
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 9ddd080aa..ca45c21aa 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
@@ -152,6 +152,10 @@ public abstract class OTFont {
return _maxp.getNumGlyphs();
}
+ /** Return number of {@link Glyph} IDs available, i.e. retrievable via {@link #getGlyph(int)} [0..count). */
+ public abstract int getGlyphCount();
+
+ /** Return the {@link Glyph} using given ID, see {@link #getGlyphCount()}. */
public abstract Glyph getGlyph(int i);
int seekTable(
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/TTFont.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/TTFont.java
index e7f3f5e35..4cae9bc19 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/TTFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/TTFont.java
@@ -165,6 +165,9 @@ public class TTFont extends OTFont {
}
@Override
+ public int getGlyphCount() { return _glyf.getSize(); }
+
+ @Override
public Glyph getGlyph(final int i) {
final GlyfDescript glyfDescr = _glyf.getDescription(i);
if( null != glyfDescr ) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
index d35ce9baf..5696750cc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
@@ -105,7 +105,9 @@ public class GlyfTable implements Table {
}
}
- public GlyfDescript getDescription(int i) {
+ public int getSize() { return _descript.length; }
+
+ public GlyfDescript getDescription(final int i) {
if (i < _descript.length) {
return _descript[i];
} else {