File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 50
50
#include " tlog.h"
51
51
#include " unicharset.h"
52
52
#include " util.h"
53
+ #ifdef _MSC_VER
54
+ # define putenv (s ) _putenv(s)
55
+ #endif
53
56
54
57
// A number with which to initialize the random number generator.
55
58
const int kRandomSeed = 0x18273645 ;
@@ -681,6 +684,18 @@ static int Main() {
681
684
}
682
685
683
686
int main (int argc, char ** argv) {
687
+ // Respect enviroment variable. could be:
688
+ // fc (fontconfig), win32, and coretext
689
+ // If not set force fontconfig for Mac OS.
690
+ // See https://github.com/tesseract-ocr/tesseract/issues/736
691
+ char * backend;
692
+ backend = getenv (" PANGOCAIRO_BACKEND" );
693
+ if (backend == NULL ) {
694
+ putenv (" PANGOCAIRO_BACKEND=fc" );
695
+ } else {
696
+ printf (" Using '%s' as pango cairo backend based on enviroment "
697
+ " variable.\n " , backend);
698
+ }
684
699
tesseract::CheckSharedLibraryVersion ();
685
700
if (argc > 1 ) {
686
701
if ((strcmp (argv[1 ], " -v" ) == 0 ) ||
You can’t perform that action at this time.
0 commit comments