[barcode] PNG output patch

Alessandro Rubini rubini@linux.it
Wed Jun 3 15:58:20 CEST 2009


>   Barcode_Config(BARCODE_CONFIG_FONT,"/path/to/my/font.ttf");
>   Barcode_Config(BARCODE_CONFIG_FG_COLOR,0,255,0);
>   Barcode_Config(BARCODE_CONFIG_BG_COLOR,255,255,255);

Yes, but I prefer to have only one more argument after the name,
of type intptr_t (so either integer or pointer).

> Whatever mechanism we choose, I see a potential problem with the
> stand-alone "barcode" front-end.  Since the one-code-per-page case
> (rather frequent, I think) is handled through Barcode_Encode_and_Print,
> there would be no chance to invoke the font-setting function, which in
> turn would cause the PNG backend to fail.  Would it be OK to rewrite
> main.c unrolling Barcode_Encode_and_Print?

Yes. I'd keep Encode_and_Print for postscript output, while using
the config step for png.

> PS the final version of the patch will also include GIF output with very
> little extra code.

Yes, once you have a bitmap format any other format is easy. But I
wouldn't like to have GIF natively. GIF is dead, isn't it?

> JPEG output, too, could come for (almost) free, but would it make sense?

No, I don't think so. One bitmap format is enough. Actually, I've never
done it since you can pass ps though gs, but I agree that gs is quite
heavy a demand in some environments.

/alessandro


More information about the barcode mailing list