-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
One should build fontconfig before install
- Loading branch information
0 parents
commit 8b1c5cf
Showing
8 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
system/fonts/*.ttf | ||
system/etc/fonts.xml | ||
tool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "fontconfig"] | ||
path = fontconfig | ||
url = https://gitlab.freedesktop.org/fontconfig/fontconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/sbin/sh | ||
|
||
################# | ||
# Initialization | ||
################# | ||
|
||
umask 022 | ||
|
||
# echo before loading util_functions | ||
ui_print() { echo "$1"; } | ||
|
||
require_new_magisk() { | ||
ui_print "*******************************" | ||
ui_print " Please install Magisk v20.4+! " | ||
ui_print "*******************************" | ||
exit 1 | ||
} | ||
|
||
######################### | ||
# Load util_functions.sh | ||
######################### | ||
|
||
OUTFD=$2 | ||
ZIPFILE=$3 | ||
|
||
mount /data 2>/dev/null | ||
|
||
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk | ||
. /data/adb/magisk/util_functions.sh | ||
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk | ||
|
||
install_module | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#MAGISK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#! bash | ||
|
||
pushd fontconfig | ||
rm -rf build | ||
meson build | ||
ninja -C build | ||
cp build/fc-scan/fc-scan build/src/libfontconfig.so* ../tool | ||
echo '<fontconfig></fontconfig>' > tool/fonts.conf | ||
popd | ||
rm -rf system/etc | ||
rm -rf MagiskFonts.zip | ||
7z a MagiskFonts.zip META-INF customize.sh module.prop system tool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#! sh | ||
|
||
if [ -z $MAGISK_VER ]; then | ||
echo "If you see this in the installation process, please cancel it." | ||
ui_print() { echo "$@" 1>&2; } | ||
set_perm_recursive() { return; } | ||
MODPATH=$PWD | ||
fi | ||
|
||
ui_print "Pull original fonts.xml" | ||
mkdir -p $MODPATH/system/etc | ||
head -n -1 $(magisk --path)/.magisk/mirror/system/etc/fonts.xml >$MODPATH/system/etc/fonts.xml | ||
|
||
set_perm_recursive $MODPATH/tool root root 700 700 | ||
|
||
ui_print "Injecting custom fonts" | ||
for fontfile in $(ls $MODPATH/system/fonts); do | ||
fontname=$(FONTCONFIG_PATH=$MODPATH/tool LD_LIBRARY_PATH=$MODPATH/tool $MODPATH/tool/fc-scan -f '%{postscriptname}' $MODPATH/system/fonts/$fontfile) | ||
ui_print "Add custom fonts $fontname" | ||
echo ' <family name="'$fontname'">' >>$MODPATH/system/etc/fonts.xml | ||
echo " <font>$fontfile</font>" >>$MODPATH/system/etc/fonts.xml | ||
echo " </family>" >>$MODPATH/system/etc/fonts.xml | ||
done | ||
|
||
echo "</familyset>" >>$MODPATH/system/etc/fonts.xml | ||
ui_print "New fonts.xml generated" |
Submodule fontconfig
added at
c8f621
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
id=costume_fonts | ||
name=Costume Fonts | ||
version=1.0 | ||
versionCode=1 | ||
author=Jing Matrix | ||
description=Add costume fonts for systemwise usage |