simonsmh / notocjk

NotoSansCJK & NotoSerifCJK full weight patch for Android devices.
SIL Open Font License 1.1
478 stars 22 forks source link

android12 调用Google Sans Text的地方都没有多字重 #32

Closed anonymousgregory closed 2 years ago

anonymousgregory commented 2 years ago

包括通知,磁贴,pixel launcher等,应该是fonts_customization.xml的问题?

WordlessEcho commented 2 years ago

不好意思,我们没有Pixel测试机,可以麻烦你把fonts_customization.xml放上来并且附上几张截图吗?

RodertHaung commented 2 years ago

fonts_customization.txt

weight3 weight2 weight1 可以用 alias 重新導向字體 <alias name="google-sans-medium" to="google-sans" weight="500" /> <alias name="google-sans-bold" to="google-sans" weight="700" /> <alias name="google-sans-text-medium" to="google-sans-text" weight="500" /> <alias name="google-sans-text-bold" to="google-sans-text" weight="700" /> <alias name="google-sans-text-italic" to="google-sans-text" weight="400" style="italic" /> <alias name="google-sans-text-italic-medium" to="google-sans-text" weight="500" style="italic" /> <alias name="google-sans-text-italic-bold" to="google-sans-text" weight="700" style="italic" />

這件事情在 Google Issue Tracker 上也被提及了兩次,但是是以不同的敘述方式

https://issuetracker.google.com/issues/190638633

https://issuetracker.google.com/issues/196725091

錯誤更正: <alias name="google-sans-text-medium-italic" to="google-sans-text" weight="500" style="italic" /> <alias name="google-sans-text-bold-italic" to="google-sans-text" weight="700" style="italic" />

WordlessEcho commented 2 years ago

我觉得Google的操作有些迷惑,为什么不是写alias而是重新写一遍family

WordlessEcho commented 2 years ago

先试试看: ~Fix Google Sans fallback · simonsmh/notocjk@0bb3210~ Fix Google Sans fallback · simonsmh/notocjk@7d3b473

RodertHaung commented 2 years ago

抱歉,忘了說 fonts_customization.xml 的位置在 /system/product/etc/fonts_customization.xml 除此之外應該是可以運作了

anonymousgregory commented 2 years ago

先试试看: ~Fix Google Sans fallback · simonsmh/notocjk@0bb3210~ Fix Google Sans fallback · simonsmh/notocjk@7d3b473

测试后无效,但根据前面的思路之前替换fonts_customization.xml是ok的。

WordlessEcho commented 2 years ago

抱歉,忘了說 fonts_customization.xml 的位置在 /system/product/etc/fonts_customization.xml 除此之外應該是可以運作了

不好意思,我之前按着AOSP文档猜的,等一下我修改一下

WordlessEcho commented 2 years ago

@RodertHaung @Gregoryweix Fix path of customization · simonsmh/notocjk@04a684d

anonymousgregory commented 2 years ago

@RodertHaung @Gregoryweix Fix path of customization · simonsmh/notocjk@04a684d

还是不行,刷入后查看fonts_customization并没有加入这些alias

anonymousgregory commented 2 years ago

@RodertHaung @Gregoryweix Fix path of customization · simonsmh/notocjk@04a684d

另外,最后两个familiy name 和alias name应该错了,是medium-italic 和bold-italic

RodertHaung commented 2 years ago

/data/adb/modules/notocjk/system 目錄下沒有 /product/etc/fonts_customization 檔案。

WordlessEcho commented 2 years ago

是我不够熟悉项目,请再试试这个 Fix path of sed command · simonsmh/notocjk@647cdac Copy and process file under the MODPATH · simonsmh/notocjk@83a4a1e

anonymousgregory commented 2 years ago

/<family customizationType=\"new-named-family\" name=\"google-sans-text-italic-medium\">/,/<\/family>/ {/<\/family>/! d; /<\/family>/ s/.*/ <alias name="google-sans-text-italic-medium" to="google-sans-text" weight="500" style="italic" \/>/}; /<family customizationType=\"new-named-family\" name=\"google-sans-text-italic-bold\">/,/<\/family>/ {/<\/family>/! d; /<\/family>/ s/.*/ <alias name="google-sans-text-italic-bold" to="google-sans-text" weight="700" style="italic" \/>/}; 除了这个medium和bold斜体写反了的问题,其他应该都ok了,新fonts_customization.xml附上,这一段没起作用。 fonts_customization.txt

WordlessEcho commented 2 years ago

cc @simonsmh e63d805

WordlessEcho commented 2 years ago

Release 17

AokiFuru commented 2 years ago

fonts_customization.xml的原文件路径不对。 MIRRORPATH/system/product/etc/fonts_customization.xml 这个路径我测试是修改之后的文件 正确的应该是MIRRORPATH/product/etc/fonts_customization.xml 以及49行应该是ui_print "- Migrating $FILECUSTOM"

WordlessEcho commented 2 years ago

fonts_customization.xml的原文件路径不对。 MIRRORPATH/system/product/etc/fonts_customization.xml 这个路径我测试是修改之后的文件 正确的应该是MIRRORPATH/product/etc/fonts_customization.xml 以及49行应该是ui_print "- Migrating $FILECUSTOM"

不好意思,我没有测试机,添麻烦了 所以正确的路径应该是 /product/etc/fonts_customization.xml 对吗?

AokiFuru commented 2 years ago

是的 复制之后/data/adb/modules/notocjk/system/product/etc/fonts_customization.xml 这个是对的

simonsmh commented 2 years ago

有软连接吧

AokiFuru commented 2 years ago

有软连接吧

/dev/xxx/.magisk/mirror/system/product软链接是指向/product的而不是/dev/xxx/.magisk/mirror/product

AokiFuru commented 2 years ago

cp -af $MIRRORPATH/product/etc/fonts_customization.xml $MODPATH/system/product/etc/fonts_customization.xml 可能我没有表达清楚,51行正确路径的应该是这样的,后者需要放到system里才会生效。