Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-06-2008, 12:45 AM
Senior Member
 
Join Date: Dec 2007
Location: Spain
Posts: 342
willemjav is on a distinguished road
Font display of applets that are viewed on different platforms
I created four font types to display some info text over an image slide show applet:
smallFont = new Font("Serif", Font.PLAIN, 12);
normalFont = new Font("Serif", Font.PLAIN, 16);
largeFont = new Font("Serif", Font.PLAIN, 18);
verylargeFont = new Font("Serif", Font.PLAIN, 24);
Things look all right when I view my applet on my Mac computer (because I did the programming using a Mac). But when viewing the applet on a PC things change dramatically (e.g. accent signs etc. change totally).
What to do to make fonts look the same on different platforms?

willem
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-06-2008, 03:10 AM
Senior Member
 
Join Date: Dec 2007
Location: Spain
Posts: 342
willemjav is on a distinguished road
would this code do it (have no pc, so can´t see)

smallFont = new Font("Times Unicode", Font.PLAIN, 12);
normalFont = new Font("Times Unicode", Font.PLAIN, 16);
largeFont = new Font("Times Unicode", Font.PLAIN, 18);
verylargeFont = new Font("Times Unicode", Font.PLAIN, 24);

willemjav
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-06-2008, 04:35 AM
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
In the Font api comments section see the 5 paragraphs under the header Physical and Logical Fonts. Paragraph 3 mentions why this happens and the faq link in the last paragraph gives alternate solutions.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-06-2008, 02:35 PM
Senior Member
 
Join Date: Dec 2007
Location: Spain
Posts: 342
willemjav is on a distinguished road
Hardwired I did visit the font-api (I always visit the api when using a new/ unknown class) and taught “jesus, do I need to read all this just to get some accents right?”.
UTF-8 or UTF-16 is the magic key. I probably have to do sometime like: let the text of the JTextArea be in one of these two formats (because the text displaying of the applet happens in that component only).
I am having a hard time to find out where to start, this is (again) an overwhelming issue. Is there something “simple” to say to JTextArea please use UTF-8 or UTF-16?

Before I continue programming the photo-prepare-application I have to pay some attention to my website and its applet concerning the font display. I do have the positioning of the multi-textline working (still dragging outside the JTextArea because I have to start learning the glass pane fully),
The web-page looks fine on my mac-book but on a pc it is a real mess. So I will start with the text of the JTextArea but I should look also into the HTML font and looks (the accents etc. do appear but font and size is different in each browser….. disasters see WILLEM DRAGSTRA WEB SITE from a pc).

willemjav
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set font size for a xml value bala_kj Advanced Java 3 04-01-2008 01:00 PM
Login user name - for all platforms. Eranga Advanced Java 0 03-17-2008 07:45 AM
How to change font/ font color etc in a graphic object using JCombobox? JavaInLove AWT / Swing 0 02-07-2008 01:28 PM
JTable with Font Rama Koti Reddy AWT / Swing 1 12-12-2007 07:22 PM
Font question orchid Java 2D 1 08-01-2007 04:03 AM


All times are GMT +3. The time now is 08:27 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org