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 16 #ifndef LEPTONICA_BMF_H 17 #define LEPTONICA_BMF_H 18 19 /* 20 * bmf.h 21 * 22 * Simple data structure to hold bitmap fonts and related data 23 */ 24 25 /* Constants for deciding when text block is divided into paragraphs */ 26 enum { 27 SPLIT_ON_LEADING_WHITE = 1, /* tab or space at beginning of line */ 28 SPLIT_ON_BLANK_LINE = 2, /* newline with optional white space */ 29 SPLIT_ON_BOTH = 3 /* leading white space or newline */ 30 }; 31 32 33 struct Bmf 34 { 35 struct Pixa *pixa; /* pixa of bitmaps for 93 characters */ 36 l_int32 size; /* font size (in points at 300 ppi) */ 37 char *directory; /* directory containing font bitmaps */ 38 l_int32 baseline1; /* baseline offset for ascii 33 - 57 */ 39 l_int32 baseline2; /* baseline offset for ascii 58 - 91 */ 40 l_int32 baseline3; /* baseline offset for ascii 93 - 126 */ 41 l_int32 lineheight; /* max height of line of chars */ 42 l_int32 kernwidth; /* pixel dist between char bitmaps */ 43 l_int32 spacewidth; /* pixel dist between word bitmaps */ 44 l_int32 vertlinesep; /* extra vertical space between text lines */ 45 l_int32 *fonttab; /* table mapping ascii --> font index */ 46 l_int32 *baselinetab; /* table mapping ascii --> baseline offset */ 47 l_int32 *widthtab; /* table mapping ascii --> char width */ 48 }; 49 typedef struct Bmf BMF; 50 51 #endif /* LEPTONICA_BMF_H */ 52