In Tesseract's coordinate system, width is just right - left, cf. slide #2 of
github.com/tesseract-ocr/docs/blob/master/das_tutorial2016/2ArchitectureAndDataStructures.pdf
Commit 65504c8cd2 misplaced the #endif.
The definition of _GNU_SOURCE is only needed for Cygwin.
Defining _GNU_SOURCE on Linux results in compiler warnings because this
macro is already defined by the compiler.
Fix this by moving the #endif to the right place. In addition the code
for Cygwin is made more robust: If a future Cygwin compiler defines
_GNU_SOURCE, too, the code will still work.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
On msys2 pango seems to always returns empty string for the suggested
font. It's a good idea to check that the string is not empty before
printing it - on all platforms.
This is not strictly necessary, but recommended in the GNU autoconf manual.
No [] was added to arguments like true or false.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
The different checks had set ENABLE_TRAINING unconditionally,
thus overwriting the value from the preceding checks.
So if pango and cairo were available, but icu was missing,
users would still be offered to build the training tools.
The changes for icu and has_cpp11 are not strictly necessary,
but are made here to have uniform code patterns.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
It is common practice for command line programs to print
user requested information on stdout.
This seems to be reasonable for Tesseract, too.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
It is common practice for command line programs to show help text
on stdout. This seems to be reasonable for Tesseract, too.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
As pointed out by Stefan Weil, conditionally defining off_t using a
macro isn't a valid approach. off_t does not have a fixed size and is
used in ABI definitions (e.g. syscalls), so silently guessing its size
risks breaking the build. Additionally, all sane and modern platforms
will have off_t.
Pango's opentype feature selection functions are only available
from version 1.38+, which is still quite new, so ensure it's just
ignored if using an older version.
This enables all OpenType ligatures for a specific font, where
available. Specifically, it explicitly enables the OpenType
features liga (standard ligatures), hlig (historical ligatures),
clig (contextual ligatures), and dlig (discretionary ligatures).
This feature requires Pango 1.38 or newer.