Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get font file as a File object or get its path

User_SVC79Apr 9 2022

Hi,
I want to get font file as a File object or get its path.
My goal is to copy paste the font file to an another folder.
To do that, I did some research and this is the only solution I found: https://stackoverflow.com/questions/2019249/get-font-file-as-a-file-object-or-get-its-path

The problem of this solution is that it use a really old class that does not seems maintain.
I am saying that, because GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts() show all the font without any problem, but the method on stackoverflow can't find the font in this folder: %userprofile%\AppData\Local\Microsoft\Windows\Fonts

Comments
Post Details
Added on Apr 9 2022
0 comments
118 views