├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── Makefile ├── README.md ├── fallback.xml ├── module.prop ├── patch-font-names.sh ├── post-fs-data.sh └── system ├── etc └── .gitignore ├── fonts ├── CutiveMono.ttf ├── DroidSansMono.ttf ├── NotoSerif-Bold.ttf ├── NotoSerif-BoldItalic.ttf ├── NotoSerif-Italic.ttf ├── NotoSerif-Regular.ttf ├── Roboto-Black.ttf ├── Roboto-BlackItalic.ttf ├── Roboto-Bold.ttf ├── Roboto-BoldItalic.ttf ├── Roboto-Italic.ttf ├── Roboto-Light.ttf ├── Roboto-LightItalic.ttf ├── Roboto-Medium.ttf ├── Roboto-MediumItalic.ttf ├── Roboto-Regular.ttf ├── Roboto-Thin.ttf ├── Roboto-ThinItalic.ttf ├── RobotoFallback-VF.ttf └── RobotoStatic-Regular.ttf └── product └── fonts ├── GoogleSans-BoldItalic.ttf ├── GoogleSans-Italic.ttf ├── GoogleSans-Medium.ttf ├── GoogleSans-MediumItalic.ttf └── GoogleSans-Regular.ttf /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | liberapay: kdrag0n 2 | patreon: kdrag0n 3 | custom: "https://paypal.me/kdrag0ndonate" 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /*.zip 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2021 Danny Lin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | ################# 4 | # Initialization 5 | ################# 6 | 7 | umask 022 8 | 9 | # echo before loading util_functions 10 | ui_print() { echo "$1"; } 11 | 12 | require_new_magisk() { 13 | ui_print "*******************************" 14 | ui_print " Please install Magisk v19.0+! " 15 | ui_print "*******************************" 16 | exit 1 17 | } 18 | 19 | ######################### 20 | # Load util_functions.sh 21 | ######################### 22 | 23 | OUTFD=$2 24 | ZIPFILE=$3 25 | 26 | mount /data 2>/dev/null 27 | 28 | [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk 29 | . /data/adb/magisk/util_functions.sh 30 | [ $MAGISK_VER_CODE -lt 19000 ] && require_new_magisk 31 | 32 | if [ $MAGISK_VER_CODE -ge 20400 ]; then 33 | # New Magisk have complete installation logic within util_functions.sh 34 | install_module 35 | exit 0 36 | fi 37 | 38 | ################# 39 | # Legacy Support 40 | ################# 41 | 42 | # Global vars 43 | TMPDIR=/dev/tmp 44 | PERSISTDIR=/sbin/.magisk/mirror/persist 45 | 46 | rm -rf $TMPDIR 2>/dev/null 47 | mkdir -p $TMPDIR 48 | 49 | is_legacy_script() { 50 | unzip -l "$ZIPFILE" install.sh | grep -q install.sh 51 | return $? 52 | } 53 | 54 | print_modname() { 55 | local len 56 | len=`echo -n $MODNAME | wc -c` 57 | len=$((len + 2)) 58 | local pounds=`printf "%${len}s" | tr ' ' '*'` 59 | ui_print "$pounds" 60 | ui_print " $MODNAME " 61 | ui_print "$pounds" 62 | ui_print "*******************" 63 | ui_print " Powered by Magisk " 64 | ui_print "*******************" 65 | } 66 | 67 | # Preperation for flashable zips 68 | setup_flashable 69 | 70 | # Mount partitions 71 | mount_partitions 72 | 73 | # Detect version and architecture 74 | api_level_arch_detect 75 | 76 | # Setup busybox and binaries 77 | $BOOTMODE && boot_actions || recovery_actions 78 | 79 | ############## 80 | # Preparation 81 | ############## 82 | 83 | # Extract prop file 84 | unzip -o "$ZIPFILE" module.prop -d $TMPDIR >&2 85 | [ ! -f $TMPDIR/module.prop ] && abort "! Unable to extract zip file!" 86 | 87 | $BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules 88 | MODULEROOT=$NVBASE/$MODDIRNAME 89 | MODID=`grep_prop id $TMPDIR/module.prop` 90 | MODPATH=$MODULEROOT/$MODID 91 | MODNAME=`grep_prop name $TMPDIR/module.prop` 92 | 93 | # Create mod paths 94 | rm -rf $MODPATH 2>/dev/null 95 | mkdir -p $MODPATH 96 | 97 | ########## 98 | # Install 99 | ########## 100 | 101 | if is_legacy_script; then 102 | unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2 103 | 104 | # Load install script 105 | . $TMPDIR/install.sh 106 | 107 | # Callbacks 108 | print_modname 109 | on_install 110 | 111 | # Custom uninstaller 112 | [ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh 113 | 114 | # Skip mount 115 | $SKIPMOUNT && touch $MODPATH/skip_mount 116 | 117 | # prop file 118 | $PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop 119 | 120 | # Module info 121 | cp -af $TMPDIR/module.prop $MODPATH/module.prop 122 | 123 | # post-fs-data scripts 124 | $POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh 125 | 126 | # service scripts 127 | $LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh 128 | 129 | ui_print "- Setting permissions" 130 | set_permissions 131 | else 132 | print_modname 133 | 134 | unzip -o "$ZIPFILE" customize.sh -d $MODPATH >&2 135 | 136 | if ! grep -q '^SKIPUNZIP=1$' $MODPATH/customize.sh 2>/dev/null; then 137 | ui_print "- Extracting module files" 138 | unzip -o "$ZIPFILE" -x 'META-INF/*' -d $MODPATH >&2 139 | 140 | # Default permissions 141 | set_perm_recursive $MODPATH 0 0 0755 0644 142 | fi 143 | 144 | # Load customization script 145 | [ -f $MODPATH/customize.sh ] && . $MODPATH/customize.sh 146 | fi 147 | 148 | # Handle replace folders 149 | for TARGET in $REPLACE; do 150 | ui_print "- Replace target: $TARGET" 151 | mktouch $MODPATH$TARGET/.replace 152 | done 153 | 154 | if $BOOTMODE; then 155 | # Update info for Magisk Manager 156 | mktouch $NVBASE/modules/$MODID/update 157 | cp -af $MODPATH/module.prop $NVBASE/modules/$MODID/module.prop 158 | fi 159 | 160 | # Copy over custom sepolicy rules 161 | if [ -f $MODPATH/sepolicy.rule -a -e $PERSISTDIR ]; then 162 | ui_print "- Installing custom sepolicy patch" 163 | PERSISTMOD=$PERSISTDIR/magisk/$MODID 164 | mkdir -p $PERSISTMOD 165 | cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule 166 | fi 167 | 168 | # Remove stuffs that don't belong to modules 169 | rm -rf \ 170 | $MODPATH/system/placeholder $MODPATH/customize.sh \ 171 | $MODPATH/README.md $MODPATH/.git* 2>/dev/null 172 | 173 | ############## 174 | # Finalizing 175 | ############## 176 | 177 | cd / 178 | $BOOTMODE || recovery_cleanup 179 | rm -rf $TMPDIR 180 | 181 | ui_print "- Done" 182 | exit 0 183 | -------------------------------------------------------------------------------- /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | getprop = $(shell cat module.prop | grep "^$(1)=" | head -n1 | cut -d'=' -f2) 2 | 3 | MODNAME ?= $(call getprop,id) 4 | MODVER ?= $(call getprop,version) 5 | ZIP = $(MODNAME)-$(MODVER).zip 6 | 7 | all: $(ZIP) 8 | 9 | zip: $(ZIP) 10 | 11 | %.zip: clean 12 | zip -r9 $(ZIP) . -x $(MODNAME)-*.zip .gitignore .gitattributes Makefile /.git* *.DS_Store* *placeholder patch-font-names.sh 13 | 14 | install: $(ZIP) 15 | adb push $(ZIP) /sdcard/ 16 | echo '/sbin/.magisk/busybox/unzip -p "/sdcard/$(ZIP)" META-INF/com/google/android/update-binary | /sbin/.magisk/busybox/sh /proc/self/fd/0 x 1 "/sdcard/$(ZIP)"' | adb shell su -c sh - 17 | 18 | clean: 19 | rm -f *.zip 20 | 21 | .PHONY: all zip %.zip install clean 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Inter Font Pack 2 | 3 | This is a Magisk module that replaces Android's system fonts with: 4 | 5 | - [Inter](https://github.com/rsms/inter) for most text 6 | - [Fira Code](https://github.com/tonsky/FiraCode) for monospace text 7 | - [Source Serif](https://github.com/adobe-fonts/source-serif) for serif text 8 | 9 | Inter was chosen as the UI font for its cleanliness and legibility; it is neutral and looks similar to Apple's San Francisco UI font. Because it was specifically designed for use in GUIs, it is a great replacement for Roboto on Android. 10 | 11 | Source Serif was chosen as the serif font because it is one of the best open-source fonts that complement Inter's style. 12 | 13 | All fonts included in this module are open-source and licensed under the SIL Open Font License. 14 | 15 | ## Compatibility 16 | 17 | Both Roboto and Google Sans have been replaced with Inter for more consistent typography on the stock Pixel ROM. 18 | 19 | To maximize compatibility, all font names have been patched to match the original fonts. This fixes some issues in third-party apps, such Firefox falling back to Fira Sans instead of using the new fonts. 20 | 21 | Additionally, Roboto will be used as a fallback for characters not supported by Inter. This is done by patching Roboto (which is included as a variable font to save space) to create a fallback variant and registering it as a proper fallback rather than modifying the Inter font itself. As a result, most text will be rendered with the original Inter font, and unsupported characters will still be displayed with proper metrics and hinting. 22 | 23 | ## Support 24 | 25 | If you found this module helpful, please consider supporting development with a **[recurring donation](https://patreon.com/kdrag0n)** on Patreon for benefits such as exclusive behind-the-scenes development news, early access to updates, and priority support. Alternatively, you can also [buy me a coffee](https://paypal.me/kdrag0ndonate). All support is appreciated. 26 | -------------------------------------------------------------------------------- /fallback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | RobotoFallback-VF.ttf 4 | 5 | 6 | 7 | 8 | RobotoFallback-VF.ttf 9 | 10 | 11 | 12 | 13 | RobotoFallback-VF.ttf 14 | 15 | 16 | 17 | 18 | RobotoFallback-VF.ttf 19 | 20 | 21 | 22 | 23 | RobotoFallback-VF.ttf 24 | 25 | 26 | 27 | 28 | RobotoFallback-VF.ttf 29 | 30 | 31 | 32 | 33 | RobotoFallback-VF.ttf 34 | 35 | 36 | 37 | 38 | RobotoFallback-VF.ttf 39 | 40 | 41 | 42 | 43 | RobotoFallback-VF.ttf 44 | 45 | 46 | 47 | 48 | RobotoFallback-VF.ttf 49 | 50 | 51 | 52 | 53 | RobotoFallback-VF.ttf 54 | 55 | 56 | 57 | 58 | RobotoFallback-VF.ttf 59 | 60 | 61 | 62 | 63 | RobotoFallback-VF.ttf 64 | 65 | 66 | 67 | 68 | RobotoFallback-VF.ttf 69 | 70 | 71 | 72 | 73 | RobotoFallback-VF.ttf 74 | 75 | 76 | 77 | 78 | RobotoFallback-VF.ttf 79 | 80 | 81 | 82 | 83 | RobotoFallback-VF.ttf 84 | 85 | 86 | 87 | 88 | RobotoFallback-VF.ttf 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=inter-font 2 | name=Inter Font Pack 3 | version=v3.19.1 4 | versionCode=31901 5 | author=kdrag0n 6 | description=Font pack that replaces the system fonts with Inter (sans-serif), Fira Code (monospace), and Source Serif Pro (serif). 7 | support=https://t.me/proton_projects 8 | -------------------------------------------------------------------------------- /patch-font-names.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ttx *.ttf 4 | 5 | function replace_name() { 6 | cur_name=$1 7 | tgt_name=$2 8 | shift 9 | shift 10 | echo "$cur_name -> $tgt_name" 11 | sed -i "s/\(//g' /system/etc/fonts.xml | cat - $MODPATH/fallback.xml > $MODPATH/system/etc/fonts.xml 6 | -------------------------------------------------------------------------------- /system/etc/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/etc/.gitignore -------------------------------------------------------------------------------- /system/fonts/CutiveMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/CutiveMono.ttf -------------------------------------------------------------------------------- /system/fonts/DroidSansMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/DroidSansMono.ttf -------------------------------------------------------------------------------- /system/fonts/NotoSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/NotoSerif-Bold.ttf -------------------------------------------------------------------------------- /system/fonts/NotoSerif-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/NotoSerif-BoldItalic.ttf -------------------------------------------------------------------------------- /system/fonts/NotoSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/NotoSerif-Italic.ttf -------------------------------------------------------------------------------- /system/fonts/NotoSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/NotoSerif-Regular.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-Black.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-BlackItalic.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-BoldItalic.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-Italic.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-LightItalic.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-MediumItalic.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-Thin.ttf -------------------------------------------------------------------------------- /system/fonts/Roboto-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/Roboto-ThinItalic.ttf -------------------------------------------------------------------------------- /system/fonts/RobotoFallback-VF.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/RobotoFallback-VF.ttf -------------------------------------------------------------------------------- /system/fonts/RobotoStatic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/fonts/RobotoStatic-Regular.ttf -------------------------------------------------------------------------------- /system/product/fonts/GoogleSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/product/fonts/GoogleSans-BoldItalic.ttf -------------------------------------------------------------------------------- /system/product/fonts/GoogleSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/product/fonts/GoogleSans-Italic.ttf -------------------------------------------------------------------------------- /system/product/fonts/GoogleSans-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/product/fonts/GoogleSans-Medium.ttf -------------------------------------------------------------------------------- /system/product/fonts/GoogleSans-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/product/fonts/GoogleSans-MediumItalic.ttf -------------------------------------------------------------------------------- /system/product/fonts/GoogleSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kdrag0n/inter-font-pack/d74a915d562e6cf1852546a97e18139a74e48475/system/product/fonts/GoogleSans-Regular.ttf --------------------------------------------------------------------------------