Last active
October 27, 2020 17:33
-
-
Save bogovicj/ab84eb0ef7f991463b1e8c90ddfb97f2 to your computer and use it in GitHub Desktop.
Testing how unicode is rendered in swing using fiji
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Dimension; | |
import java.awt.Font; | |
import javax.swing.JFrame; | |
import javax.swing.JLabel; | |
import javax.swing.JPanel; | |
String arrow = "→ "; | |
String ts = " "; | |
String times = "✕"; | |
JFrame frame = new JFrame(); | |
frame.setMinimumSize( new Dimension( 300, 400 )); | |
JPanel panel = new JPanel(); | |
frame.add( panel ); | |
JLabel label = new JLabel(); | |
label.setText( "<html>text" + arrow + "<br>" + | |
"32 32<br>" + | |
"32"+ts + "32<br>" + | |
"32x32<br>" + | |
"32"+times+"32<br>" + | |
"32"+ts+times+ts+"32<br>" + | |
"</html>"); | |
Font font = label.getFont().deriveFont( 22f ); | |
label.setFont(font); | |
panel.add( label ); | |
frame.setVisible( true ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment