/ocr/ocrservice/jni/hydrogen/include/leptonica/bmf.h

http://eyes-free.googlecode.com/ · C++ Header · 51 lines · 25 code · 6 blank · 20 comment · 0 complexity · fa1148e4e56932d0ebc9bed249e09d84 MD5 · raw file

  1. /*====================================================================*
  2. - Copyright (C) 2001 Leptonica. All rights reserved.
  3. - This software is distributed in the hope that it will be
  4. - useful, but with NO WARRANTY OF ANY KIND.
  5. - No author or distributor accepts responsibility to anyone for the
  6. - consequences of using this software, or for whether it serves any
  7. - particular purpose or works at all, unless he or she says so in
  8. - writing. Everyone is granted permission to copy, modify and
  9. - redistribute this source code, for commercial or non-commercial
  10. - purposes, with the following restrictions: (1) the origin of this
  11. - source code must not be misrepresented; (2) modified versions must
  12. - be plainly marked as such; and (3) this notice may not be removed
  13. - or altered from any source or modified source distribution.
  14. *====================================================================*/
  15. #ifndef LEPTONICA_BMF_H
  16. #define LEPTONICA_BMF_H
  17. /*
  18. * bmf.h
  19. *
  20. * Simple data structure to hold bitmap fonts and related data
  21. */
  22. /* Constants for deciding when text block is divided into paragraphs */
  23. enum {
  24. SPLIT_ON_LEADING_WHITE = 1, /* tab or space at beginning of line */
  25. SPLIT_ON_BLANK_LINE = 2, /* newline with optional white space */
  26. SPLIT_ON_BOTH = 3 /* leading white space or newline */
  27. };
  28. struct L_Bmf
  29. {
  30. struct Pixa *pixa; /* pixa of bitmaps for 93 characters */
  31. l_int32 size; /* font size (in points at 300 ppi) */
  32. char *directory; /* directory containing font bitmaps */
  33. l_int32 baseline1; /* baseline offset for ascii 33 - 57 */
  34. l_int32 baseline2; /* baseline offset for ascii 58 - 91 */
  35. l_int32 baseline3; /* baseline offset for ascii 93 - 126 */
  36. l_int32 lineheight; /* max height of line of chars */
  37. l_int32 kernwidth; /* pixel dist between char bitmaps */
  38. l_int32 spacewidth; /* pixel dist between word bitmaps */
  39. l_int32 vertlinesep; /* extra vertical space between text lines */
  40. l_int32 *fonttab; /* table mapping ascii --> font index */
  41. l_int32 *baselinetab; /* table mapping ascii --> baseline offset */
  42. l_int32 *widthtab; /* table mapping ascii --> char width */
  43. };
  44. typedef struct L_Bmf L_BMF;
  45. #endif /* LEPTONICA_BMF_H */