1

I am very interested in this font named 'Fira Code'. Are there any way or methods that I can use in order to set this font as a Font to my Java components (preferably in JTextArea and JLabel)? I have downloaded the font locally (thru Google Fonts) and I have found out that it was a TrueType font file (.ttf extension).

Is it possible to use this font?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
super_newb
  • 73
  • 1
  • 10
  • 2
    [Java Load Custom Font File (.ttf)](https://stackoverflow.com/questions/21210204/java-load-custom-font-file-ttf) and [Font Awesome with Swing](https://stackoverflow.com/questions/24177348/font-awesome-with-swing/24177458#24177458) might be place to start – MadProgrammer Apr 17 '21 at 10:18
  • I tried it. It seems the technique lies in registering the font as one of the font assets on the java project. However, I am still stuck on calling the font itself. :( – super_newb Apr 17 '21 at 14:33
  • You tried what? You were given two suggestions. The "Font Awesome" link contains a complete example. If you can't get that to work how do you expect us to help? We can't guess what your code is like. Start with the working example to prove it works. Then use that knowledge and update your current application. – camickr Apr 17 '21 at 14:42
  • Oh, I thought it was on the icon my bad, I'm sorry. Thank you for the notice I am really big novice on this one – super_newb Apr 17 '21 at 15:41
  • 1
    I shamed myself in disbelief, I should have made my brain pay attention more. I am very sorry. Thank you @camickr – super_newb Apr 17 '21 at 15:48
  • And thnak you also @MadProgrammer the tip was awesome and working – super_newb Apr 17 '21 at 15:49

0 Answers0