summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/font
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-02-19 05:12:04 +0100
committerSven Gothel <[email protected]>2023-02-19 05:12:04 +0100
commitda88b0f2ac0b09082222ce1a387987e8cdd5f21d (patch)
tree67772067a0b02192a0763b55e5a44c27d56b4660 /src/jogl/classes/jogamp/graph/font
parent3d2b65bd43d5abb1acf59754ee325c25b8c299ff (diff)
Graph Font.Metrics: Use unchanges sign of (+) ascent, (-) descent and (+) lineGap, document them properly and fix Font.getLineHeightFU()
Diffstat (limited to 'src/jogl/classes/jogamp/graph/font')
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java6
2 files changed, 4 insertions, 8 deletions
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
index f5358b74b..90cc725e0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
@@ -253,11 +253,7 @@ class TypecastFont implements Font {
@Override
public int getLineHeightFU() {
final Metrics metrics = getMetrics();
- final int lineGap = metrics.getLineGapFU() ; // negative value!
- final int descent = metrics.getDescentFU() ; // positive value!
- final int ascent = metrics.getAscentFU() ; // negative value!
- final int advanceY = lineGap - descent + ascent; // negative value!
- return -advanceY;
+ return metrics.getAscentFU() - metrics.getDescentFU() + metrics.getLineGapFU();
}
@Override
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
index cae8b2755..a9fd32e9d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
@@ -65,7 +65,7 @@ final class TypecastHMetrics implements Metrics {
@Override
public int getAscentFU() {
- return -hheaTable.getAscender(); // inverted
+ return hheaTable.getAscender();
}
@Override
@@ -75,7 +75,7 @@ final class TypecastHMetrics implements Metrics {
@Override
public int getDescentFU() {
- return -hheaTable.getDescender(); // inverted
+ return hheaTable.getDescender();
}
@Override
@@ -85,7 +85,7 @@ final class TypecastHMetrics implements Metrics {
@Override
public int getLineGapFU() {
- return -hheaTable.getLineGap(); // inverted
+ return hheaTable.getLineGap();
}
@Override