Skip to content

Commit

Permalink
Add a mechanism to avoid creating debug fonts.
Browse files Browse the repository at this point in the history
If TESSERACT_DISABLE_DEBUG_FONTS is defined, tesseract doesn't
atetmpt to create any debug fonts. This not only saves memory,
but it (combined with the change to optionally use Pix as
internal storage for the ImageData) allows us to use an
embedded Leptonica library with no format handlers at all.
  • Loading branch information
robinwatts committed May 4, 2020
1 parent cdebe13 commit 80d4af6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ccstruct/debugpixa.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ class DebugPixa {
// TODO(rays) add another constructor with size control.
DebugPixa() {
pixa_ = pixaCreate(0);
#ifdef TESSERACT_DISABLE_DEBUG_FONTS
fonts_ = NULL;
#else
fonts_ = bmfCreate(nullptr, 14);
#endif
}
// If the filename_ has been set and there are any debug images, they are
// written to the set filename_.
Expand Down

0 comments on commit 80d4af6

Please sign in to comment.