possible bug in BDF generation, with correction

Pierre Hanser <[email protected]> Sat, 21 Nov 2015 18:30:41 +0100
Newsgroups gmane.comp.fonts.fontforge.devel
Message-ID <[email protected]>
hello

when generating a BDF from a ttf font, if it's only BW with no grey
level, you cannot save it

that's because in savefont.c, sizes[i] contains exactly the size
(hence depth = 0), where the comparison is made against BDFDepth(bdf)
which is 1

it's enough to add 1 line in savefont.c:WriteBitmaps:

    for ( i=0; sizes[i]!=0; ++i ) {

+        if ((sizes[i]>>16) == 0)sizes[i] = 0x10000 | sizes[i];
+
	for ( bdf=sf->bitmaps; bdf!=NULL &&
		(bdf->pixelsize!=(sizes[i]&0xffff) || BDFDepth(bdf)!=(sizes[i]>>16));
		bdf=bdf->next )


another point that seems strange to me is at the beginning of the same
function:

    for ( i=0; sizes[i]!=0; ++i );
    ff_progress_change_stages(i);

the ';' after the for is suspicious but I've not investigated.

Thanks for a great piece of software

-- 
	Pierre

------------------------------------------------------------------------------
_______________________________________________
fontforge-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
http://fontforge.10959.n7.nabble.com/Developer-f3.html