[g-i] Stripping code in ttf-freefont, do we still need it?
At this moment, ttf-freefont uses some code to strip fonts in the
udeb:
chmod u+x ./convertfonts.sh
./convertfonts.sh
# Strip the fonts for the udeb
chmod u+x ./stripfonts.sh
chmod u+x scripts/FreeSans-strip
chmod u+x scripts/ConvertFont
./stripfonts.sh
Scripts are at the end of this mail....
Eddy, Davide, are these scripts still useful or are they redundant
with font stripping that may be planned in the g-i build system? They
hardcode the kept (or excluded?) ranges which sounds not really
scalable to me.
stripfonts.sh:
#!/bin/sh
STRIPFONT=`pwd`/scripts/FreeSans-strip
SRC="TTF"
TARGET="TTF-stripped"
FONTPAT="FreeSans*.ttf"
test ! -d ${TARGET} && mkdir ${TARGET}
FONTS=`cd ${SRC} && find . -name "${FONTPAT}"`
for font in ${FONTS}; do
echo $font
(cd ${TARGET} && ${STRIPFONT} ../${SRC}/${font} $font)
done
FreeSans-strip:
#! /bin/bash
exepath=$(dirname $0)
strip=$exepath/strip_glyphs.pe
if [ $# -ne 2 ] ; then
echo "Usage: $(basename $0) fontfile_in fontfile_out"
exit 0
fi
if [ ! -x "$strip" ] ; then
echo "Script not found: $strip"
exit 1
fi
if [ ! -f "$1" ] ; then
echo "File does not exist: $1"
exit 1
fi
if [ -z "$2" ] ; then
echo "You need to specify the output file"
exit 1
fi
ranges=""
ranges="$ranges u0400:u052F" # Cyrilic
ranges="$ranges u0530:u058F" # Armenian
ranges="$ranges u0600:u06FF" # Arabic
ranges="$ranges u0700:u077F" # Syriac
#ranges="$ranges u0900:u097F" # Hindi
#ranges="$ranges u0980:u099F" # Bengali
#ranges="$ranges u0A00:u0CFF" # Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada
ranges="$ranges u0D00:u0FFF" # Malayalam, Sinhala, Thai, Lao, Tibetan
ranges="$ranges u2100:u21FF" # Letterlike, Number forms, Arrows
ranges="$ranges u2200:u24FF" # Mathematical, Techical, Control, OCR
ranges="$ranges u2580:u259F" # Block elements
ranges="$ranges u3000:u30FF" # CJK Symbols and Punctuation
if ! echo $1 | grep -q Bold; then
ranges="$ranges 65536:66002" # bn_* stuff ???
fi
$strip $1 $2 $ranges
Reply to: