简体   繁体   中英

Font issue in Swing application on Mac OS

In my Swing Application, I have a Label with font type of Mistral , which works fine in Windows but not on Mac OS X . Due to that, font size is set to default, which makes clumsy UI. I mean if Font Name is unknown then it should atleast consider the given font size. But Font object itself is not created as I am passing invalid font family. So Is there any way to include this Font , while packaging jar?

So Is there any way to include this Font, while packaging jar?

Sure, put in in the Jar then get an URL using getClass().getResource() .

Look in the Font methods for the createFont() variants to load it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM