You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.
I am having trouble loading a particular Font in my app.
The .ttf file is in the resources folder and the path to the file is also correct. This is the code I used to check:
val fontStr = "fonts/FiraCode-Regular.ttf".apply {
val inputStream = MethodHandles.lookup().lookupClass().getResourceAsStream(this)
val clazzPackage = MethodHandles.lookup().lookupClass().packageName
println("FONT LOADING: $clazzPackage -> $inputStream -> ${loadFont("fonts/FiraCode-Regular.ttf", 14)}")
}
The output when I run the application is FONT LOADING: me.blocky.logreader.style -> java.io.BufferedInputStream@6ebd22fa -> null
Clearly, the file is there since the inputStream is not null. But the loadFont method still returns null.
Does anybody know what's going on?
The text was updated successfully, but these errors were encountered:
I am having trouble loading a particular Font in my app.
The .ttf file is in the resources folder and the path to the file is also correct. This is the code I used to check:
The output when I run the application is
FONT LOADING: me.blocky.logreader.style -> java.io.BufferedInputStream@6ebd22fa -> null
Clearly, the file is there since the inputStream is not null. But the loadFont method still returns null.
Does anybody know what's going on?
The text was updated successfully, but these errors were encountered: