Results 1 to 4 of 4
- 07-05-2008, 10:45 PM #1
Senior Member
- Join Date
- Dec 2007
- Location
- Spain
- Posts
- 573
- Rep Power
- 6
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
- 07-06-2008, 01:10 AM #2
Senior Member
- Join Date
- Dec 2007
- Location
- Spain
- Posts
- 573
- Rep Power
- 6
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
- 07-06-2008, 02:35 AM #3
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.
- 07-06-2008, 12:35 PM #4
Senior Member
- Join Date
- Dec 2007
- Location
- Spain
- Posts
- 573
- Rep Power
- 6
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
Similar Threads
-
How to change font/ font color etc in a graphic object using JCombobox?
By JavaInLove in forum AWT / SwingReplies: 5Last Post: 04-25-2009, 08:00 PM -
how to set font size for a xml value
By bala_kj in forum Advanced JavaReplies: 3Last Post: 04-01-2008, 11:00 AM -
Login user name - for all platforms.
By Eranga in forum Advanced JavaReplies: 0Last Post: 03-17-2008, 05:45 AM -
JTable with Font
By Rama Koti Reddy in forum AWT / SwingReplies: 1Last Post: 12-12-2007, 05:22 PM -
Font question
By orchid in forum Java 2DReplies: 1Last Post: 08-01-2007, 02:03 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks