tesseract-box/add-fonts-to-ocr.sh

7 lines
338 B
Bash
Executable File

if [ ! -d $FONTS_DIR ]; then
echo "set FONTS_DIR envvar"; exit 1
fi
LNG_DIR=/vagrant/init/langdata/rus
text2image --find_fonts --fonts_dir $FONTS_DIR \
--text $LNG_DIR/rus.training_text --min_coverage .9 \
--outputbase $LNG_DIR/rus |& grep raw | sed -e 's/ :.*/@ \\/g' | sed -e "s/^/ '/" | sed -e "s/@/'/g" > $LNG_DIR/fontslist.txt