TTF/字体文件在Jetpack Compose项目中被视为错误。

huangapple go评论104阅读模式
英文:

TTF/Font file seen as error in Jetpack Compose project

问题

我想使用自定义字体,我下载了"Poppins"字体,并将TTF文件粘贴到新建的"font"文件夹中,它们下面有一条红线,可能是试图指示它们存在问题。我创建的"font"文件夹位于java/res/font。

我尝试在Google上查找此问题,但找不到任何相关信息。您能帮助我吗?我将附上层次结构和它们的外观照片。Android Studio没有提供任何关于可能问题的信息。感谢您的帮助。

在此处输入图片描述

英文:

I want to use a custom font, I downloaded the "Poppins" font and pasted the TTF files into the freshly made "font" folder and they have a red line under them, presumably trying to indicate that there is a problem with them. The "font" folder I made is located in java/res/font.

I tried to google the issue but I could not find anything about this. May you help me? I will attach a photo of the hierarchy and how they look. Android Studio doesn't give any info on what that may be. Thanks for looking into this.

enter image description here

答案1

得分: 0

大写字母和“-”字符在资源文件名中不允许使用。将文件名改为全部小写,并且可以用下划线“_”替换“-”。

英文:

Capital letters and - chars are not allowed in resource file names. Rename the files to all lowercase, and you can replace the - with underscore _.

huangapple
  • 本文由 发表于 2023年1月9日 01:56:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/75050120.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定