From 8d0f59d09d8fc0d610226d8017b8407c653bcc9f Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 26 Aug 2015 18:14:30 +0100 Subject: [PATCH] tesstrain.sh: Only fall back to default Latin fonts if none were provided The --fontlist argument to tesstrain.sh was always ignored, even if the language had no specific fonts specified in language-specific.sh. Change this behaviour so the --fontlist argument is used if no specifc fonts are selected by language-specific.sh. --- training/language-specific.sh | 2 +- training/tesstrain_utils.sh | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/training/language-specific.sh b/training/language-specific.sh index bc64f67c88..c7be0daf6d 100755 --- a/training/language-specific.sh +++ b/training/language-specific.sh @@ -794,7 +794,7 @@ set_lang_specific_parameters() { local lang=$1 # The default text location is now given directly from the language code. TEXT_CORPUS="${FLAGS_webtext_prefix}/${lang}.corpus.txt" - FONTS=( "${LATIN_FONTS[@]}" ) + test -z "$FONTS" && FONTS=( "${LATIN_FONTS[@]}" ) FILTER_ARGUMENTS="" WORDLIST2DAWG_ARGUMENTS="" # These dawg factors represent the fraction of the corpus not covered by the diff --git a/training/tesstrain_utils.sh b/training/tesstrain_utils.sh index a3ad7f5142..c5768912f7 100755 --- a/training/tesstrain_utils.sh +++ b/training/tesstrain_utils.sh @@ -16,10 +16,6 @@ # # USAGE: source tesstrain_utils.sh -FONTS=( - "Arial" \ - "Times New Roman," \ -) if [ "$(uname)" == "Darwin" ];then FONTS_DIR="/Library/Fonts/" else