Skip to content

Commit adbcf0f

Browse files
committed
as with #739, use calculated ascent/descent instead of native metrics (fixes #768)
1 parent 1f303c1 commit adbcf0f

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

core/src/processing/opengl/PGL.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,10 +2717,10 @@ protected static void fillFloatBuffer(FloatBuffer buf, int i0, int i1,
27172717
// TODO: the next three functions shouldn't be here...
27182718
// Uses 'Object' so that the API can be used w/ Android Typeface objects
27192719

2720-
abstract protected int getFontAscent(Object font);
2720+
// abstract protected int getFontAscent(Object font);
27212721

27222722

2723-
abstract protected int getFontDescent(Object font);
2723+
// abstract protected int getFontDescent(Object font);
27242724

27252725

27262726
abstract protected int getTextWidth(Object font, char[] buffer, int start, int stop);

core/src/processing/opengl/PGraphicsOpenGL.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3427,6 +3427,7 @@ protected boolean textModeCheck(int mode) {
34273427
// TEXT IMPL
34283428

34293429

3430+
/*
34303431
@Override
34313432
public float textAscent() {
34323433
if (textFont == null) defaultFontOrDeath("textAscent");
@@ -3447,6 +3448,7 @@ public float textDescent() {
34473448
if (descent == 0) descent = super.textDescent();
34483449
return descent;
34493450
}
3451+
*/
34503452

34513453

34523454
@Override

core/src/processing/opengl/PJOGL.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ private FontRenderContext getFontRenderContext(Font font) { // ignore
475475
}
476476

477477

478+
/*
478479
@Override
479480
protected int getFontAscent(Object font) {
480481
return getFontMetrics((Font) font).getAscent();
@@ -485,6 +486,7 @@ protected int getFontAscent(Object font) {
485486
protected int getFontDescent(Object font) {
486487
return getFontMetrics((Font) font).getDescent();
487488
}
489+
*/
488490

489491

490492
@Override

core/todo.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
1294 (4.3.1)
2+
X difference in text position with processing 4.3, JAVA2D vs P2D
3+
X https://github.com/processing/processing4/issues/768
24

35

46
contribs

0 commit comments

Comments
 (0)