From ad6349be75698cc2aba19e3cade426e093f58f9c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 28 Mar 2023 04:47:09 +0200 Subject: Graph Font: TypecastFont: getGlyphBoundsFU() + processString(): If isWhitespace() continue w/ AABBox resize, but don't earmark this (whitespace) glyph for next left_glyph (kerning). --- src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/jogamp/graph') diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java index dcf8ce56c..1bc0fe0f4 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java @@ -329,9 +329,7 @@ class TypecastFont implements Font { left_glyph = null; // break kerning continue; } else if( glyph.isWhiteSpace() ) { // covers 'space' and all non-contour symbols - advanceTotal += glyph.getAdvanceFU(); left_glyph = null; // break kerning - continue; } if( null != left_glyph ) { advanceTotal += left_glyph.getKerningFU(glyph_id); @@ -340,7 +338,9 @@ class TypecastFont implements Font { res.resize(temp1.transform(glyph.getBoundsFU(), temp_box)); advanceTotal += glyph.getAdvanceFU(); - left_glyph = glyph; + if( !glyph.isWhiteSpace() ) { + left_glyph = glyph; + } } } return res; @@ -419,7 +419,9 @@ class TypecastFont implements Font { res.resize(temp1.transform(glyphShape.getBounds(), temp_box)); visitor.visit(character, glyph, temp1); advanceTotal += glyph.getAdvance(); - left_glyph = glyph; + if( !glyph.isWhiteSpace() ) { + left_glyph = glyph; + } } } return res; -- cgit v1.2.3