tesseract  5.0.0
text2image.cpp File Reference
#include "boxchar.h"
#include "commandlineflags.h"
#include "commontraining.h"
#include "degradeimage.h"
#include "errcode.h"
#include "fileio.h"
#include "helpers.h"
#include "normstrngs.h"
#include "stringrenderer.h"
#include "tlog.h"
#include "unicharset.h"
#include <allheaders.h>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <random>
#include <string>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  tesseract::SpacingProperties
 

Namespaces

 tesseract
 

Functions

int main (int argc, char **argv)
 

Variables

const int kRandomSeed = 0x18273645
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 714 of file text2image.cpp.

714  {
715  // Respect environment variable. could be:
716  // fc (fontconfig), win32, and coretext
717  // If not set force fontconfig for Mac OS.
718  // See https://github.com/tesseract-ocr/tesseract/issues/736
719  char *backend;
720  backend = getenv("PANGOCAIRO_BACKEND");
721  if (backend == nullptr) {
722  static char envstring[] = "PANGOCAIRO_BACKEND=fc";
723  putenv(envstring);
724  } else {
725  printf(
726  "Using '%s' as pango cairo backend based on environment "
727  "variable.\n",
728  backend);
729  }
730  tesseract::CheckSharedLibraryVersion();
731  if (argc > 1) {
732  if ((strcmp(argv[1], "-v") == 0) || (strcmp(argv[1], "--version") == 0)) {
733  FontUtils::PangoFontTypeInfo();
734  printf("Pango version: %s\n", pango_version_string());
735  }
736  }
737  tesseract::ParseCommandLineFlags(argv[0], &argc, &argv, true);
738  return Main();
739 }
void ParseCommandLineFlags(const char *usage, int *argc, char ***argv, const bool remove_flags)

Variable Documentation

◆ kRandomSeed

const int kRandomSeed = 0x18273645

Definition at line 60 of file text2image.cpp.