Closed SalomonBrys closed 1 week ago
Faced same issue but for wasm, fonts from multiplatform shared library cannot be properly loaded that leads to this
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Loading a Font resource which TTF file is in the
resource
directory does not work if the file is in another module (or JAR) file than the main application module.For example, this only works if
JetBrainsMono-Regular.ttf
is in the application resource directory, and not any other module:The exception, using
1.6.0-beta01
is:This happens because the class loader used is
Thread.currentThread().contextClassLoader
(See DesktopFont.desktop.kt:178).This makes impossible to create JAR libraries with compose function that provides their own font files.
There should be an optional parameter to the
Font
function that takes a class loader