diff options
author | Sven Göthel <[email protected]> | 2024-02-03 01:14:10 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-02-03 01:14:10 +0100 |
commit | 4ba099b97df41be220c4b2816c728e6b8cc1b037 (patch) | |
tree | 7c20f28515ed9d5dba71b0721c24b29c8d3d12eb /src/jogl/classes/jogamp/graph | |
parent | 7928ed90104f71fb53ae8201b3140b8e347b83ee (diff) |
Graph/GraphUI: Move getDefault*() to FontFactory and add {get,set}FallbackFont() + Font.getBestCoverage(..); Use fallback-font in MediaButton in case chosen font doesn't match (foreign languages, e.g. 'zho' Chinese .. )
Diffstat (limited to 'src/jogl/classes/jogamp/graph')
-rw-r--r-- | src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java index c60629582..0a251a378 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java @@ -224,6 +224,17 @@ class TypecastFont implements Font { public int getGlyphCount() { return font.getGlyphCount(); } @Override + public int getDefinedCount(final CharSequence text) { + int res = 0; + for(int i=text.length()-1; i>=0; --i) { + if( !getGlyph(text.charAt(i)).isUndefined() ) { + ++res; + } + } + return res; + } + + @Override public char getGlyphCodepoint(final String name) { final SymAndID value = nameToGlyph.get(name); if( null != value ) { |