simonsmh / notocjk Goto Github PK
View Code? Open in Web Editor NEWNotoSansCJK & NotoSerifCJK full weight patch for Android devices.
License: SIL Open Font License 1.1
NotoSansCJK & NotoSerifCJK full weight patch for Android devices.
License: SIL Open Font License 1.1
在API28以下的系统中,TextView
调用不同字重的字体所使用的属性是fontFamily。fontFamily
的属性值则使用了fonts.xml中的alias。
在系统默认的alias中,是没有DemiLight的。也就是说,不使用API28以后提供的textFontWeight,DemiLight实际上是无法被程序调用的。
问题:
fallbackFor
属性与textFontWeight
是同期推出的,Noto Serif CJK是不是没有必要再添加alias(视作为历史遗留)?Thank you very much!
p.s. How many weights are Noto Serif CJK would be supported? On the lite version, I only see two.
Just in case if you are not aware, a completely new Magisk Module Installer replaces the old Magisk module template. This new format decouples ALL installation logic from modules, and encourages developers to use the provided API for installation. This new format is ENFORCED, meaning all existing modules should upgrade ASAP, and new modules are REQUIRED to follow the rules.
Carefully read through the updated docs!
Warning: All existing modules that does not use the new module format will be automatically removed on May 1st, 2019. Module devs: upgrade your existing modules ASAP!
P.S. This issue is just a kind reminder, you can close it after reading this message :)
Android版本:12.1
fonts_customization.xml
<?xml version="1.0" encoding="utf-8"?>
<fonts-modification version="1">
<family customizationType="new-named-family" name="lato">
<font weight="400" style="normal">Lato-Regular.ttf</font>
<font weight="400" style="italic">Lato-Italic.ttf</font>
<font weight="500" style="normal">Lato-Medium.ttf</font>
<font weight="500" style="italic">Lato-MediumItalic.ttf</font>
<font weight="700" style="normal">Lato-Bold.ttf</font>
<font weight="700" style="italic">Lato-BoldItalic.ttf</font>
</family>
<alias name="lato-medium" to="lato" weight="500" />
<alias name="lato-bold" to="lato" weight="700" />
<family customizationType="new-named-family" name="rubik">
<font weight="400" style="normal">Rubik-Regular.ttf</font>
<font weight="400" style="italic">Rubik-Italic.ttf</font>
<font weight="500" style="normal">Rubik-Medium.ttf</font>
<font weight="500" style="italic">Rubik-MediumItalic.ttf</font>
<font weight="700" style="normal">Rubik-Bold.ttf</font>
<font weight="700" style="italic">Rubik-BoldItalic.ttf</font>
</family>
<alias name="rubik-medium" to="rubik" weight="500" />
<alias name="rubik-bold" to="rubik" weight="700" />
</fonts-modification>
我把 fonts.xml 中的 "zh-Hant" "zh-Hant zh-Bopo" 下的 index 修改为 1("ko"),但是似乎刷入后没有此效果(和修改 index 前的效果一样,繁体中文下未使用韩国字形)。
请问这是什么原因呢?
Redmi Note 8 Pro
MIUI Global 11.0.3
Android 9
Lineage OS 20, Apatch 10568
开机动画消失,导航栏锁定在三按钮模式无法切换其他,一些应用停止运行。
无法确定是哪边的问题。当然Apatch还在早期阶段,等它稳定一些了再适配也不迟。
MIUI10,Android8.0,Magisk17.1。
装模块前firefox一切正常,装了这个模块之后,⊛字符在firefox网页里显示为方块(至少百度搜索的搜索框里是这样),但firefox的地址栏和chrome均能正常显示。firefox的版本是61.0.2。
这是模块的问题还是firefox的问题呢
在KernelSU上使用本模块引起Fennec(FireFox 衍生版)闪退
LineageOS 21 (Android 14) , KernelSU 11682
崩溃日志:
fennec_fdroid-crash.log
fonts_xml.zip
被加到这里了
<!-- [email protected], 2019-05-13 : Modified for SysSans fonts-->
<!--
<family lang="zh-Hans">
<font weight="400" style="normal" index="2">NotoSansCJKjp-Regular.otc</font>
<font weight="400" style="normal" index="2" fallbackFor="serif">NotoSerifCJKjp-Regular.otc</font>
</family>
<family lang="zh-Hant,zh-Bopo">
<font weight="400" style="normal" index="3">NotoSansCJKjp-Regular.otc</font>
<font weight="400" style="normal" index="3" fallbackFor="serif">NotoSerifCJKjp-Regular.otc</font>
</family>
--> <!-- #else /* OPLUS_FEATURE_FONT_FLIP */-->
rt
还是 "zipUrl": "https://github.com/simonsmh/notocjk/releases/download/22/notocjk.zip"
現在最新版本的版本為2.002,其中修正了些細節。
已經把customize.sh的註釋解開了,但是沒有完全移除乾淨Misans在fonts.xml的訊息
以下這段沒有被移除掉,我猜測可能是因此沒有套用成功
***
***Miui-Regular.ttf
***
***
***Miui-Regular.ttf
***
系統原始版.txt
不完全修改版.txt
版本:
MIUI EU 13.0.13穩定版
When install this module in Magisk manager with Magisk v16.0, it failed with a notice that "Please install Magisk v15.0+". And when install it in recovery mode, it failed with an error code 1.
部分符号上浮,浏览器内的符号无法显示,例如423down网页内的搜索🔍图标显示为框
After installing, nothing seems to happen.
customize.sh 里少了个 fi
包括通知,磁贴,pixel launcher等,应该是fonts_customization.xml的问题?
脚本生成的 fonts.xml
根本不对,NotoSerifCJK 与 NotoSansCJK 字重并非完全对应。NotoSerif
拥有 semibold,extralight,但却没有 demilight, thin 字重。NotoSansCJK 拥有 Demilight, thin 却没有 Semibold, extralight.
以下是目前脚本生成的字体配置,
<family lang="zh-Hans">
<font weight="100" style="normal" index="2">NotoSansCJK-Thin.ttc</font>
<font weight="100" style="normal" index="2" fallbackFor="georgia">NotoSerifCJK-Thin.ttc</font>
<font weight="300" style="normal" index="2">NotoSansCJK-Light.ttc</font>
<font weight="300" style="normal" index="2" fallbackFor="georgia">NotoSerifCJK-Light.ttc</font>
<font weight="350" style="normal" index="2">NotoSansCJK-DemiLight.ttc</font>
<font weight="350" style="normal" index="2" fallbackFor="georgia">NotoSerifCJK-DemiLight.ttc</font>
<font weight="400" style="normal" index="2">NotoSansCJK-Regular.ttc</font>
<font weight="400" style="normal" index="2" fallbackFor="georgia">NotoSerifCJK-Regular.ttc</font>
<font weight="500" style="normal" index="2">NotoSansCJK-Medium.ttc</font>
<font weight="500" style="normal" index="2" fallbackFor="georgia">NotoSerifCJK-Medium.ttc</font>
<font weight="900" style="normal" index="2">NotoSansCJK-Black.ttc</font>
<font weight="900" style="normal" index="2" fallbackFor="georgia">NotoSerifCJK-Black.ttc</font>
<font weight="700" style="normal" index="2">NotoSansCJK-Bold.ttc</font>
<font weight="700" style="normal" index="2" fallbackFor="georgia">NotoSerifCJK-Bold.ttc</font>
</family>
鉴于 Google Issue Tracker 中提交的问题迟迟不修复,如果能向 LineageOS(很多第三方 ROM 的上游)、GrapheneOS 以及 CalyxOS 等 ROM 直接提交字重补丁的话,就可以在不使用 Magisk 的情况下拥有完整的中文字重体验,不知道作者是否愿意实现?谢谢。
LineageOS: https://wiki.lineageos.org/contributing
GrapheneOS: https://grapheneos.org
CalyxOS: https://calyxos.org/
手机:OnePlus 7T pro
系统:Android 10
Magisk 版本:20.4
安装流程:
因 magisk 仓库中搜不到对应的模块,我下载源码打包成 zip 然后安装
报错:
- Copying zip to temp directory
- Installing notocjk.zip
! Installation failed
只是通过shizuku或者adb指令能达到目标吗
当前 customize.sh 的逻辑会导致在无法此 commit 后的 Magisk 上正常读取并修改 fonts.xml。mirror 路径属于 Magisk 的实现细节,不应该被外部脚本依赖。
magisk --denylist exec cp /system/etc/fonts.xml "$TMPDIR/fonts.xml"
你好,simonsmh
很感谢你持续更新magisk的notocjk包,一直从android 6.x 使用到现在的 android 9.x。
之前记得在 android 7.0的时候提过一个issue就是关于DroidSansFallback.ttf导致 aldiko乱码的,你耐心回答并在后续更新包中采用了我提供的DroidSansFallback字体。
最近,手机系统升级到了android 9.0 刷 magisk-notocjk 包 DroidSansFallback.ttf 未生效,电子书 Aldiko 再次出现乱码。
再次来麻烦simonsmh兄,希望能有空的时候解决一下这个问题,谢谢
Device: Pixel 7
OS Version: Android 14
Build number: AP1A.240405.002
Play Store Version: 40.4.31-31 [0] [PR] 621249419
Play Store will open normally with the module enabled, but right after the loading animation (that's when data and UI are rendered) the Play Store crashes. After I disabled the module and rebooted, the Play Store would open normally.
My Google Account is in Japan, so my Play Store homepage would be filled with Japanese, which might be related.
<font weight="400" style="normal" index="2" postScriptName="NotoSansCJKjp-Regular">
6: PostScript name for the font; Name ID 6 specifies a string which is used to invoke a PostScript language font that corresponds to this OpenType font. When translated to ASCII, the name string must be no longer than 63 characters and restricted to the printable ASCII subset, codes 33 to 126, except for the 10 characters '[', ']', '(', ')', '{', '}', '<', '>', '/', '%'.
In a CFF OpenType font, there is no requirement that this name be the same as the font name in the CFF’s Name INDEX. Thus, the same CFF may be shared among multiple font components in a Font Collection. See the 'name' table section of “Recommendations for OpenType fonts” for additional information.
Please update when your free time
字体如果需要在一加的 coloros 12 中全局生效,配置文件需要放在 /system/system_ext/etc/fonts_base.xml;我试图在 customize.sh 中把 sed 之后的文件 copy 到该位置,但是还是没有生效。我对 magisk 模块并不是很了解,只好求助 maintainer 啦!多谢!
型号:Nexus 6
Android 版本:7.1.1
Magisk 版本:15.3
Get new font working temporarily.
Replace noto back later.
短暂地出现在v10版本,可见 WordlessEcho/Noto-CJK-VF-Magisk#2
在本模块表现为字体fallback到了Droid Sans Fallback
参见 WordlessEcho/Noto-CJK-VF-Magisk#6
我现在的手机是小米MIX2,装了这个字体模块之后,打开微信、知乎、哔哩哔哩都会卡半天打不开。一开始,我以为是Magisk有什么bug,导致的卡顿。所以,我就自己手动把字体和fonts.xml
复制到/system
分区,然后,发现还是卡顿。然后,也换过字体格式,什么SuperOTC、中日韩单独的OTF都试过一遍,还是会卡。当然,单独的OTF文件会有所缓解,但还是无法忍受。那我只能降低点要求,减少字体规模,把最常用的400和700字重的字体留下,分别对应Regular和Bold,其他的字重舍去。试了一下发现基本不卡了,粗体也能正常显示了。不知道作者方不方便制作这个nano版本?
/proc/self/maps
中会显示通过 mmap
映射的文件名和对应的设备号,通过 VFS 机制(Magisk 的 bind mount 或 KernelSU 的 overlayfs)修改的字体文件会显示 data 分区的设备号,从而触发部分应用的风控策略。
TB320FC:/ # grep ' /system/' /proc/$(pidof com.android.systemui)/maps
...
707b39d000-707b39e000 r--p 00000000 fe:09 3813 /system/lib64/libasyncio.so
707b39e000-707b39f000 r-xp 00001000 fe:09 3813 /system/lib64/libasyncio.so
707b39f000-707b3a0000 r--p 00002000 fe:09 3813 /system/lib64/libasyncio.so
707b3d2000-707b3e2000 r--p 00000000 fe:09 4097 /system/lib64/libmediadrmmetrics_full.so
707b3e2000-707b3f4000 r-xp 00010000 fe:09 4097 /system/lib64/libmediadrmmetrics_full.so
707b3f4000-707b3f6000 r--p 00022000 fe:09 4097 /system/lib64/libmediadrmmetrics_full.so
707b3f6000-707b3f7000 rw-p 00023000 fe:09 4097 /system/lib64/libmediadrmmetrics_full.so
707f05e000-708096d000 r--p 00000000 fe:0f 89819 /system/fonts/NotoSerifCJK-Regular.ttc
708096d000-7081c00000 r--p 00000000 fe:0f 49003 /system/fonts/NotoSansCJK-Regular.ttc
7081c00000-7085231000 r--p 00000000 fe:0f 89876 /system/fonts/NotoSerifCJK-VF.otf.ttc
7085231000-708715d000 r--p 00000000 fe:0f 88918 /system/fonts/NotoSansCJK-VF.otf.ttc
708715d000-70873a1000 r--p 00000000 fe:09 2730 /system/fonts/Roboto-Regular.ttf
708aa58000-708aab3000 r--p 00000000 fe:09 3940 /system/lib64/libcrypto.so
708aab3000-708ab2a000 r-xp 0005b000 fe:09 3940 /system/lib64/libcrypto.so
708ab2a000-708ab7b000 --xp 000d2000 fe:09 3940 /system/lib64/libcrypto.so
708ab7b000-708ab80000 r-xp 00123000 fe:09 3940 /system/lib64/libcrypto.so
708ab80000-708ab90000 r--p 00128000 fe:09 3940 /system/lib64/libcrypto.so
708ab90000-708ab91000 rw-p 00137000 fe:09 3940 /system/lib64/libcrypto.so
...
要消除此类痕迹,需要 VFS 路径与对应设备号匹配(即路径显示 /data/xxxxxx
),或将对应地址替换为 memfd 映射(Shamiko)。
Android 12 提供了通过 OTA 单独更新字体文件的方法:https://source.android.com/docs/core/fonts/custom-font-fallback
字体文件受 fs-verity 以及签名验证保护(Android 12-13 为 fs-verity 签名验证,Android 14 为用户态签名验证),FontManagerService 启动时会删除 /data/fonts 下验证失败的文件。
echo 0 > /proc/sys/fs/verity/require_signatures
config_fontManagerServiceCerts
追加自签名证书以下步骤是以 Android 13 为例。
# # 安装字体
# echo 0 > /proc/sys/fs/verity/require_signatures
# touch /data/local/tmp/dummy
# # 由于禁用了签名验证,可以使用空文件作为签名文件
# # 此处两个路径都需要 system_server 进程可读
# cmd font update /system/fonts/NotoSansCJK-VF.otf.ttc /data/local/tmp/dummy
Success
#
# # 修改模块
# echo "echo 0 > /proc/sys/fs/verity/require_signatures" >> /data/adb/modules/notocjk/post-fs-data.sh
# rm /data/adb/modules/notocjk/system/fonts/NotoSansCJK-VF.otf.ttc
#
# # 重启验证
# reboot
# grep fonts /proc/$(pidof com.android.systemui)/maps
72cf22b000-72d1157000 r--p 00000000 fe:0f 97458 /data/fonts/files/~~xbiOPHgakY7ty1i3IeKxog==/NotoSansCJKjp-Thin.otc
735a8aa000-735c1b9000 r--p 00000000 fe:0f 95862 /system/fonts/NotoSerifCJK-Regular.ttc
735c1b9000-735d44c000 r--p 00000000 fe:0f 95828 /system/fonts/NotoSansCJK-Regular.ttc
735d44c000-7360a7d000 r--p 00000000 fe:0f 95836 /system/fonts/NotoSerifCJK-VF.otf.ttc
7360a7d000-7360cc1000 r--p 00000000 fe:09 2730 /system/fonts/Roboto-Regular.ttf
7696ce8000-7696d33000 r--p 00000000 fe:09 2731 /system/fonts/RobotoStatic-Regular.ttf
cmd font clear
主动删除所有热更新字体A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.