This commit is contained in:
Irene Ying
2026-01-19 23:02:00 +10:00
committed by GitHub
22 changed files with 33089 additions and 11 deletions

View File

@@ -8,6 +8,15 @@ echo "// The contents of this file are generated by ./lib/EpdFont/scripts/build-
echo "#pragma once"
echo ""
echo "#define BOOKERLY_10_FONT_ID ($(
ruby -rdigest -e 'puts [
"./bookerly_10_regular.h",
"./bookerly_10_bold.h",
"./bookerly_10_bolditalic.h",
"./bookerly_10_italic.h",
].map{|f| Digest::SHA256.hexdigest(File.read(f)).to_i(16) }.sum % (2 ** 32) - (2 ** 31)'
))"
echo "#define BOOKERLY_12_FONT_ID ($(
ruby -rdigest -e 'puts [
"./bookerly_12_regular.h",
@@ -44,6 +53,15 @@ ruby -rdigest -e 'puts [
].map{|f| Digest::SHA256.hexdigest(File.read(f)).to_i(16) }.sum % (2 ** 32) - (2 ** 31)'
))"
echo "#define NOTOSANS_10_FONT_ID ($(
ruby -rdigest -e 'puts [
"./notosans_10_regular.h",
"./notosans_10_bold.h",
"./notosans_10_bolditalic.h",
"./notosans_10_italic.h",
].map{|f| Digest::SHA256.hexdigest(File.read(f)).to_i(16) }.sum % (2 ** 32) - (2 ** 31)'
))"
echo "#define NOTOSANS_12_FONT_ID ($(
ruby -rdigest -e 'puts [
"./notosans_12_regular.h",
@@ -80,6 +98,15 @@ ruby -rdigest -e 'puts [
].map{|f| Digest::SHA256.hexdigest(File.read(f)).to_i(16) }.sum % (2 ** 32) - (2 ** 31)'
))"
echo "#define OPENDYSLEXIC_7_FONT_ID ($(
ruby -rdigest -e 'puts [
"./opendyslexic_7_regular.h",
"./opendyslexic_7_bold.h",
"./opendyslexic_7_bolditalic.h",
"./opendyslexic_7_italic.h",
].map{|f| Digest::SHA256.hexdigest(File.read(f)).to_i(16) }.sum % (2 ** 32) - (2 ** 31)'
))"
echo "#define OPENDYSLEXIC_8_FONT_ID ($(
ruby -rdigest -e 'puts [
"./opendyslexic_8_regular.h",

View File

@@ -5,16 +5,16 @@ set -e
cd "$(dirname "$0")"
READER_FONT_STYLES=("Regular" "Italic" "Bold" "BoldItalic")
BOOKERLY_FONT_SIZES=(12 14 16 18)
NOTOSANS_FONT_SIZES=(12 14 16 18)
OPENDYSLEXIC_FONT_SIZES=(8 10 12 14)
BOOKERLY_FONT_SIZES=(10 12 14 16 18)
NOTOSANS_FONT_SIZES=(10 12 14 16 18)
OPENDYSLEXIC_FONT_SIZES=(7 8 10 12 14)
for size in ${BOOKERLY_FONT_SIZES[@]}; do
for style in ${READER_FONT_STYLES[@]}; do
font_name="bookerly_${size}_$(echo $style | tr '[:upper:]' '[:lower:]')"
font_path="../builtinFonts/source/Bookerly/Bookerly-${style}.ttf"
output_path="../builtinFonts/${font_name}.h"
python fontconvert.py $font_name $size $font_path --2bit > $output_path
python3 fontconvert.py $font_name $size $font_path --2bit > $output_path
echo "Generated $output_path"
done
done
@@ -24,7 +24,7 @@ for size in ${NOTOSANS_FONT_SIZES[@]}; do
font_name="notosans_${size}_$(echo $style | tr '[:upper:]' '[:lower:]')"
font_path="../builtinFonts/source/NotoSans/NotoSans-${style}.ttf"
output_path="../builtinFonts/${font_name}.h"
python fontconvert.py $font_name $size $font_path --2bit > $output_path
python3 fontconvert.py $font_name $size $font_path --2bit > $output_path
echo "Generated $output_path"
done
done
@@ -34,7 +34,7 @@ for size in ${OPENDYSLEXIC_FONT_SIZES[@]}; do
font_name="opendyslexic_${size}_$(echo $style | tr '[:upper:]' '[:lower:]')"
font_path="../builtinFonts/source/OpenDyslexic/OpenDyslexic-${style}.otf"
output_path="../builtinFonts/${font_name}.h"
python fontconvert.py $font_name $size $font_path --2bit > $output_path
python3 fontconvert.py $font_name $size $font_path --2bit > $output_path
echo "Generated $output_path"
done
done
@@ -47,9 +47,9 @@ for size in ${UI_FONT_SIZES[@]}; do
font_name="ubuntu_${size}_$(echo $style | tr '[:upper:]' '[:lower:]')"
font_path="../builtinFonts/source/Ubuntu/Ubuntu-${style}.ttf"
output_path="../builtinFonts/${font_name}.h"
python fontconvert.py $font_name $size $font_path > $output_path
python3 fontconvert.py $font_name $size $font_path > $output_path
echo "Generated $output_path"
done
done
python fontconvert.py notosans_8_regular 8 ../builtinFonts/source/NotoSans/NotoSans-Regular.ttf > ../builtinFonts/notosans_8_regular.h
python3 fontconvert.py notosans_8_regular 8 ../builtinFonts/source/NotoSans/NotoSans-Regular.ttf > ../builtinFonts/notosans_8_regular.h