Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #24343

Re: Unicode >16 Bit JTextPane etc..

Path csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail
From Jan Burse <janburse@fastmail.fm>
Newsgroups comp.lang.java.programmer
Subject Re: Unicode >16 Bit JTextPane etc..
Date Sun, 09 Jun 2013 09:51:10 +0200
Organization albasani.net
Lines 96
Message-ID <kp1c5e$66n$1@news.albasani.net> (permalink)
References <kov4ho$ud7$1@news.albasani.net> <kov5bh$9n$1@news.albasani.net> <kovetc$qg5$1@dont-email.me> <kp0aeg$e29$1@news.albasani.net> <kp0adi$fqs$1@dont-email.me> <kp0b0l$f4u$1@news.albasani.net> <kp0j0h$k1f$1@dont-email.me> <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>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.albasani.net U63WygP18+uaPrHW4qL4uAPRT7V7jD77dLRTJIqNIuqb2riMEJhsQ6X2raKOZk9sdEidajQ9WRbe7SrqZvAEaA==
NNTP-Posting-Date Sun, 9 Jun 2013 07:51:10 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="AGdiz2VW6WO/Hcsoz2bEamnVqcDhi+KMkdzlsVrejDGQqTmyAcEAc9Xn0A/b5roJrA6I3lnB/wODbb7RSrvp5y+igsDBCo4QqFOuW9Jr8m/D+ihh5P03BUrDR84MQTrZ"; mail-complaints-to="abuse@albasani.net"
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0 SeaMonkey/2.17.1
In-Reply-To <kp1a7t$9bm$1@dont-email.me>
Cancel-Lock sha1:CFZITFSNelEwo7bkyN/2TmommNY=
Xref csiph.com comp.lang.java.programmer:24343

Show key headers only | View raw


Doesn't give something useful on Mac.

I get for (note the not before the canDisplay()):

     public static void main(String[] args) {
         Font[] allFonts = 
GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
         for (int i = 0; i < allFonts.length; i++) {
             Font font = allFonts[i];
             if (!font.canDisplay(120000))
                 System.out.println("font=" + font.getFontName());
         }
     }

The following list:

font=Lucida Bright Demibold
font=Lucida Bright Demibold Italic
font=Lucida Bright Italic
font=Lucida Bright Regular
font=Lucida Sans Demibold
font=Lucida Sans Regular
font=Lucida Sans Typewriter Bold
font=Lucida Sans Typewriter Regular

But every font not on the above list, does erroreously
display some chinese character instead of the math symbol.

The fonts on the above list, on the other hand seem
to show a white box on the Mac.

Bye


P.S.: I am using 1.7.0_15. Let me try a newer version.

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


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