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

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 719 of file text2image.cpp.

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

Variable Documentation

◆ kRandomSeed

const int kRandomSeed = 0x18273645

Definition at line 56 of file text2image.cpp.

tesseract::ParseCommandLineFlags
void ParseCommandLineFlags(const char *usage, int *argc, char ***argv, const bool remove_flags)
Definition: commandlineflags.cpp:166