Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #24342
| From | Jan Burse <janburse@fastmail.fm> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Unicode >16 Bit JTextPane etc.. |
| Date | 2013-06-09 09:35 +0200 |
| Organization | albasani.net |
| Message-ID | <kp1b7c$466$1@news.albasani.net> (permalink) |
| References | (7 earlier) <WrKdnZwK9spbQC7MnZ2dnUVZ_vSdnZ2d@westnet.com.au> <kp0n19$nme$2@dont-email.me> <kp0q41$g4i$1@dont-email.me> <kp0v8m$3iv$1@dont-email.me> <kp1a7t$9bm$1@dont-email.me> |
Thank you very much.
This is very interesting.
Didn't use canDisplay() so far.
markspace schrieb:
> On 6/8/2013 9:16 PM, Jeff Higgins wrote:
>>
>> textpane.setFont(new Font("Dialog", Font.PLAIN, 60));
>> textpane.setText("\uD835\uDCC0\uD835\uDC9C\uD835\uDC9E\uD835\uDC9F")
>
>
> This ends up printing Cambria Math for the font name on my system.
>
>
> class SmallDemo
> {
>
> private JFrame frame = new JFrame( "A Small Demo" );
> private JTextPane textpane = new JTextPane();
> private static final String TEST =
> "\uD835\uDCC0\uD835\uDC9C\uD835\uDC9E\uD835\uDC9F";
>
> public SmallDemo()
> {
> try {
> frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
> Font[] allFonts =
> GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
> Font usingFont = null;
> for( Font font : allFonts ) {
> if( font.canDisplay( 120000 ) ) {
> usingFont = new Font( font.getFontName(), Font.PLAIN, 30 );
> textpane.setFont( usingFont );
> break;
> }
> }
> textpane.setText( TEST );
> StyledDocument doc = textpane.getStyledDocument();
> doc.insertString( doc.getLength(), usingFont.getFontName(),
> null);
> frame.add( textpane );
> frame.pack();
> frame.setVisible( true );
> } catch( BadLocationException ex ) {
> Logger.getLogger( SmallDemo.class.getName() ).log(
> Level.SEVERE, null,
> ex );
> }
> }
>
> public static void main( String[] args )
> {
> SwingUtilities.invokeLater( new Runnable()
> {
> @Override
> public void run()
> {
> SmallDemo demo = new SmallDemo();
> }
> } );
> }
> }
>
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Unicode >16 Bit JTextPane etc.. Jan Burse <janburse@fastmail.fm> - 2013-06-08 13:29 +0200
Re: Unicode >16 Bit JTextPane etc.. Jan Burse <janburse@fastmail.fm> - 2013-06-08 13:42 +0200
Re: Unicode >16 Bit JTextPane etc.. Jeff Higgins <jeff@invalid.invalid> - 2013-06-08 10:31 -0400
Re: Unicode >16 Bit JTextPane etc.. Joerg Meier <joergmmeier@arcor.de> - 2013-06-08 20:35 +0200
Re: Unicode >16 Bit JTextPane etc.. Jeff Higgins <jeff@invalid.invalid> - 2013-06-08 18:17 -0400
Re: Unicode >16 Bit JTextPane etc.. Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-06-08 23:12 -0500
Re: Unicode >16 Bit JTextPane etc.. Jan Burse <janburse@fastmail.fm> - 2013-06-09 00:15 +0200
Re: Unicode >16 Bit JTextPane etc.. Jeff Higgins <jeff@invalid.invalid> - 2013-06-08 18:20 -0400
Re: Unicode >16 Bit JTextPane etc.. Jan Burse <janburse@fastmail.fm> - 2013-06-09 00:25 +0200
Re: Unicode >16 Bit JTextPane etc.. Jeff Higgins <jeff@invalid.invalid> - 2013-06-08 20:47 -0400
Re: Unicode >16 Bit JTextPane etc.. "Qu0ll" <Qu0llSixFour@gmail.com> - 2013-06-09 11:42 +1000
Re: Unicode >16 Bit JTextPane etc.. Martin Gregorie <martin@address-in-sig.invalid> - 2013-06-09 01:50 +0000
Re: Unicode >16 Bit JTextPane etc.. Jeff Higgins <jeff@invalid.invalid> - 2013-06-08 22:48 -0400
Re: Unicode >16 Bit JTextPane etc.. Jeff Higgins <jeff@invalid.invalid> - 2013-06-09 00:16 -0400
Re: Unicode >16 Bit JTextPane etc.. markspace <markspace@nospam.nospam> - 2013-06-09 00:23 -0700
Re: Unicode >16 Bit JTextPane etc.. Jan Burse <janburse@fastmail.fm> - 2013-06-09 09:35 +0200
Re: Unicode >16 Bit JTextPane etc.. Jan Burse <janburse@fastmail.fm> - 2013-06-09 09:51 +0200
Re: Unicode >16 Bit JTextPane etc.. Martin Gregorie <martin@address-in-sig.invalid> - 2013-06-09 13:05 +0000
Re: Unicode >16 Bit JTextPane etc.. Stanimir Stamenkov <s7an10@netscape.net> - 2013-06-09 17:37 +0300
Re: Unicode >16 Bit JTextPane etc.. Stanimir Stamenkov <s7an10@netscape.net> - 2013-06-09 17:55 +0300
Re: Unicode >16 Bit JTextPane etc.. Sven Köhler <remove-sven.koehler@gmail.com> - 2013-06-09 07:08 +0300
csiph-web