including fonts

David Hill David.Hill at Oracle.com
Mon Jan 4 13:24:51 UTC 2016


On 1/3/16, 9:52 AM, Tom Eugelink wrote:

Hi Tom,
     The OpenJFX wiki has some font information at https://wiki.openjdk.java.net/display/OpenJFX/Font+Setup

I am pretty sure it does not address your issue, but I am always looking for suggested edits for our wiki. So if you get a good answer... :-)

Dave
> Addendum:
>
> If I list the font families using Font.getFamilies() I get "Roboto Medium" once, given that both TTF files are added using @font-face. But if I examine Font.getFontNames() I get separate entries for "Roboto Medium" and "Roboto Medium Italic". Closer examination of the font loading reveals that indeed each font has its own distinct name and some fonts shared the same family name. That makes sense.
>
> The thing is that in CSS -as far as I can see- fonts can only accessed through its family name, not its own name.
>
> Tom
>
>
> On 3-1-2016 11:21, Tom Eugelink wrote:
>> I'm currently including Google's Roboto font in JFXtras and making it easily available to other users. I noticed that the font-family attribute in font-face is ignored, and you have to use the name as it is specified in the TTF file. I found https://bugs.openjdk.java.net/browse/JDK-8094516 which says "/Please note that all @font‑face descriptors are ignored except for the src descriptor./" That pretty much explains what is going on.
>>
>> Now, Roboto comes in different styles, condensed, bold, etc, but also italic. However, italic is a separate TTF file, so you have a Roboto-Medium.ttf and a Roboto-MediumItalic.ttf. The name of the font inside these two TTF files is the same, so when I use "font-family: 'Roboto Medium'" whatever ever font is defined last by font-face is used, and the other is not accessible.
>>
>> My question is: is the way Roboto does Italic, with the same font name in the TTF file, a bug of Roboto, or is this common?
>>
>> Tom
>


-- 
David Hill<David.Hill at Oracle.com>
Java Embedded Development

"A man's feet should be planted in his country, but his eyes should survey the world."
-- George Santayana (1863 - 1952)



More information about the openjfx-dev mailing list