Leptonica 1.68
C Image Processing Library

bmf.h

Go to the documentation of this file.
00001 /*====================================================================*
00002  -  Copyright (C) 2001 Leptonica.  All rights reserved.
00003  -  This software is distributed in the hope that it will be
00004  -  useful, but with NO WARRANTY OF ANY KIND.
00005  -  No author or distributor accepts responsibility to anyone for the
00006  -  consequences of using this software, or for whether it serves any
00007  -  particular purpose or works at all, unless he or she says so in
00008  -  writing.  Everyone is granted permission to copy, modify and
00009  -  redistribute this source code, for commercial or non-commercial
00010  -  purposes, with the following restrictions: (1) the origin of this
00011  -  source code must not be misrepresented; (2) modified versions must
00012  -  be plainly marked as such; and (3) this notice may not be removed
00013  -  or altered from any source or modified source distribution.
00014  *====================================================================*/
00015 
00016 #ifndef  LEPTONICA_BMF_H
00017 #define  LEPTONICA_BMF_H
00018 
00019 /* 
00020  *  bmf.h
00021  *
00022  *     Simple data structure to hold bitmap fonts and related data
00023  */
00024 
00025     /* Constants for deciding when text block is divided into paragraphs */
00026 enum {
00027     SPLIT_ON_LEADING_WHITE = 1,    /* tab or space at beginning of line   */
00028     SPLIT_ON_BLANK_LINE    = 2,    /* newline with optional white space   */
00029     SPLIT_ON_BOTH          = 3     /* leading white space or newline      */
00030 };
00031 
00032 
00033 struct L_Bmf
00034 {
00035     struct Pixa  *pixa;        /* pixa of bitmaps for 93 characters        */
00036     l_int32       size;        /* font size (in points at 300 ppi)         */
00037     char         *directory;   /* directory containing font bitmaps        */
00038     l_int32       baseline1;   /* baseline offset for ascii 33 - 57        */
00039     l_int32       baseline2;   /* baseline offset for ascii 58 - 91        */
00040     l_int32       baseline3;   /* baseline offset for ascii 93 - 126       */
00041     l_int32       lineheight;  /* max height of line of chars              */
00042     l_int32       kernwidth;   /* pixel dist between char bitmaps          */
00043     l_int32       spacewidth;  /* pixel dist between word bitmaps          */
00044     l_int32       vertlinesep; /* extra vertical space between text lines  */
00045     l_int32      *fonttab;     /* table mapping ascii --> font index       */
00046     l_int32      *baselinetab; /* table mapping ascii --> baseline offset  */
00047     l_int32      *widthtab;    /* table mapping ascii --> char width       */
00048 };
00049 typedef struct L_Bmf L_BMF;
00050 
00051 #endif  /* LEPTONICA_BMF_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines