How would one go about adding resources like fonts...
# amper
t
How would one go about adding resources like fonts using Amper? I have created a
resources/font
directory but I can't seem to find the Font. Looking online I see some people that modify the
sourceSets
in gradle. Is this something that also needs to be done in Amper?
youtrack new 1
a
cc @Alexander Tsarev
t
Update: I also tried by renaming it to
res
and
composeResources
and neither seems to work. I can get
Res.font
in my app but the generated font
object
is empty 🤔
a
@Tom Truyen, can you please clarify, do you try to use resources in a Gradle-based project?
t
It is an Amper project with gradle. So I have a settings.gradle.kts and module.yaml for the modules. The issue is that when I try to add a font like in the screenshot above, the Res.font object that is generated has an empty font object
@Anton Mefodichev A little more info maybe to clarify: I would expect
Res.font
to have an entry for my custom font, but it is empty I have attached both a screenshot for the generated
Res.kt
and the file structure that I currently have
@amakeev Do you maybe have any insights on this? It is becoming a blocker for me right now
a
@Tom Truyen, can you please provide your reproducer project? Thank you in advance!
t
@Anton Mefodichev This is the exact project that I am working on which is having the issue: https://github.com/TomTruyen/pomodor-timer-compose-multiplatform
🙏 1
a
@Tom Truyen, I just have seen your comment here: https://youtrack.jetbrains.com/issue/AMPER-427/Using-composite.-components.-resources-the-Res-class-was-generated-but-there-was-no-string-field It looks we should wait for the dev-team reply here. 🤔
t
That is unfortunate. The ticket has been open for 5 months already, is there an alternative way of using fonts for now? like maybe by loading the font over the internet via some CDN?