participate


JavaFX Application Development - How to embed fonts?
This question is not answered.

<<   Back to Forum  |   Give us Feedback
This topic has 3 replies on 1 page.
Riepi
Posts:26
Registered: 8/5/08
How to embed fonts?   
Dec 8, 2008 3:37 AM
 
 
In javafx.scene.text.Font attribute name is written:

"There is a single unified way to load both embedded and device fonts. Simply create the font by specifying the full name of the font you want to load. This class will first search for an embedded font by this name. If not found, then it will check a list of known fonts shipped with JavaFX. If the font is still not found, then system fonts will be checked. If the specific font still cannot be located, then a fallback font will be used. The "name" will be updated to reflect the actual name of the font being used. A load failure condition can be discovered by checking the name of the Font with the name you tried to load. "

How to embed the font?

Greetings, Riepi
 
joan_7
Posts:4
Registered: 6/18/09
Re: How to embed fonts?   
Jun 18, 2009 8:05 AM (reply 1 of 3)  (In reply to original post )
 
 
Hi, I have the same question:
How to embed a Font in a Java FX application?

Thanks in advance,
Joan
 
casperghost
Posts:54
Registered: 8/12/04
Re: How to embed fonts?   
Jun 18, 2009 8:18 AM (reply 2 of 3)  (In reply to #1 )
 
 
from the JavaFX Jira on the subject RT-4149:

You embed the font along with your application. You load the font by name. Simply place the ttf font file in a package in your application. Then you need to include a fonts.mf file in the META-INF of the jar so that we can discover the embedded fonts at runtime. The fonts.mf file is simply a properties file that lists the name of the font and the location of the font.

fonts.mf:

Arindam\ Neo\ Bold = /com/mycompany/fonts/arind.ttf

for example. Then in code you just load a font by name, using the name that you entered into your fonts.mf:

Font {
name: "Arindam Neo Bold"
size: 27
}
 
joan_7
Posts:4
Registered: 6/18/09
Re: How to embed fonts?   
Jun 18, 2009 8:26 AM (reply 3 of 3)  (In reply to #2 )
 
 
Thanks !!!
I will try right now.

Joan
 
This topic has 3 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 58
  • Guests : 126

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums