src/bmf.c
l_int32
pixaSaveFont(const char  *indir,
             const char  *outdir,
             l_int32      size)
{
char    *pathname;
l_int32  bl1, bl2, bl3;
PIXA    *pixa;

    PROCNAME("pixaSaveFont");

    if (size < 4 || size > 20 || (size % 2))
        return ERROR_INT("size must be in {4, 6, ..., 20}", procName, 1);

    if ((pixa = pixaGenerateFont(indir, size, &bl1, &bl2, &bl3)) == NULL)
        return ERROR_INT("pixa not made", procName, 1);
    pathname = genPathname(outdir, outputfonts[(size - 4) / 2]);
    pixaWrite(pathname, pixa);

#if  DEBUG_FONT_GEN
    fprintf(stderr, "Found %d chars in font size %d\n",
            pixaGetCount(pixa), size);
    fprintf(stderr, "Baselines are at: %d, %d, %d\n", bl1, bl2, bl3);
#endif  /* DEBUG_FONT_GEN */

    FREE(pathname);
    pixaDestroy(&pixa);
    return 0;
}
/*!
 *  pixaSaveFont()
 *
 *      Input:  indir (directory holding image of character set)
 *              outdir (directory into which the output pixa file
 *                      will be written)
 *              size (in pts, at 300 ppi)
 *      Return: 0 if OK, 1 on error
 *
 *  Notes:
 *      (1) This saves a font of a particular size.
 *      (2) prog/genfonts calls this function for each of the
 *          nine font sizes, to generate all the font pixa files.
 */
pixaSaveFont()
Input:  indir (directory holding image of character set)
outdir (directory into which the output pixa file
will be written)
size (in pts, at 300 ppi)
Return: 0 if OK, 1 on error

(1) This saves a font of a particular size.
(2) prog/genfonts calls this function for each of the
nine font sizes, to generate all the font pixa files.
pixaSaveFont () Input : indir ( directory holding image of character set ) outdir ( directory into which the output pixa file will be written ) size ( in pts at 300 ppi ) Return : 0 if OK 1 on error ( 1 ) This saves a font of a particular size . ( 2 ) prog / genfonts calls this function for each of the nine font sizes to generate all the font pixa files .
l_int32
pixaSaveFont(const char  *indir,
             const char  *outdir,
             l_int32      size)
{
char    *pathname;
l_int32  bl1, bl2, bl3;
PIXA    *pixa;
    PROCNAME("pixaSaveFont");
    if (size < 4 || size > 20 || (size % 2))
        return ERROR_INT("size must be in {4, 6, ..., 20}", procName, 1);
    if ((pixa = pixaGenerateFont(indir, size, &bl1, &bl2, &bl3)) == NULL)
        return ERROR_INT("pixa not made", procName, 1);
    pathname = genPathname(outdir, outputfonts[(size - 4) / 2]);
    pixaWrite(pathname, pixa);
#if  DEBUG_FONT_GEN
    fprintf(stderr, "Found %d chars in font size %d\n",
            pixaGetCount(pixa), size);
    fprintf(stderr, "Baselines are at: %d, %d, %d\n", bl1, bl2, bl3);
#endif  
    FREE(pathname);
    pixaDestroy(&pixa);
    return 0;
}
l_int32 pixaSaveFont ( const char * indir , const char * outdir , l_int32 size ) { char * pathname ; l_int32 bl1 , bl2 , bl3 ; PIXA * pixa ; PROCNAME ( " " ) ; if ( size < 4 || size > 20 || ( size % 2 ) ) return ERROR_INT ( " " , procName , 1 ) ; if ( ( pixa = pixaGenerateFont ( indir , size , & bl1 , & bl2 , & bl3 ) ) == NULL ) return ERROR_INT ( " " , procName , 1 ) ; pathname = genPathname ( outdir , outputfonts [ ( size - 4 ) / 2 ] ) ; pixaWrite ( pathname , pixa ) ; #if DEBUG_FONT_GEN fprintf ( stderr , " \n " , pixaGetCount ( pixa ) , size ) ; fprintf ( stderr , " \n " , bl1 , bl2 , bl3 ) ; #endif FREE ( pathname ) ; pixaDestroy ( & pixa ) ; return 0 ; }
pixaSaveFont()
      Input:  indir (directory holding image of character set)
              outdir (directory into which the output pixa file
                      will be written)
              size (in pts, at 300 ppi)
      Return: 0 if OK, 1 on error
pixaSaveFont () Input : indir ( directory holding image of character set ) outdir ( directory into which the output pixa file will be written ) size ( in pts at 300 ppi ) Return : 0 if OK 1 on error
/* DEBUG_FONT_GEN */