Accessing custom font from Jar

  1. Make sure the case of the font file name & extension is exactly the same in code as on the file system. Windows may not be case sensitive, but Java is.
  2. Check the InputStream returned by getResourceAsStream() for null. If it is null, that indicates the resources was not located.
  3. Put the font in the root of the Jar and add “https://stackoverflow.com/” as the prefix to the name.

Leave a Comment