diff options
author | Sven Gothel <[email protected]> | 2013-07-03 23:06:43 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-07-03 23:06:43 +0200 |
commit | 4e6c2aadd7d652db3ba1f35eef1a3d61d6e692d0 (patch) | |
tree | 5dc85b39b77b8d4841b2dd75c0d626938c1bb49e /src/jogl/classes/com | |
parent | 3856dcc14f0f27a37930ec3f085746ed91d72cff (diff) |
Revise commit 4c34f5980bddcdc84b10cb3bcbb96b365b9d471e (Bug 767): TAB, BS and CR/ENTER are printable for NEWT KeyEvent and font handling. Fix regression.
- Original behavior was treating CR/ENTER them as printable, lets keep it this way.
- KeyEvent: Query these 3 whitespaces upfront, no need to incl. them in 'nonPrintableKeys'.
- Fix regression: Native VK_ENTER was not change in commit 4c34f5980bddcdc84b10cb3bcbb96b365b9d471e.
Diffstat (limited to 'src/jogl/classes/com')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/font/FontFactory.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java index bbdfc0e9f..d2824b9dc 100644 --- a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java +++ b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java @@ -93,10 +93,13 @@ public class FontFactory { } public static boolean isPrintableChar( char c ) { - Character.UnicodeBlock block = Character.UnicodeBlock.of( c ); - return (!Character.isISOControl(c)) && - c != 0 && - block != null && - block != Character.UnicodeBlock.SPECIALS; + if( Character.isWhitespace(c) ) { + return true; + } + if( 0 == c || Character.isISOControl(c) ) { + return false; + } + final Character.UnicodeBlock block = Character.UnicodeBlock.of( c ); + return block != null && block != Character.UnicodeBlock.SPECIALS; } } |