mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 14:41:36 +08:00
Merge pull request #355 from amitdo/pango-name-is-empty
Check that pango's suggested font name is not an empty string
This commit is contained in:
commit
5ca73cca26
@ -441,9 +441,11 @@ int main(int argc, char** argv) {
|
||||
if (!FLAGS_find_fonts && !FontUtils::IsAvailableFont(FLAGS_font.c_str())) {
|
||||
string pango_name;
|
||||
if (!FontUtils::IsAvailableFont(FLAGS_font.c_str(), &pango_name)) {
|
||||
tprintf("Could not find font named %s. Pango suggested font %s\n"
|
||||
"Please correct --font arg.\n",
|
||||
FLAGS_font.c_str(), pango_name.c_str());
|
||||
tprintf("Could not find font named %s.", FLAGS_font.c_str());
|
||||
if (!pango_name.empty()) {
|
||||
tprintf("Pango suggested font %s.\n", pango_name.c_str());
|
||||
}
|
||||
tprintf("Please correct --font arg.\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user