diff --git a/backend/font.h b/backend/font.h index 021eface..2ae76c3a 100644 --- a/backend/font.h +++ b/backend/font.h @@ -2,7 +2,7 @@ /* libzint - the open source barcode library - Copyright (C) 2008-2017 Robin Stuart + Copyright (C) 2008 - 2020 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -29,8 +29,14 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* vim: set ts=4 sw=4 et : */ -static const char ascii_font[] = { +typedef const unsigned short font_item; + +#define NORMAL_FONT_WIDTH 7 +#define NORMAL_FONT_HEIGHT 14 + +static font_item ascii_font[] = { /* Each character is 7 x 14 pixels */ 0, 0, 8, 8, 8, 8, 8, 8, 8, 0, 8, 8, 0, 0, /* ! */ 0, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* " */ @@ -224,7 +230,10 @@ static const char ascii_font[] = { 0, 0, 0, 36, 0, 66, 66, 34, 36, 20, 28, 8, 72, 48, /* ÿ */ }; -static const char small_font[] = { +#define SMALL_FONT_WIDTH 5 +#define SMALL_FONT_HEIGHT 9 + +static font_item small_font[] = { /* Each character is 5 x 9 pixels */ 0, 2, 2, 2, 2, 0, 2, 0, 0, /* ! */ 0, 5, 5, 5, 0, 0, 0, 0, 0, /* " */ @@ -417,3 +426,61 @@ static const char small_font[] = { 0, 0, 8, 14, 9, 9, 14, 8, 0, /* þ */ 0, 5, 0, 9, 9, 5, 2, 4, 0, /* ÿ */ }; + +/* Adapted from OCR-B font version 0.2 Matthew Skala + * https://tsukurimashou.osdn.jp/ocr.php.en + * + * Copyright Matthew Skala (2011); based on code by Norbert Schwarz (1986, 2011) + * + * "The version in this package descends from a set of Metafont + * definitions by Norbert Schwarz of Ruhr-Universitaet Bochum, + * bearing dates ranging from 1986 to 2010. He originally + * distributed it under a "non-commercial use only" + * restriction but has since released it for unrestricted use + * and distribution. See the README file for more details." + * + * The README states (http://mirrors.ctan.org/fonts/ocr-b.zip) + * + * "As far as the digitization in METAFONT input which I have + * developed, you may freely use, modify, and/or distribute any of + * these files or the resulting fonts, without limitation. A previous + * release of ocr-b only granted rights for non-commercial use; that + * restriction is now lifted." + * + * Used OCRB.otf with FontForge to create OCRB-18.bdf (normal) and OCRB-16.bdf (small) and then touched up using gbdfed + * Note there's no bold version of OCR-B. + */ + +#define UPCEAN_FONT_WIDTH 9 +#define UPCEAN_FONT_HEIGHT 14 + +/* Each character is 9 x 14 pixels */ +static font_item upcean_font[] = { + /*30*/ 0x007C, 0x00FE, 0x00C6, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x00C6, 0x00FE, 0x007C, /* 0 */ + /*31*/ 0x000C, 0x001C, 0x003C, 0x006C, 0x004C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, /* 1 */ + /*32*/ 0x007C, 0x00FE, 0x0183, 0x0003, 0x0007, 0x000E, 0x001C, 0x0038, 0x0070, 0x00E0, 0x01C0, 0x0180, 0x01FE, 0x00FF, /* 2 */ + /*33*/ 0x01FE, 0x01FE, 0x0006, 0x000C, 0x0018, 0x0038, 0x003C, 0x0006, 0x0003, 0x0003, 0x0003, 0x0006, 0x01FE, 0x00F8, /* 3 */ + /*34*/ 0x0018, 0x0018, 0x0030, 0x0030, 0x0060, 0x0060, 0x00C4, 0x00CC, 0x018C, 0x01FF, 0x01FF, 0x000C, 0x000C, 0x000C, /* 4 */ + /*35*/ 0x00FE, 0x00FE, 0x00C0, 0x00C0, 0x00C0, 0x00F8, 0x00FC, 0x0006, 0x0006, 0x0006, 0x0006, 0x000C, 0x01FC, 0x00F8, /* 5 */ + /*36*/ 0x000C, 0x001C, 0x0038, 0x0030, 0x0060, 0x00F8, 0x00FE, 0x01C7, 0x0183, 0x0183, 0x0183, 0x01C3, 0x00FE, 0x007C, /* 6 */ + /*37*/ 0x01FF, 0x01FF, 0x0003, 0x0006, 0x000E, 0x000C, 0x0018, 0x0030, 0x0030, 0x0030, 0x0060, 0x0060, 0x0060, 0x0060, /* 7 */ + /*38*/ 0x007C, 0x00FE, 0x00C6, 0x0082, 0x00C6, 0x007C, 0x007C, 0x00EE, 0x01C7, 0x0183, 0x0183, 0x0183, 0x00FE, 0x007C, /* 8 */ + /*39*/ 0x007C, 0x00FE, 0x00C7, 0x0183, 0x0183, 0x0183, 0x01C3, 0x00FE, 0x007E, 0x000C, 0x000C, 0x0018, 0x0030, 0x0060, /* 9 */ +}; + +#define UPCEAN_SMALL_FONT_WIDTH 8 +#define UPCEAN_SMALL_FONT_HEIGHT 13 + +/* Each character is 8 x 13 pixels */ +static font_item upcean_small_font[] = { + /*30*/ 0x3C, 0x7E, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x66, 0x7E, 0x3C, /* 0 */ + /*31*/ 0x00, 0x0E, 0x1E, 0x36, 0x26, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, /* 1 */ + /*32*/ 0x38, 0x7C, 0xC6, 0x02, 0x02, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0xFC, 0x7E, /* 2 */ + /*33*/ 0x00, 0xFE, 0xFE, 0x06, 0x1C, 0x38, 0x3E, 0x07, 0x03, 0x03, 0x06, 0xFC, 0x78, /* 3 */ + /*34*/ 0x00, 0x18, 0x18, 0x30, 0x30, 0x60, 0x64, 0xCC, 0xCC, 0xFF, 0xFF, 0x0C, 0x0C, /* 4 */ + /*35*/ 0x00, 0x7E, 0x7E, 0x40, 0x40, 0x78, 0x7C, 0x06, 0x02, 0x02, 0x06, 0xFC, 0x78, /* 5 */ + /*36*/ 0x00, 0x0C, 0x1C, 0x30, 0x30, 0x7C, 0xFE, 0xC7, 0xC3, 0xC3, 0xC3, 0x7E, 0x3C, /* 6 */ + /*37*/ 0x00, 0xFF, 0xFF, 0x03, 0x06, 0x0C, 0x18, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, /* 7 */ + /*38*/ 0x3C, 0x7E, 0x66, 0x42, 0x66, 0x3C, 0x3C, 0x66, 0xC3, 0xC3, 0xC3, 0x7E, 0x3C, /* 8 */ + /*39*/ 0x3C, 0x7E, 0xE7, 0xC3, 0xC3, 0xC3, 0xE3, 0x7E, 0x1E, 0x0C, 0x18, 0x30, 0x60, /* 9 */ +}; diff --git a/backend/fonts/OCRB-16.bdf b/backend/fonts/OCRB-16.bdf new file mode 100644 index 00000000..1f2568fc --- /dev/null +++ b/backend/fonts/OCRB-16.bdf @@ -0,0 +1,2442 @@ +STARTFONT 2.1 +COMMENT "Generated by fontforge, http://fontforge.sourceforge.net" +COMMENT "Matthew Skala (2011); based on code by Norbert Schwarz (1986, 2011)" +FONT -FontForge-OCRB-Regular-R-Normal--16-150-75-75-M-120-ISO10646-1 +SIZE 15 75 75 +FONTBOUNDINGBOX 13 21 -1 -6 +STARTPROPERTIES 41 +FOUNDRY "FontForge" +FAMILY_NAME "OCRB" +WEIGHT_NAME "Regular" +SLANT "R" +SETWIDTH_NAME "Normal" +ADD_STYLE_NAME "" +PIXEL_SIZE 16 +POINT_SIZE 150 +RESOLUTION_X 75 +RESOLUTION_Y 75 +SPACING "M" +AVERAGE_WIDTH 120 +CHARSET_REGISTRY "ISO10646" +CHARSET_ENCODING "1" +FONTNAME_REGISTRY "" +CHARSET_COLLECTIONS "ISO10646-1" +FONT_NAME "OCRB" +FACE_NAME "OCR B Regular" +COPYRIGHT "Matthew Skala (2011); based on code by Norbert Schwarz (1986, 2011)" +FONT_VERSION "2" +FONT_ASCENT 13 +FONT_DESCENT 3 +UNDERLINE_POSITION 0 +UNDERLINE_THICKNESS 0 +X_HEIGHT 8 +CAP_HEIGHT 10 +RAW_ASCENT 800 +RAW_DESCENT 200 +NORM_SPACE 12 +RELATIVE_WEIGHT 40 +RELATIVE_SETWIDTH 50 +SUPERSCRIPT_X 0 +SUPERSCRIPT_Y 7 +SUPERSCRIPT_SIZE 11 +SUBSCRIPT_X 0 +SUBSCRIPT_Y 2 +SUBSCRIPT_SIZE 11 +FIGURE_WIDTH 12 +AVG_LOWERCASE_WIDTH 120 +AVG_UPPERCASE_WIDTH "120" +_GBDFED_INFO "Edited with gbdfed 1.6." +ENDPROPERTIES +CHARS 139 +STARTCHAR .notdef +ENCODING -1 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 0 0 0 0 +BITMAP +ENDCHAR +STARTCHAR quotesingle.alt +ENCODING -1 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 2 3 5 8 +BITMAP +C0 +C0 +C0 +ENDCHAR +STARTCHAR grave.alt +ENCODING -1 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 3 3 4 8 +BITMAP +C0 +C0 +60 +ENDCHAR +STARTCHAR quotedbl.alt +ENCODING -1 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 4 3 4 9 +BITMAP +90 +B0 +90 +ENDCHAR +STARTCHAR bar.alt +ENCODING -1 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 2 13 0 -2 +BITMAP +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +ENDCHAR +STARTCHAR space +ENCODING 32 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 0 0 0 0 +BITMAP +ENDCHAR +STARTCHAR exclam +ENCODING 33 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 2 13 5 -1 +BITMAP +C0 +C0 +C0 +C0 +C0 +C0 +C0 +00 +00 +00 +00 +C0 +C0 +ENDCHAR +STARTCHAR quotedbl +ENCODING 34 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 5 3 7 +BITMAP +CC +CC +8C +8C +8C +ENDCHAR +STARTCHAR numbersign +ENCODING 35 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +33 +32 +32 +FF +7E +66 +64 +FE +FE +CC +C8 +C8 +ENDCHAR +STARTCHAR dollar +ENCODING 36 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +38 +FE +DA +D8 +F8 +7C +1E +1B +1B +DB +FE +38 +ENDCHAR +STARTCHAR percent +ENCODING 37 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 0 +BITMAP +60 +F3 +B6 +F6 +6C +08 +18 +30 +34 +6E +6B +CF +8E +ENDCHAR +STARTCHAR ampersand +ENCODING 38 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 0 +BITMAP +10 +7C +C4 +C4 +CC +78 +70 +F3 +DB +8F +CE +FE +7E +ENDCHAR +STARTCHAR quotesingle +ENCODING 39 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 3 6 4 6 +BITMAP +E0 +E0 +60 +60 +60 +60 +ENDCHAR +STARTCHAR parenleft +ENCODING 40 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 5 12 4 0 +BITMAP +18 +30 +60 +40 +C0 +C0 +C0 +C0 +C0 +60 +70 +38 +ENDCHAR +STARTCHAR parenright +ENCODING 41 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 5 13 3 -1 +BITMAP +C0 +E0 +60 +30 +10 +10 +18 +10 +10 +30 +60 +C0 +80 +ENDCHAR +STARTCHAR asterisk +ENCODING 42 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 8 2 2 +BITMAP +18 +18 +DB +FF +3C +3C +66 +40 +ENDCHAR +STARTCHAR plus +ENCODING 43 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 9 2 2 +BITMAP +10 +18 +18 +18 +FF +FE +18 +18 +18 +ENDCHAR +STARTCHAR comma +ENCODING 44 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 6 3 -3 +BITMAP +3C +3C +78 +F0 +E0 +C0 +ENDCHAR +STARTCHAR hyphen +ENCODING 45 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 2 2 5 +BITMAP +FF +FF +ENDCHAR +STARTCHAR period +ENCODING 46 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 4 3 4 0 +BITMAP +F0 +F0 +F0 +ENDCHAR +STARTCHAR slash +ENCODING 47 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 13 3 -1 +BITMAP +0C +0C +18 +18 +10 +30 +30 +60 +60 +40 +C0 +C0 +80 +ENDCHAR +STARTCHAR zero +ENCODING 48 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 0 +BITMAP +3C +7E +66 +C3 +C3 +C3 +C3 +C3 +C3 +C3 +66 +7E +3C +ENDCHAR +STARTCHAR one +ENCODING 49 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 5 12 3 0 +BITMAP +38 +78 +D8 +98 +18 +18 +18 +18 +18 +18 +18 +18 +ENDCHAR +STARTCHAR two +ENCODING 50 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 13 2 0 +BITMAP +38 +7C +C6 +02 +02 +06 +0C +18 +30 +60 +C0 +FC +7E +ENDCHAR +STARTCHAR three +ENCODING 51 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +FE +FE +06 +1C +38 +3E +07 +03 +03 +06 +FC +78 +ENDCHAR +STARTCHAR four +ENCODING 52 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +18 +18 +30 +30 +60 +64 +CC +CC +FF +FF +0C +0C +ENDCHAR +STARTCHAR five +ENCODING 53 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 12 2 0 +BITMAP +7E +7E +40 +40 +78 +7C +06 +02 +02 +06 +FC +78 +ENDCHAR +STARTCHAR six +ENCODING 54 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +0C +1C +30 +30 +7C +FE +C7 +C3 +C3 +C3 +7E +3C +ENDCHAR +STARTCHAR seven +ENCODING 55 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +FF +FF +03 +06 +0C +18 +18 +30 +30 +30 +30 +30 +ENDCHAR +STARTCHAR eight +ENCODING 56 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 0 +BITMAP +3C +7E +66 +42 +66 +3C +3C +66 +C3 +C3 +C3 +7E +3C +ENDCHAR +STARTCHAR nine +ENCODING 57 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 0 +BITMAP +3C +7E +E7 +C3 +C3 +C3 +E3 +7E +1E +0C +18 +30 +60 +ENDCHAR +STARTCHAR colon +ENCODING 58 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 3 9 4 0 +BITMAP +E0 +E0 +E0 +00 +00 +00 +E0 +E0 +E0 +ENDCHAR +STARTCHAR semicolon +ENCODING 59 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 5 12 3 -3 +BITMAP +38 +78 +38 +00 +00 +00 +78 +70 +F0 +E0 +C0 +80 +ENDCHAR +STARTCHAR less +ENCODING 60 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 10 2 1 +BITMAP +03 +0E +1C +70 +E0 +E0 +30 +1C +06 +03 +ENDCHAR +STARTCHAR equal +ENCODING 61 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 6 2 3 +BITMAP +FE +FF +00 +00 +FF +FE +ENDCHAR +STARTCHAR greater +ENCODING 62 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 10 2 1 +BITMAP +C0 +E0 +38 +1C +07 +07 +1C +38 +E0 +C0 +ENDCHAR +STARTCHAR question +ENCODING 63 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 13 2 -1 +BITMAP +10 +7C +C6 +C6 +06 +0C +18 +18 +00 +00 +00 +18 +18 +ENDCHAR +STARTCHAR at +ENCODING 64 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 -1 +BITMAP +18 +7C +C6 +82 +03 +63 +FB +DB +9B +9B +DB +FE +64 +ENDCHAR +STARTCHAR A +ENCODING 65 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 11 2 0 +BITMAP +18 +38 +3C +2C +64 +64 +7E +7E +C2 +C2 +C3 +ENDCHAR +STARTCHAR B +ENCODING 66 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 11 2 0 +BITMAP +FC +FE +82 +83 +FE +FE +83 +83 +83 +FE +FC +ENDCHAR +STARTCHAR C +ENCODING 67 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 12 3 0 +BITMAP +10 +7C +CC +C4 +80 +80 +80 +80 +80 +C4 +FC +78 +ENDCHAR +STARTCHAR D +ENCODING 68 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 11 3 0 +BITMAP +E0 +F0 +98 +8C +84 +84 +84 +8C +8C +F8 +E0 +ENDCHAR +STARTCHAR E +ENCODING 69 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 11 3 0 +BITMAP +FE +FC +80 +80 +F8 +FC +80 +80 +80 +FC +FE +ENDCHAR +STARTCHAR F +ENCODING 70 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 11 3 0 +BITMAP +FC +FC +C0 +C0 +F8 +FC +C0 +C0 +C0 +C0 +C0 +ENDCHAR +STARTCHAR G +ENCODING 71 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +18 +7E +62 +C0 +C0 +C0 +DE +CF +C3 +C3 +7F +3E +ENDCHAR +STARTCHAR H +ENCODING 72 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 11 2 0 +BITMAP +C2 +C2 +C2 +C2 +FE +FE +C2 +C2 +C2 +C2 +C2 +ENDCHAR +STARTCHAR I +ENCODING 73 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 11 3 0 +BITMAP +FC +F8 +30 +30 +30 +30 +30 +30 +30 +F8 +FC +ENDCHAR +STARTCHAR J +ENCODING 74 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 11 2 0 +BITMAP +0C +0C +0C +0C +0C +0C +0C +CC +CC +FC +78 +ENDCHAR +STARTCHAR K +ENCODING 75 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 -1 +BITMAP +C2 +C6 +CC +D8 +F0 +E0 +F0 +D8 +CC +C6 +C3 +80 +ENDCHAR +STARTCHAR L +ENCODING 76 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 11 2 0 +BITMAP +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +FE +FF +ENDCHAR +STARTCHAR M +ENCODING 77 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 -1 +BITMAP +E7 +E7 +AF +AF +BB +BB +9B +9B +83 +83 +83 +80 +ENDCHAR +STARTCHAR N +ENCODING 78 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 -1 +BITMAP +C3 +E3 +E3 +F3 +F3 +DB +DB +CF +CF +C7 +C7 +82 +ENDCHAR +STARTCHAR O +ENCODING 79 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +18 +7C +66 +C2 +C3 +83 +83 +C3 +C2 +46 +7C +38 +ENDCHAR +STARTCHAR P +ENCODING 80 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 11 2 0 +BITMAP +FC +FE +C3 +C3 +C3 +FE +F8 +C0 +C0 +C0 +C0 +ENDCHAR +STARTCHAR Q +ENCODING 81 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +10 +7C +C6 +C6 +C2 +82 +92 +DA +CE +CE +7E +13 +ENDCHAR +STARTCHAR R +ENCODING 82 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 11 2 0 +BITMAP +FC +FE +C2 +C2 +C6 +FC +F8 +CC +C4 +C6 +C2 +ENDCHAR +STARTCHAR S +ENCODING 83 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 12 2 0 +BITMAP +18 +7E +46 +C2 +60 +78 +1C +06 +02 +C6 +7E +3C +ENDCHAR +STARTCHAR T +ENCODING 84 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 11 2 0 +BITMAP +FF +FE +18 +18 +18 +18 +18 +18 +18 +18 +18 +ENDCHAR +STARTCHAR U +ENCODING 85 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 11 2 0 +BITMAP +C3 +C3 +C3 +C3 +C3 +C3 +C3 +C3 +C2 +7E +3C +ENDCHAR +STARTCHAR V +ENCODING 86 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 -1 +BITMAP +83 +C3 +C2 +C6 +46 +66 +64 +2C +2C +3C +38 +18 +ENDCHAR +STARTCHAR W +ENCODING 87 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 -1 +BITMAP +83 +83 +83 +C3 +D3 +DB +FA +FA +FE +6E +66 +40 +ENDCHAR +STARTCHAR X +ENCODING 88 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 12 2 -1 +BITMAP +C2 +C6 +66 +2C +38 +18 +38 +3C +64 +66 +C2 +02 +ENDCHAR +STARTCHAR Y +ENCODING 89 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 12 2 -1 +BITMAP +C2 +C6 +66 +6C +3C +18 +18 +18 +18 +18 +18 +10 +ENDCHAR +STARTCHAR Z +ENCODING 90 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 11 2 0 +BITMAP +FE +7E +0C +08 +18 +10 +30 +20 +60 +7E +FE +ENDCHAR +STARTCHAR bracketleft +ENCODING 91 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 13 3 0 +BITMAP +7C +FC +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +FC +FC +ENDCHAR +STARTCHAR backslash +ENCODING 92 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 12 3 0 +BITMAP +80 +C0 +C0 +60 +60 +20 +30 +30 +18 +18 +08 +0C +ENDCHAR +STARTCHAR bracketright +ENCODING 93 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 13 2 0 +BITMAP +7C +FC +04 +04 +04 +04 +04 +04 +04 +04 +04 +7C +FC +ENDCHAR +STARTCHAR underscore +ENCODING 95 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 2 2 -4 +BITMAP +FF +FF +ENDCHAR +STARTCHAR grave +ENCODING 96 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 3 3 4 9 +BITMAP +C0 +C0 +60 +ENDCHAR +STARTCHAR a +ENCODING 97 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 9 2 0 +BITMAP +18 +7C +46 +0E +7E +C2 +C6 +FE +7A +ENDCHAR +STARTCHAR b +ENCODING 98 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +C0 +C0 +C0 +D8 +FE +E6 +C3 +C3 +C3 +C2 +FE +FC +ENDCHAR +STARTCHAR c +ENCODING 99 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 9 3 0 +BITMAP +30 +7C +CC +80 +80 +80 +C4 +FC +78 +ENDCHAR +STARTCHAR d +ENCODING 100 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +03 +03 +03 +13 +7F +C7 +C3 +83 +83 +C3 +7F +3F +ENDCHAR +STARTCHAR e +ENCODING 101 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 9 2 0 +BITMAP +18 +7E +C6 +FF +FF +C0 +C0 +7E +3C +ENDCHAR +STARTCHAR f +ENCODING 102 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 13 2 0 +BITMAP +06 +0E +18 +18 +7E +FE +18 +18 +18 +18 +18 +18 +18 +ENDCHAR +STARTCHAR g +ENCODING 103 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 12 2 -3 +BITMAP +12 +7E +C6 +C2 +82 +C2 +C6 +7E +32 +42 +FE +7C +ENDCHAR +STARTCHAR h +ENCODING 104 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 12 2 0 +BITMAP +40 +C0 +C0 +C8 +FE +E6 +C6 +C2 +C2 +C2 +C2 +C2 +ENDCHAR +STARTCHAR i +ENCODING 105 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 4 12 3 0 +BITMAP +30 +30 +00 +F0 +F0 +10 +10 +10 +10 +10 +10 +10 +ENDCHAR +STARTCHAR j +ENCODING 106 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 4 15 3 -3 +BITMAP +30 +30 +00 +70 +F0 +10 +10 +10 +10 +10 +10 +10 +10 +F0 +E0 +ENDCHAR +STARTCHAR k +ENCODING 107 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 12 3 0 +BITMAP +80 +80 +80 +8C +9C +B0 +E0 +E0 +B0 +98 +8C +84 +ENDCHAR +STARTCHAR l +ENCODING 108 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 5 12 4 0 +BITMAP +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +F0 +78 +ENDCHAR +STARTCHAR m +ENCODING 109 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 9 2 0 +BITMAP +A4 +FF +DB +9B +9B +9B +9B +9B +9B +ENDCHAR +STARTCHAR n +ENCODING 110 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 9 2 0 +BITMAP +18 +FE +E2 +C3 +C3 +C3 +C3 +C3 +C3 +ENDCHAR +STARTCHAR o +ENCODING 111 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 9 2 0 +BITMAP +18 +7E +C6 +C3 +83 +83 +C2 +7E +3C +ENDCHAR +STARTCHAR p +ENCODING 112 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 -3 +BITMAP +18 +FE +E6 +C3 +C3 +C3 +C3 +FE +FC +C0 +C0 +80 +ENDCHAR +STARTCHAR q +ENCODING 113 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 -3 +BITMAP +18 +7F +C7 +C3 +83 +83 +C7 +7F +3F +03 +03 +03 +ENDCHAR +STARTCHAR r +ENCODING 114 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 9 3 0 +BITMAP +18 +FC +E6 +C0 +C0 +C0 +C0 +C0 +C0 +ENDCHAR +STARTCHAR s +ENCODING 115 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 9 2 0 +BITMAP +18 +7E +46 +60 +7C +0E +02 +FE +7C +ENDCHAR +STARTCHAR t +ENCODING 116 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 11 2 0 +BITMAP +30 +30 +FC +FE +30 +30 +30 +30 +30 +3E +1E +ENDCHAR +STARTCHAR u +ENCODING 117 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 9 2 0 +BITMAP +C3 +C3 +C3 +C3 +C3 +C3 +C7 +7F +7A +ENDCHAR +STARTCHAR v +ENCODING 118 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 9 2 0 +BITMAP +83 +C3 +C2 +46 +64 +6C +3C +38 +18 +ENDCHAR +STARTCHAR w +ENCODING 119 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 9 2 0 +BITMAP +83 +C3 +C3 +DA +FA +FA +7E +6E +66 +ENDCHAR +STARTCHAR x +ENCODING 120 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 9 3 0 +BITMAP +84 +CC +58 +70 +30 +78 +D8 +8C +84 +ENDCHAR +STARTCHAR y +ENCODING 121 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 -3 +BITMAP +83 +C3 +46 +66 +3C +38 +18 +10 +30 +20 +E0 +C0 +ENDCHAR +STARTCHAR z +ENCODING 122 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 9 2 0 +BITMAP +7E +7E +06 +0C +18 +30 +60 +FE +FE +ENDCHAR +STARTCHAR braceleft +ENCODING 123 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 0 +BITMAP +06 +1F +10 +10 +10 +30 +F0 +F0 +30 +10 +10 +1E +0F +ENDCHAR +STARTCHAR bar +ENCODING 124 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 2 15 5 -3 +BITMAP +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +ENDCHAR +STARTCHAR braceright +ENCODING 125 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 0 +BITMAP +C0 +F0 +18 +18 +18 +08 +0F +0E +18 +18 +18 +F8 +F0 +ENDCHAR +STARTCHAR exclamdown +ENCODING 161 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 2 11 5 -4 +BITMAP +C0 +C0 +00 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +80 +ENDCHAR +STARTCHAR currency +ENCODING 164 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 8 2 2 +BITMAP +DB +FE +66 +C2 +C2 +66 +FE +DB +ENDCHAR +STARTCHAR section +ENCODING 167 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 0 +BITMAP +18 +7E +C6 +C0 +78 +FE +C3 +F3 +7E +03 +C3 +FE +3C +ENDCHAR +STARTCHAR dieresis +ENCODING 168 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 4 3 4 4 +BITMAP +B0 +B0 +80 +ENDCHAR +STARTCHAR macron +ENCODING 175 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 2 2 8 +BITMAP +FF +FE +ENDCHAR +STARTCHAR acute +ENCODING 180 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 2 3 5 8 +BITMAP +40 +C0 +C0 +ENDCHAR +STARTCHAR cedilla +ENCODING 184 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 3 7 5 -6 +BITMAP +80 +80 +E0 +60 +60 +E0 +80 +ENDCHAR +STARTCHAR questiondown +ENCODING 191 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 13 3 -4 +BITMAP +30 +30 +00 +00 +30 +30 +20 +E0 +C0 +84 +CC +FC +30 +ENDCHAR +STARTCHAR Adieresis +ENCODING 196 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +83 +9B +18 +38 +3C +2C +64 +66 +7E +FE +C3 +83 +ENDCHAR +STARTCHAR AE +ENCODING 198 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 13 11 -1 0 +BITMAP +1FF8 +3FF8 +3C00 +3C00 +27F8 +67F8 +7E00 +7E00 +4300 +C3F8 +C3F8 +ENDCHAR +STARTCHAR Odieresis +ENCODING 214 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +83 +83 +3C +7E +C6 +C3 +C3 +C3 +C3 +C6 +7E +3C +ENDCHAR +STARTCHAR Oslash +ENCODING 216 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 9 13 1 -1 +BITMAP +0D80 +3F80 +3300 +6300 +6780 +4D80 +4D80 +7980 +7100 +3300 +7E00 +5C00 +C000 +ENDCHAR +STARTCHAR Udieresis +ENCODING 220 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 0 +BITMAP +C2 +C7 +00 +80 +83 +83 +83 +83 +83 +83 +C3 +7E +3C +ENDCHAR +STARTCHAR germandbls +ENCODING 223 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 0 +BITMAP +18 +7E +46 +C2 +C2 +C6 +CE +CE +C3 +C3 +C3 +C6 +CE +ENDCHAR +STARTCHAR adieresis +ENCODING 228 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 11 2 0 +BITMAP +2C +2C +18 +7C +46 +0E +7E +C2 +C6 +FE +7A +ENDCHAR +STARTCHAR ae +ENCODING 230 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 13 9 -1 0 +BITMAP +1860 +7FF8 +4318 +0FF8 +7FF8 +4300 +C700 +7FF8 +3BF0 +ENDCHAR +STARTCHAR odieresis +ENCODING 246 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 11 2 0 +BITMAP +2C +2C +18 +7E +C6 +C3 +83 +83 +C2 +7E +3C +ENDCHAR +STARTCHAR oslash +ENCODING 248 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 9 10 1 -1 +BITMAP +0D80 +3F80 +6300 +6780 +4D80 +5980 +7100 +7F00 +DE00 +C000 +ENDCHAR +STARTCHAR udieresis +ENCODING 252 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 11 2 0 +BITMAP +2C +2C +00 +C3 +C3 +C3 +C3 +C3 +C7 +7F +7A +ENDCHAR +STARTCHAR dotlessi +ENCODING 305 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 4 9 3 0 +BITMAP +F0 +F0 +10 +10 +10 +10 +10 +10 +10 +ENDCHAR +STARTCHAR OE +ENCODING 338 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 13 12 -1 0 +BITMAP +1000 +7FF8 +67F8 +C700 +8300 +83F0 +83F0 +8300 +C300 +C700 +7FF8 +3BF8 +ENDCHAR +STARTCHAR oe +ENCODING 339 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 13 9 -1 0 +BITMAP +1860 +7DF8 +C718 +83F8 +83F8 +8300 +C700 +FFF8 +3CF0 +ENDCHAR +STARTCHAR dotlessj +ENCODING 567 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 5 12 2 -3 +BITMAP +38 +78 +08 +08 +08 +08 +08 +08 +08 +08 +78 +F0 +ENDCHAR +STARTCHAR circumflex +ENCODING 710 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 6 2 6 +BITMAP +18 +38 +3C +6E +C6 +C3 +ENDCHAR +STARTCHAR caron +ENCODING 711 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 6 2 9 +BITMAP +C3 +E6 +7E +3C +38 +18 +ENDCHAR +STARTCHAR breve +ENCODING 728 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 5 2 10 +BITMAP +83 +C3 +C6 +7E +18 +ENDCHAR +STARTCHAR dotaccent +ENCODING 729 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 2 2 5 8 +BITMAP +C0 +C0 +ENDCHAR +STARTCHAR tilde +ENCODING 732 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 3 2 8 +BITMAP +F3 +DE +04 +ENDCHAR +STARTCHAR Gamma +ENCODING 915 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +7E +FF +C3 +C3 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +ENDCHAR +STARTCHAR Theta +ENCODING 920 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +18 +7C +66 +C2 +C3 +9B +BB +C3 +C2 +46 +7C +38 +ENDCHAR +STARTCHAR Lambda +ENCODING 923 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 11 2 0 +BITMAP +18 +18 +18 +38 +38 +3C +2C +64 +64 +66 +E6 +ENDCHAR +STARTCHAR Xi +ENCODING 926 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 11 2 0 +BITMAP +FF +FE +00 +00 +7C +7E +00 +00 +00 +FE +FF +ENDCHAR +STARTCHAR Pi +ENCODING 928 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 12 2 0 +BITMAP +FE +FF +C2 +C2 +C2 +C2 +C2 +C2 +C2 +C2 +C2 +C2 +ENDCHAR +STARTCHAR Sigma +ENCODING 931 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 11 3 0 +BITMAP +FE +FE +C0 +C0 +60 +60 +60 +40 +C0 +FE +FE +ENDCHAR +STARTCHAR Upsilon +ENCODING 933 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 11 3 0 +BITMAP +FC +FC +30 +30 +30 +30 +30 +30 +30 +30 +30 +ENDCHAR +STARTCHAR Phi +ENCODING 934 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 -2 +BITMAP +18 +18 +3C +7E +DA +DB +9B +9B +DA +7E +3C +18 +18 +ENDCHAR +STARTCHAR Psi +ENCODING 936 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 12 3 -2 +BITMAP +B4 +BC +BC +BC +BC +BC +FC +F8 +F8 +78 +30 +20 +ENDCHAR +STARTCHAR Omega +ENCODING 8486 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 8 13 2 0 +BITMAP +3C +7E +C2 +83 +83 +C3 +C2 +C2 +46 +46 +64 +64 +6C +ENDCHAR +STARTCHAR arrowup +ENCODING 8593 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 11 3 0 +BITMAP +30 +78 +FC +BC +30 +30 +30 +30 +30 +30 +30 +ENDCHAR +STARTCHAR arrowdown +ENCODING 8595 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 6 11 3 0 +BITMAP +30 +30 +30 +30 +30 +30 +30 +30 +FC +78 +30 +ENDCHAR +STARTCHAR Delta +ENCODING 8710 +SWIDTH 832 0 +DWIDTH 13 0 +BBX 7 11 2 0 +BITMAP +18 +18 +38 +38 +3C +2C +64 +66 +46 +FE +FE +ENDCHAR +ENDFONT diff --git a/backend/fonts/OCRB-18.bdf b/backend/fonts/OCRB-18.bdf new file mode 100644 index 00000000..71c356e3 --- /dev/null +++ b/backend/fonts/OCRB-18.bdf @@ -0,0 +1,2615 @@ +STARTFONT 2.1 +COMMENT "Generated by fontforge, http://fontforge.sourceforge.net" +COMMENT "Matthew Skala (2011); based on code by Norbert Schwarz (1986, 2011)" +FONT -FontForge-OCRB-Regular-R-Normal--18-130-100-100-M-130-ISO10646-1 +SIZE 13 100 100 +FONTBOUNDINGBOX 16 23 -2 -6 +STARTPROPERTIES 41 +FOUNDRY "FontForge" +FAMILY_NAME "OCRB" +WEIGHT_NAME "Regular" +SLANT "R" +SETWIDTH_NAME "Normal" +ADD_STYLE_NAME "" +PIXEL_SIZE 18 +POINT_SIZE 130 +RESOLUTION_X 100 +RESOLUTION_Y 100 +SPACING "M" +AVERAGE_WIDTH 130 +CHARSET_REGISTRY "ISO10646" +CHARSET_ENCODING "1" +FONTNAME_REGISTRY "" +CHARSET_COLLECTIONS "ISO10646-1" +FONT_NAME "OCRB" +FACE_NAME "OCR B Regular" +COPYRIGHT "Matthew Skala (2011); based on code by Norbert Schwarz (1986, 2011)" +FONT_VERSION "2" +FONT_ASCENT 14 +FONT_DESCENT 4 +UNDERLINE_POSITION 0 +UNDERLINE_THICKNESS 0 +X_HEIGHT 9 +CAP_HEIGHT 12 +RAW_ASCENT 800 +RAW_DESCENT 200 +NORM_SPACE 13 +RELATIVE_WEIGHT 40 +RELATIVE_SETWIDTH 50 +SUPERSCRIPT_X 0 +SUPERSCRIPT_Y 8 +SUPERSCRIPT_SIZE 12 +SUBSCRIPT_X 0 +SUBSCRIPT_Y 2 +SUBSCRIPT_SIZE 12 +FIGURE_WIDTH 13 +AVG_LOWERCASE_WIDTH 130 +AVG_UPPERCASE_WIDTH "130" +_GBDFED_INFO "Edited with gbdfed 1.6." +ENDPROPERTIES +CHARS 139 +STARTCHAR .notdef +ENCODING -1 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 0 0 0 0 +BITMAP +ENDCHAR +STARTCHAR quotesingle.alt +ENCODING -1 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 1 3 6 9 +BITMAP +80 +80 +80 +ENDCHAR +STARTCHAR grave.alt +ENCODING -1 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 2 3 5 9 +BITMAP +C0 +C0 +40 +ENDCHAR +STARTCHAR quotedbl.alt +ENCODING -1 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 5 3 4 11 +BITMAP +D8 +D8 +D8 +ENDCHAR +STARTCHAR bar.alt +ENCODING -1 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 2 14 0 -2 +BITMAP +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +ENDCHAR +STARTCHAR space +ENCODING 32 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 0 0 0 0 +BITMAP +ENDCHAR +STARTCHAR exclam +ENCODING 33 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 3 15 5 -1 +BITMAP +40 +40 +40 +40 +40 +40 +40 +40 +40 +00 +00 +00 +40 +E0 +E0 +ENDCHAR +STARTCHAR quotedbl +ENCODING 34 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 6 3 8 +BITMAP +C6 +C6 +C6 +C6 +C6 +C6 +ENDCHAR +STARTCHAR numbersign +ENCODING 35 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +1980 +1980 +1180 +3300 +FF80 +7F80 +3300 +6200 +FF00 +FF80 +6600 +4400 +CC00 +CC00 +ENDCHAR +STARTCHAR dollar +ENCODING 36 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +0800 +3E00 +7F00 +C980 +C800 +F800 +7E00 +0F00 +0980 +0980 +C980 +FF00 +3E00 +0800 +ENDCHAR +STARTCHAR percent +ENCODING 37 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +7180 +F180 +DB00 +F300 +7600 +0C00 +0C00 +1800 +1800 +3700 +6780 +6D80 +C780 +C700 +ENDCHAR +STARTCHAR ampersand +ENCODING 38 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +3C00 +7E00 +6200 +4600 +6E00 +7C00 +3800 +7880 +D980 +CD80 +C780 +C700 +7F00 +3D00 +ENDCHAR +STARTCHAR quotesingle +ENCODING 39 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 3 7 5 7 +BITMAP +E0 +E0 +E0 +E0 +E0 +E0 +E0 +ENDCHAR +STARTCHAR parenleft +ENCODING 40 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 5 14 5 0 +BITMAP +18 +38 +60 +C0 +C0 +C0 +80 +80 +C0 +C0 +C0 +60 +30 +18 +ENDCHAR +STARTCHAR parenright +ENCODING 41 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 5 14 3 0 +BITMAP +C0 +E0 +30 +18 +18 +18 +08 +08 +08 +18 +18 +30 +60 +C0 +ENDCHAR +STARTCHAR asterisk +ENCODING 42 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 9 2 3 +BITMAP +0800 +0800 +0800 +C980 +FF80 +1C00 +3E00 +3600 +6300 +ENDCHAR +STARTCHAR plus +ENCODING 43 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 10 2 2 +BITMAP +0800 +0800 +0800 +0800 +FF80 +FF80 +0800 +0800 +0800 +0800 +ENDCHAR +STARTCHAR comma +ENCODING 44 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 7 3 -3 +BITMAP +1E +3E +3C +78 +70 +E0 +C0 +ENDCHAR +STARTCHAR hyphen +ENCODING 45 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 2 2 6 +BITMAP +FF80 +FF80 +ENDCHAR +STARTCHAR period +ENCODING 46 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 5 4 4 0 +BITMAP +70 +F8 +F8 +F8 +ENDCHAR +STARTCHAR slash +ENCODING 47 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 14 3 0 +BITMAP +06 +06 +0C +0C +0C +18 +18 +30 +30 +30 +60 +60 +C0 +C0 +ENDCHAR +STARTCHAR zero +ENCODING 48 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +3E00 +7F00 +6300 +C180 +C180 +C180 +C180 +C180 +C180 +C180 +C180 +6300 +7F00 +3E00 +ENDCHAR +STARTCHAR one +ENCODING 49 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 5 14 3 0 +BITMAP +18 +38 +78 +D8 +98 +18 +18 +18 +18 +18 +18 +18 +18 +18 +ENDCHAR +STARTCHAR two +ENCODING 50 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +3E00 +7F00 +C180 +0180 +0380 +0700 +0E00 +1C00 +3800 +7000 +E000 +C000 +FF00 +7F80 +ENDCHAR +STARTCHAR three +ENCODING 51 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +FF00 +FF00 +0300 +0600 +0C00 +1C00 +1E00 +0300 +0180 +0180 +0180 +0300 +FF00 +7C00 +ENDCHAR +STARTCHAR four +ENCODING 52 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +0C00 +0C00 +1800 +1800 +3000 +3000 +6200 +6600 +C600 +FF80 +FF80 +0600 +0600 +0600 +ENDCHAR +STARTCHAR five +ENCODING 53 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 14 2 0 +BITMAP +7F +7F +60 +60 +60 +7C +7E +03 +03 +03 +03 +06 +FE +7C +ENDCHAR +STARTCHAR six +ENCODING 54 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +0600 +0E00 +1C00 +1800 +3000 +7C00 +7F00 +E380 +C180 +C180 +C180 +E180 +7F00 +3E00 +ENDCHAR +STARTCHAR seven +ENCODING 55 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +FF80 +FF80 +0180 +0300 +0700 +0600 +0C00 +1800 +1800 +1800 +3000 +3000 +3000 +3000 +ENDCHAR +STARTCHAR eight +ENCODING 56 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +3E00 +7F00 +6300 +4100 +6300 +3E00 +3E00 +7700 +E380 +C180 +C180 +C180 +7F00 +3E00 +ENDCHAR +STARTCHAR nine +ENCODING 57 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +3E00 +7F00 +6380 +C180 +C180 +C180 +E180 +7F00 +3F00 +0600 +0600 +0C00 +1800 +3000 +ENDCHAR +STARTCHAR colon +ENCODING 58 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 3 9 5 0 +BITMAP +E0 +E0 +E0 +00 +00 +00 +E0 +E0 +E0 +ENDCHAR +STARTCHAR semicolon +ENCODING 59 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 6 13 3 -4 +BITMAP +3C +3C +3C +00 +00 +00 +3C +3C +78 +70 +E0 +E0 +C0 +ENDCHAR +STARTCHAR less +ENCODING 60 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 11 2 1 +BITMAP +0380 +0700 +1E00 +3800 +F000 +E000 +7800 +1C00 +0F00 +0380 +0180 +ENDCHAR +STARTCHAR equal +ENCODING 61 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 6 2 4 +BITMAP +FF80 +FF80 +0000 +0000 +FF80 +FF80 +ENDCHAR +STARTCHAR greater +ENCODING 62 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 11 2 1 +BITMAP +E000 +7000 +3C00 +0E00 +0780 +0380 +0F00 +1C00 +7800 +E000 +C000 +ENDCHAR +STARTCHAR question +ENCODING 63 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 14 3 -1 +BITMAP +38 +FC +C6 +86 +06 +0C +18 +10 +10 +00 +00 +10 +38 +38 +ENDCHAR +STARTCHAR at +ENCODING 64 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +3E00 +7F00 +C300 +C180 +0180 +7D80 +7D80 +CD80 +CD80 +CD80 +CD80 +FF80 +7700 +ENDCHAR +STARTCHAR A +ENCODING 65 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +1C00 +1C00 +1400 +3600 +3600 +3600 +3200 +6300 +7F00 +7F00 +6100 +C180 +C180 +ENDCHAR +STARTCHAR B +ENCODING 66 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +FE00 +FF00 +C380 +C180 +C180 +FF00 +FF00 +C380 +C180 +C180 +C180 +FF00 +FE00 +ENDCHAR +STARTCHAR C +ENCODING 67 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 13 3 0 +BITMAP +1C +7E +66 +C2 +C0 +C0 +C0 +C0 +C0 +C0 +E6 +7E +3C +ENDCHAR +STARTCHAR D +ENCODING 68 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 13 3 0 +BITMAP +F0 +F8 +DC +C6 +C6 +C2 +C3 +C3 +C2 +C6 +CE +FC +F0 +ENDCHAR +STARTCHAR E +ENCODING 69 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 13 3 0 +BITMAP +FF +FF +C0 +C0 +C0 +FE +FE +C0 +C0 +C0 +C0 +FF +FF +ENDCHAR +STARTCHAR F +ENCODING 70 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 6 13 4 0 +BITMAP +FC +FC +C0 +C0 +C0 +F8 +FC +C0 +C0 +C0 +C0 +C0 +80 +ENDCHAR +STARTCHAR G +ENCODING 71 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +1E00 +3F00 +6180 +6000 +C000 +C000 +CF00 +CF80 +C180 +6180 +6180 +3F80 +1F00 +ENDCHAR +STARTCHAR H +ENCODING 72 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 14 3 -1 +BITMAP +82 +83 +83 +83 +83 +83 +FF +FF +83 +83 +83 +83 +83 +82 +ENDCHAR +STARTCHAR I +ENCODING 73 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 13 3 0 +BITMAP +7C +7E +10 +10 +10 +10 +10 +10 +10 +10 +10 +FE +FE +ENDCHAR +STARTCHAR J +ENCODING 74 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 13 2 0 +BITMAP +06 +06 +06 +06 +06 +06 +06 +06 +46 +C6 +C6 +7C +38 +ENDCHAR +STARTCHAR K +ENCODING 75 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +C180 +C300 +C600 +CC00 +D800 +F000 +F000 +F800 +DC00 +CE00 +C700 +C380 +C180 +ENDCHAR +STARTCHAR L +ENCODING 76 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 13 3 0 +BITMAP +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +FF +FF +ENDCHAR +STARTCHAR M +ENCODING 77 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +E380 +E380 +F780 +F780 +F780 +DD80 +DD80 +DD80 +C980 +C180 +C180 +C180 +C180 +ENDCHAR +STARTCHAR N +ENCODING 78 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +E180 +E180 +F180 +F180 +D980 +D980 +CD80 +CD80 +CD80 +C780 +C780 +C380 +C380 +ENDCHAR +STARTCHAR O +ENCODING 79 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +1C00 +3E00 +6300 +4100 +C180 +C180 +C180 +C180 +C180 +6100 +6300 +3E00 +1C00 +ENDCHAR +STARTCHAR P +ENCODING 80 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 13 3 0 +BITMAP +FC +FE +83 +83 +83 +83 +FE +FC +80 +80 +80 +80 +80 +ENDCHAR +STARTCHAR Q +ENCODING 81 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +1C00 +7E00 +6700 +C300 +C100 +C180 +C180 +D900 +CD00 +C700 +6700 +3F00 +1D80 +ENDCHAR +STARTCHAR R +ENCODING 82 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 13 3 0 +BITMAP +F8 +FE +C6 +C2 +C2 +C6 +FE +F8 +DC +CC +C6 +C6 +C3 +ENDCHAR +STARTCHAR S +ENCODING 83 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 13 3 0 +BITMAP +38 +FE +C6 +C2 +C0 +70 +3C +0E +06 +82 +C6 +FE +78 +ENDCHAR +STARTCHAR T +ENCODING 84 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +FF80 +FF80 +0800 +0800 +0800 +0800 +0800 +0800 +0800 +0800 +0800 +0800 +0800 +ENDCHAR +STARTCHAR U +ENCODING 85 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +C180 +C180 +C180 +C180 +C180 +C180 +C180 +C180 +C180 +C180 +6380 +7F00 +3E00 +ENDCHAR +STARTCHAR V +ENCODING 86 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +C180 +C180 +C180 +6100 +6300 +6300 +6300 +3600 +3600 +3600 +1400 +1C00 +1C00 +ENDCHAR +STARTCHAR W +ENCODING 87 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +C180 +C180 +C180 +C180 +C180 +C980 +DD80 +DD80 +5D80 +7700 +7700 +7700 +6300 +ENDCHAR +STARTCHAR X +ENCODING 88 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +4100 +6300 +6300 +3600 +3600 +1C00 +1C00 +1C00 +3600 +3600 +6300 +6300 +C180 +ENDCHAR +STARTCHAR Y +ENCODING 89 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 13 3 0 +BITMAP +83 +C6 +C6 +6C +6C +38 +38 +10 +10 +10 +10 +10 +10 +ENDCHAR +STARTCHAR Z +ENCODING 90 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 13 3 0 +BITMAP +FE +FE +0C +0C +18 +18 +30 +30 +60 +60 +C0 +FE +FE +ENDCHAR +STARTCHAR bracketleft +ENCODING 91 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 14 4 0 +BITMAP +FE +FC +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +C0 +FC +FE +ENDCHAR +STARTCHAR backslash +ENCODING 92 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 14 3 0 +BITMAP +C0 +C0 +60 +60 +60 +30 +30 +18 +18 +08 +0C +0C +06 +06 +ENDCHAR +STARTCHAR bracketright +ENCODING 93 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 14 2 0 +BITMAP +FE +7E +06 +06 +06 +06 +06 +06 +06 +06 +06 +06 +7E +FE +ENDCHAR +STARTCHAR underscore +ENCODING 95 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 2 2 -4 +BITMAP +FF80 +FF80 +ENDCHAR +STARTCHAR grave +ENCODING 96 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 2 3 5 11 +BITMAP +80 +C0 +C0 +ENDCHAR +STARTCHAR a +ENCODING 97 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 10 2 0 +BITMAP +1C +7F +63 +01 +3F +7F +C3 +C3 +7F +3D +ENDCHAR +STARTCHAR b +ENCODING 98 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +C000 +C000 +C000 +C000 +DC00 +FF00 +E380 +C180 +C180 +C180 +C180 +E380 +FF00 +DE00 +ENDCHAR +STARTCHAR c +ENCODING 99 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 10 3 0 +BITMAP +3C +7E +C6 +C0 +C0 +C0 +C0 +C6 +7E +3C +ENDCHAR +STARTCHAR d +ENCODING 100 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +0180 +0180 +0180 +0180 +1D80 +7F80 +6380 +C180 +C180 +C180 +C180 +E380 +7F80 +3D80 +ENDCHAR +STARTCHAR e +ENCODING 101 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 10 2 0 +BITMAP +1C00 +3F00 +6300 +C180 +FF80 +FF80 +C000 +6000 +7F00 +1E00 +ENDCHAR +STARTCHAR f +ENCODING 102 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 14 3 0 +BITMAP +06 +1E +18 +10 +FE +FE +10 +10 +10 +10 +10 +10 +10 +10 +ENDCHAR +STARTCHAR g +ENCODING 103 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 -4 +BITMAP +1D00 +7F80 +6380 +C380 +C180 +C180 +C380 +6380 +7F80 +3D80 +0180 +6300 +7F00 +3C00 +ENDCHAR +STARTCHAR h +ENCODING 104 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 14 3 0 +BITMAP +C0 +C0 +C0 +C0 +D8 +FE +E6 +C6 +C6 +C6 +C6 +C6 +C6 +C6 +ENDCHAR +STARTCHAR i +ENCODING 105 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 5 14 3 0 +BITMAP +18 +18 +18 +00 +F8 +F8 +18 +18 +18 +18 +18 +18 +18 +08 +ENDCHAR +STARTCHAR j +ENCODING 106 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 5 17 3 -3 +BITMAP +18 +18 +18 +00 +78 +78 +18 +18 +18 +18 +18 +18 +18 +18 +18 +F8 +F0 +ENDCHAR +STARTCHAR k +ENCODING 107 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 14 3 0 +BITMAP +C0 +C0 +C0 +C0 +C6 +CE +DC +F8 +F0 +F8 +DC +CE +C6 +C2 +ENDCHAR +STARTCHAR l +ENCODING 108 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 5 14 5 0 +BITMAP +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +C0 +F8 +78 +ENDCHAR +STARTCHAR m +ENCODING 109 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 10 2 0 +BITMAP +F300 +FF80 +CD80 +CD80 +C980 +C980 +C980 +C980 +C980 +C980 +ENDCHAR +STARTCHAR n +ENCODING 110 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 10 2 0 +BITMAP +5E00 +FF00 +E300 +E180 +C180 +C180 +C180 +C180 +C180 +C180 +ENDCHAR +STARTCHAR o +ENCODING 111 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 10 2 0 +BITMAP +1C00 +7F00 +6300 +C180 +C180 +C180 +C180 +6380 +7F00 +3E00 +ENDCHAR +STARTCHAR p +ENCODING 112 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 -3 +BITMAP +5C00 +FF00 +E300 +C180 +C180 +C180 +C180 +E380 +FF00 +DE00 +C000 +C000 +C000 +ENDCHAR +STARTCHAR q +ENCODING 113 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 -3 +BITMAP +1D80 +7F80 +6380 +C180 +C180 +C180 +C180 +E380 +7F80 +3D80 +0180 +0180 +0180 +ENDCHAR +STARTCHAR r +ENCODING 114 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 10 4 0 +BITMAP +98 +FC +E6 +C4 +C0 +80 +80 +80 +80 +80 +ENDCHAR +STARTCHAR s +ENCODING 115 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 10 3 0 +BITMAP +38 +FE +C6 +C0 +F8 +3E +06 +82 +FE +7C +ENDCHAR +STARTCHAR t +ENCODING 116 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 13 2 0 +BITMAP +10 +10 +10 +7F +FF +10 +10 +30 +30 +30 +10 +1F +0F +ENDCHAR +STARTCHAR u +ENCODING 117 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 10 2 0 +BITMAP +C180 +C180 +C180 +C180 +C180 +C180 +C180 +C380 +7F80 +3D80 +ENDCHAR +STARTCHAR v +ENCODING 118 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 10 2 0 +BITMAP +C180 +C180 +4100 +6300 +6300 +3600 +3600 +3600 +1C00 +1C00 +ENDCHAR +STARTCHAR w +ENCODING 119 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 10 2 0 +BITMAP +C180 +C180 +C180 +C180 +DD80 +5D00 +7F00 +7700 +7700 +7700 +ENDCHAR +STARTCHAR x +ENCODING 120 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 10 3 0 +BITMAP +C6 +C6 +6C +7C +38 +38 +6C +EE +C6 +82 +ENDCHAR +STARTCHAR y +ENCODING 121 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 -3 +BITMAP +C180 +C180 +6300 +6300 +3600 +1E00 +1C00 +0C00 +1800 +3000 +3000 +E000 +E000 +ENDCHAR +STARTCHAR z +ENCODING 122 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 10 3 0 +BITMAP +FE +FE +0E +0C +18 +30 +60 +E0 +FE +FE +ENDCHAR +STARTCHAR braceleft +ENCODING 123 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +0780 +0F80 +1800 +1800 +1800 +1800 +F000 +F000 +1800 +1800 +1800 +1800 +0F80 +0780 +ENDCHAR +STARTCHAR bar +ENCODING 124 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 1 17 6 -3 +BITMAP +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +ENDCHAR +STARTCHAR braceright +ENCODING 125 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +F000 +F800 +0C00 +0C00 +0C00 +0C00 +0780 +0780 +0C00 +0C00 +0C00 +0C00 +F800 +F000 +ENDCHAR +STARTCHAR exclamdown +ENCODING 161 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 3 12 5 -4 +BITMAP +E0 +E0 +40 +40 +40 +40 +40 +40 +40 +40 +40 +40 +ENDCHAR +STARTCHAR currency +ENCODING 164 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 9 2 2 +BITMAP +DD80 +7F00 +6300 +6100 +4100 +6300 +7F00 +DD80 +8080 +ENDCHAR +STARTCHAR section +ENCODING 167 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +3E00 +7F00 +6300 +4000 +7C00 +7F00 +C180 +C180 +7F00 +1F00 +4180 +C180 +7F00 +3E00 +ENDCHAR +STARTCHAR dieresis +ENCODING 168 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 5 3 4 5 +BITMAP +D8 +D8 +D8 +ENDCHAR +STARTCHAR macron +ENCODING 175 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 2 2 10 +BITMAP +7F80 +FF80 +ENDCHAR +STARTCHAR acute +ENCODING 180 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 2 3 6 9 +BITMAP +C0 +C0 +80 +ENDCHAR +STARTCHAR cedilla +ENCODING 184 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 4 7 5 -6 +BITMAP +40 +C0 +E0 +70 +30 +70 +60 +ENDCHAR +STARTCHAR questiondown +ENCODING 191 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 14 3 -4 +BITMAP +38 +38 +10 +00 +10 +10 +10 +30 +60 +C0 +C2 +C6 +7E +3C +ENDCHAR +STARTCHAR Adieresis +ENCODING 196 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +C180 +CD80 +DD80 +1C00 +1400 +3600 +3600 +3600 +2300 +7300 +7F00 +4700 +C180 +C180 +ENDCHAR +STARTCHAR AE +ENCODING 198 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 15 13 -1 0 +BITMAP +1FFC +1FFE +1C00 +3600 +3600 +37FC +67FE +6300 +7F00 +7F00 +C300 +C1FC +C1FE +ENDCHAR +STARTCHAR Odieresis +ENCODING 214 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +C180 +C180 +C180 +1E00 +7F00 +6300 +C180 +C180 +C180 +C180 +C180 +6300 +7F00 +1C00 +ENDCHAR +STARTCHAR Oslash +ENCODING 216 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 15 2 -1 +BITMAP +0080 +1D80 +3F80 +6300 +4700 +C780 +CD80 +DD80 +D980 +F180 +7100 +6300 +FE00 +DC00 +8000 +ENDCHAR +STARTCHAR Udieresis +ENCODING 220 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +E380 +E180 +0000 +8080 +C180 +C180 +C180 +C180 +C180 +C180 +C180 +C180 +7F00 +3E00 +ENDCHAR +STARTCHAR germandbls +ENCODING 223 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 0 +BITMAP +1C00 +7F00 +6300 +4180 +C180 +C300 +CF00 +CF00 +C180 +C180 +C180 +C180 +C700 +C600 +ENDCHAR +STARTCHAR adieresis +ENCODING 228 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 13 2 0 +BITMAP +36 +36 +36 +00 +3E +7F +03 +3F +7F +C3 +C3 +7F +3D +ENDCHAR +STARTCHAR ae +ENCODING 230 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 15 10 -1 0 +BITMAP +1C78 +7FFC +638E +0186 +3FFE +7FFE +C180 +C380 +7FFC +3D7C +ENDCHAR +STARTCHAR odieresis +ENCODING 246 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +3600 +3600 +3600 +0000 +3E00 +7F00 +E380 +C180 +C180 +C180 +E380 +7F00 +3E00 +ENDCHAR +STARTCHAR oslash +ENCODING 248 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 11 12 1 -1 +BITMAP +0060 +0EE0 +3FC0 +3180 +63C0 +66C0 +6CC0 +78C0 +39C0 +7F80 +7F00 +C000 +ENDCHAR +STARTCHAR udieresis +ENCODING 252 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +3600 +3600 +3600 +0000 +C180 +C180 +C180 +C180 +C180 +C180 +C380 +7F80 +3D80 +ENDCHAR +STARTCHAR dotlessi +ENCODING 305 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 5 10 3 0 +BITMAP +F8 +F8 +18 +18 +18 +18 +18 +18 +18 +08 +ENDCHAR +STARTCHAR OE +ENCODING 338 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 15 13 -1 0 +BITMAP +3DFC +7FFE +E700 +C300 +C300 +81F8 +81FC +8100 +C300 +C300 +6700 +7FFC +3DFE +ENDCHAR +STARTCHAR oe +ENCODING 339 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 16 10 -2 0 +BITMAP +1E3C +3F7E +63C7 +61C3 +C0FF +C0FF +41C0 +61C0 +7F7E +1E3E +ENDCHAR +STARTCHAR dotlessj +ENCODING 567 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 5 13 3 -3 +BITMAP +78 +78 +18 +18 +18 +18 +18 +18 +18 +18 +18 +F8 +F0 +ENDCHAR +STARTCHAR circumflex +ENCODING 710 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 7 2 7 +BITMAP +0800 +1C00 +3E00 +3E00 +7700 +6380 +C180 +ENDCHAR +STARTCHAR caron +ENCODING 711 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 7 2 10 +BITMAP +C180 +E380 +7700 +3E00 +3E00 +1C00 +0800 +ENDCHAR +STARTCHAR breve +ENCODING 728 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 5 2 12 +BITMAP +C180 +C180 +E380 +7F00 +3E00 +ENDCHAR +STARTCHAR dotaccent +ENCODING 729 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 3 3 5 8 +BITMAP +E0 +E0 +40 +ENDCHAR +STARTCHAR tilde +ENCODING 732 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 3 2 10 +BITMAP +7980 +FF80 +CF00 +ENDCHAR +STARTCHAR Gamma +ENCODING 915 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 13 3 0 +BITMAP +FF +FF +83 +83 +80 +80 +80 +80 +80 +80 +80 +80 +80 +ENDCHAR +STARTCHAR Theta +ENCODING 920 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +1C00 +3E00 +6300 +6100 +C180 +C180 +DD80 +DD80 +C180 +4180 +6300 +3E00 +1C00 +ENDCHAR +STARTCHAR Lambda +ENCODING 923 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 13 3 0 +BITMAP +10 +38 +38 +38 +38 +2C +6C +6C +6C +44 +C6 +C6 +C6 +ENDCHAR +STARTCHAR Xi +ENCODING 926 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +FF80 +FF80 +0000 +0000 +0000 +3E00 +7F00 +0000 +0000 +0000 +0000 +FF80 +FF80 +ENDCHAR +STARTCHAR Pi +ENCODING 928 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 13 2 0 +BITMAP +FF80 +FF80 +4180 +4180 +4180 +4180 +4180 +4180 +4180 +4180 +4180 +4180 +4100 +ENDCHAR +STARTCHAR Sigma +ENCODING 931 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 8 13 3 0 +BITMAP +F0 +FF +C3 +60 +60 +60 +30 +60 +60 +60 +C0 +FF +FF +ENDCHAR +STARTCHAR Upsilon +ENCODING 933 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 12 3 0 +BITMAP +6E +FE +92 +10 +10 +10 +10 +10 +10 +10 +10 +10 +ENDCHAR +STARTCHAR Phi +ENCODING 934 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 14 2 -2 +BITMAP +1C00 +0C00 +3E00 +7F00 +6B80 +C980 +C980 +C980 +C980 +6B80 +7F00 +3E00 +0800 +1C00 +ENDCHAR +STARTCHAR Psi +ENCODING 936 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 13 3 -2 +BITMAP +D6 +D6 +D6 +D6 +D6 +D6 +D6 +D6 +54 +7C +38 +10 +10 +ENDCHAR +STARTCHAR Omega +ENCODING 8486 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 9 15 2 0 +BITMAP +1C00 +7F00 +6300 +C180 +C180 +C180 +C180 +C180 +4100 +6300 +6300 +6300 +2200 +3600 +3600 +ENDCHAR +STARTCHAR arrowup +ENCODING 8593 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 13 3 0 +BITMAP +10 +38 +7C +D6 +10 +10 +10 +10 +10 +10 +10 +10 +10 +ENDCHAR +STARTCHAR arrowdown +ENCODING 8595 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 13 3 0 +BITMAP +10 +10 +10 +10 +10 +10 +10 +10 +10 +D6 +7C +38 +10 +ENDCHAR +STARTCHAR Delta +ENCODING 8710 +SWIDTH 886 0 +DWIDTH 16 0 +BBX 7 13 3 0 +BITMAP +10 +38 +38 +38 +28 +6C +6C +6C +46 +C6 +C6 +FE +FE +ENDCHAR +ENDFONT diff --git a/backend/raster.c b/backend/raster.c index e8e11e03..1cb35e09 100644 --- a/backend/raster.c +++ b/backend/raster.c @@ -49,6 +49,8 @@ #define DEFAULT_INK '1' #define DEFAULT_PAPER '0' +#define UPCEAN_TEXT 1 + #ifndef NO_PNG INTERNAL int png_pixel_plot(struct zint_symbol *symbol, char *pixelbuf); #endif /* NO_PNG */ @@ -347,7 +349,7 @@ static void draw_hexagon(char *pixelbuf, int image_width, char *scaled_hexagon, } } -static void draw_letter(char *pixelbuf, unsigned char letter, int xposn, int yposn, int textflags, int image_width, int image_height) { +static void draw_letter(char *pixelbuf, unsigned char letter, int xposn, int yposn, int textflags, int image_width, int image_height, int si) { /* Put a letter into a position */ int skip; @@ -361,133 +363,147 @@ static void draw_letter(char *pixelbuf, unsigned char letter, int xposn, int ypo skip = 1; } - if (xposn < 0 || yposn < 0) { + if ((textflags & UPCEAN_TEXT) && (letter < '0' || letter > '9')) { + skip = 1; + } + + if (yposn < 0) { /* Allow xposn < 0, dealt with below */ skip = 1; } if (skip == 0) { int glyph_no; int x, y; + int max_x, max_y; + font_item *font_table; + int bold = 0; + unsigned glyph_mask; + int font_y; + int half_si = si / 2; + int odd_si = si & 1; + char *linePtr, *maxPtr; + int x_start = 0; + if (letter > 128) { glyph_no = letter - 66; } else { glyph_no = letter - 33; } + if (textflags & UPCEAN_TEXT) { /* Needs to be before SMALL_TEXT check */ + /* No bold for UPCEAN */ + if (textflags & SMALL_TEXT) { + font_table = upcean_small_font; + max_x = UPCEAN_SMALL_FONT_WIDTH; + max_y = UPCEAN_SMALL_FONT_HEIGHT; + } else { + font_table = upcean_font; + max_x = UPCEAN_FONT_WIDTH; + max_y = UPCEAN_FONT_HEIGHT; + } + glyph_no = letter - '0'; + } else if (textflags & SMALL_TEXT) { // small font 5x9 + /* No bold for small */ + max_x = SMALL_FONT_WIDTH; + max_y = SMALL_FONT_HEIGHT; + font_table = small_font; + } else if (textflags & BOLD_TEXT) { // bold font -> regular font + 1 + max_x = NORMAL_FONT_WIDTH + 1; + max_y = NORMAL_FONT_HEIGHT; + font_table = ascii_font; + bold = 1; + } else { // regular font 7x14 + max_x = NORMAL_FONT_WIDTH; + max_y = NORMAL_FONT_HEIGHT; + font_table = ascii_font; + } + glyph_mask = ((unsigned) 1) << (max_x - 1); + font_y = glyph_no * max_y; - switch (textflags) { - int max_x, max_y; - case 1: // small font 5x9 - max_x = 5; - max_y = 9; + if (xposn < 0) { + x_start = -xposn; + xposn = 0; + } - if (xposn + max_x >= image_width) { - max_x = image_width - xposn - 1; - } + if (yposn + max_y > image_height) { + max_y = image_height - yposn; + } - if (yposn + max_y >= image_height) { - max_y = image_height - yposn - 1; - } - - for (y = 0; y < max_y; y++) { - for (x = 0; x < max_x; x++) { - if (small_font[(glyph_no * 9) + y] & (0x10 >> x)) { - *(pixelbuf + (y * image_width) + (yposn * image_width) + xposn + x) = DEFAULT_INK; - } - } - } - break; - - case 2: // bold font -> twice the regular font - { - char * linePtr; - max_x = 7; - max_y = 14; - - if (xposn + max_x + 1 >= image_width) { - max_x = image_width - xposn - 2; - } - - if (yposn + max_y >= image_height) { - max_y = image_height - yposn - 1; - } - - linePtr = pixelbuf + (yposn * image_width) + xposn + 1; - for (y = 0; y < max_y; y++) { - char * pixelPtr = linePtr; - int extra_dot = 0; - for (x = 0; x < max_x; x++) { - if (ascii_font[(glyph_no * 14) + y] & (0x40 >> x)) { + linePtr = pixelbuf + (yposn * image_width) + xposn; + for (y = 0; y < max_y; y++) { + int x_si, y_si; + char *pixelPtr; + for (y_si = 0; y_si < half_si; y_si++) { + int extra_dot = 0; + pixelPtr = linePtr; + maxPtr = linePtr + image_width - xposn; + for (x = x_start; x < max_x && pixelPtr < maxPtr; x++) { + unsigned set = font_table[font_y + y] & (glyph_mask >> x); + for (x_si = 0; x_si < half_si && pixelPtr < maxPtr; x_si++) { + if (set) { + *pixelPtr = DEFAULT_INK; + extra_dot = bold; + } else if (extra_dot) { *pixelPtr = DEFAULT_INK; - extra_dot = 1; - } else { - if (extra_dot) { - *pixelPtr = DEFAULT_INK; - } - extra_dot = 0; } - - ++pixelPtr; + pixelPtr++; } - - if (extra_dot) { - *pixelPtr = DEFAULT_INK; - } - - linePtr += image_width; - } - } - break; - - default: // regular font 7x14 - max_x = 7; - max_y = 14; - - if (xposn + max_x >= image_width) { - max_x = image_width - xposn - 1; - } - - if (yposn + max_y >= image_height) { - max_y = image_height - yposn - 1; - } - - for (y = 0; y < max_y; y++) { - for (x = 0; x < max_x; x++) { - if (ascii_font[(glyph_no * 14) + y] & (0x40 >> x)) { - *(pixelbuf + (y * image_width) + (yposn * image_width) + xposn + x) = DEFAULT_INK; + if (pixelPtr < maxPtr && odd_si && (x & 1)) { + if (set) { + *pixelPtr = DEFAULT_INK; } + pixelPtr++; } } - break; + if (pixelPtr < maxPtr && extra_dot) { + *pixelPtr++ = DEFAULT_INK; + } + linePtr += image_width; + } + if (odd_si && (y & 1)) { + memcpy(linePtr, linePtr - image_width, pixelPtr - (linePtr - image_width)); + linePtr += image_width; + } } } } /* Plot a string into the pixel buffer */ -static void draw_string(char *pixbuf, unsigned char input_string[], int xposn, int yposn, int textflags, int image_width, int image_height) { - int i, string_length, string_left_hand, letter_width = 7; +static void draw_string(char *pixbuf, unsigned char input_string[], int xposn, int yposn, int textflags, int image_width, int image_height, int si) { + int i, string_length, string_left_hand, letter_width, letter_gap; + int half_si = si / 2, odd_si = si & 1, x_incr; - switch (textflags) { - case 1: // small font 5x9 - letter_width = 5; - break; - - case 2: // bold font -> width of the regular font + 1 extra dot + 1 extra space - letter_width = 9; - break; - - default: // regular font 7x15 - letter_width = 7; - break; + if (textflags & UPCEAN_TEXT) { /* Needs to be before SMALL_TEXT check */ + /* No bold for UPCEAN */ + letter_width = textflags & SMALL_TEXT ? UPCEAN_SMALL_FONT_WIDTH : UPCEAN_FONT_WIDTH; + letter_gap = 5; + } else if (textflags & SMALL_TEXT) { // small font 5x9 + /* No bold for small */ + letter_width = SMALL_FONT_WIDTH; + letter_gap = 0; + } else if (textflags & BOLD_TEXT) { // bold font -> width of the regular font + 1 extra dot + 1 extra space + letter_width = NORMAL_FONT_WIDTH + 1; + letter_gap = 1; + } else { // regular font 7x15 + letter_width = NORMAL_FONT_WIDTH; + letter_gap = 0; } + letter_width += letter_gap; string_length = ustrlen(input_string); - string_left_hand = xposn - ((letter_width * string_length) / 2); + string_left_hand = xposn - ((letter_width * string_length - letter_gap) * half_si) / 2; + if (odd_si) { + string_left_hand -= (letter_width * string_length - letter_gap) / 4; + } for (i = 0; i < string_length; i++) { + x_incr = i * letter_width * half_si; + if (odd_si) { + x_incr += i * letter_width / 2; + } // NOLINTNEXTLINE(clang-analyzer-core.CallAndMessage) suppress (probable) false positive about 2nd arg input_string[i] being uninitialized - draw_letter(pixbuf, input_string[i], string_left_hand + (i * letter_width), yposn, textflags, image_width, image_height); + draw_letter(pixbuf, input_string[i], string_left_hand + x_incr, yposn, textflags, image_width, image_height, si); } } @@ -758,6 +774,8 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int int textpos; int hide_text = 0; int i, r; + int text_height; /* Font size */ + int text_gap; /* Gap between barcode and text */ int textflags = 0; int image_width, image_height; @@ -771,6 +789,7 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int int scale_width, scale_height; char *scaled_pixelbuf; int horiz, vert; + int guardoffset = 0; /* Ignore scaling < 0.5 for raster as would drop modules */ if (scaler < 0.5f) { @@ -799,18 +818,33 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int addon_text_posn = 0.0f; hide_text = ((!symbol->show_hrt) || (ustrlen(symbol->text) == 0)); - if (symbol->output_options & SMALL_TEXT) { - textflags = 1; - } else if (symbol->output_options & BOLD_TEXT) { - textflags = 2; - } - - if (ustrlen(symbol->text) != 0) { - textoffset = 9; + if (upceanflag) { + textflags = UPCEAN_TEXT; /* Small and bold not available for UPC/EAN */ } else { - textoffset = 0; + textflags = symbol->output_options & (SMALL_TEXT | BOLD_TEXT); } + if (hide_text) { + text_gap = 0; + textoffset = upceanflag && upceanflag != 2 && upceanflag != 5 ? 5 : 0; /* Need 5X from bottom for guard bars */ + } else { + /* Note font sizes halved as in pixels */ + if (upceanflag) { + text_height = (UPCEAN_FONT_HEIGHT + 1) / 2; + } else if (textflags & SMALL_TEXT) { + text_height = (SMALL_FONT_HEIGHT + 1) / 2; + } else { + text_height = (NORMAL_FONT_HEIGHT + 1) / 2; + } + if (upceanflag) { + text_gap = 1; + textoffset = (text_height > 5 ? text_height : 5) + text_gap; /* Need at least 5X for guard bars */ + guardoffset = textoffset - 5 + yoffset; + } else { + text_gap = 1; + textoffset = text_height + text_gap; + } + } image_width = (symbol->width + xoffset + roffset) * si; image_height = (symbol->height + textoffset + yoffset + boffset) * si; @@ -820,7 +854,7 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int } memset(pixelbuf, DEFAULT_PAPER, image_width * image_height); - default_text_posn = image_height - 17; + default_text_posn = image_height - (textoffset - text_gap) * si; row_height = 0.0f; row_posn = textoffset + yoffset; @@ -880,19 +914,19 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int /* Guard bar extension */ if (upceanflag == 6) { /* UPC-E */ - draw_bar(pixelbuf, (0 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (2 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (46 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (48 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (50 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (0 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (2 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (46 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (48 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (50 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); } else if (upceanflag == 8) { /* EAN-8 */ - draw_bar(pixelbuf, (0 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (2 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (32 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (34 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (64 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (66 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (0 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (2 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (32 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (34 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (64 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (66 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); } else if (upceanflag == 12) { /* UPC-A */ latch = 1; @@ -905,7 +939,7 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int } while ((i + block_width < symbol->width) && module_is_set(symbol, symbol->rows - 1, i + block_width) == module_is_set(symbol, symbol->rows - 1, i)); if (latch == 1) { /* a bar */ - draw_bar(pixelbuf, (i + xoffset - comp_offset) * si, block_width * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (i + xoffset - comp_offset) * si, block_width * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); latch = 0; } else { /* a space */ @@ -913,8 +947,8 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int } i += block_width; } while (i < 11 + comp_offset); - draw_bar(pixelbuf, (46 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (48 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (46 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (48 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); latch = 1; i = 85 + comp_offset; do { @@ -924,7 +958,7 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int } while ((i + block_width < symbol->width) && module_is_set(symbol, symbol->rows - 1, i + block_width) == module_is_set(symbol, symbol->rows - 1, i)); if (latch == 1) { /* a bar */ - draw_bar(pixelbuf, (i + xoffset - comp_offset) * si, block_width * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (i + xoffset - comp_offset) * si, block_width * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); latch = 0; } else { /* a space */ @@ -934,93 +968,98 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int } while (i < 96 + comp_offset); } else if (upceanflag == 13) { /* EAN-13 */ - draw_bar(pixelbuf, (0 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (2 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (46 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (48 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (92 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, (94 + xoffset) * si, 1 * si, (4 + yoffset) * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (0 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (2 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (46 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (48 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (92 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, (94 + xoffset) * si, 1 * si, guardoffset * si, 5 * si, image_width, image_height, DEFAULT_INK); } } if (!hide_text) { if (upceanflag) { + /* Note font sizes halved as in pixels */ + int upcea_width_adj = (UPCEAN_SMALL_FONT_WIDTH + 3) / 4; /* Halved again to get middle position that draw_string() expects */ + int upcea_height_adj = (UPCEAN_FONT_HEIGHT - UPCEAN_SMALL_FONT_HEIGHT) * si / 2; + int ean_width_adj = (UPCEAN_FONT_WIDTH + 3) / 4; /* Halved again to get middle position that draw_string() expects */ + output_upcean_split_text(upceanflag, symbol->text, textpart1, textpart2, textpart3, textpart4); if (upceanflag == 6) { /* UPC-E */ - textpos = (-5 + xoffset) * si; - draw_string(pixelbuf, textpart1, textpos, default_text_posn, textflags, image_width, image_height); + textpos = (-(5 + upcea_width_adj) + xoffset) * si; + draw_string(pixelbuf, textpart1, textpos, default_text_posn + upcea_height_adj, textflags | SMALL_TEXT, image_width, image_height, si); textpos = (24 + xoffset) * si; - draw_string(pixelbuf, textpart2, textpos, default_text_posn, textflags, image_width, image_height); - textpos = (55 + xoffset) * si; - draw_string(pixelbuf, textpart3, textpos, default_text_posn, textflags, image_width, image_height); + draw_string(pixelbuf, textpart2, textpos, default_text_posn, textflags, image_width, image_height, si); + textpos = (51 + 3 + upcea_width_adj + xoffset) * si; + draw_string(pixelbuf, textpart3, textpos, default_text_posn + upcea_height_adj, textflags | SMALL_TEXT, image_width, image_height, si); textdone = 1; switch (ustrlen(addon)) { case 2: textpos = (61 + xoffset + addon_gap) * si; - draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height); + draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height, si); break; case 5: textpos = (75 + xoffset + addon_gap) * si; - draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height); + draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height, si); break; } } else if (upceanflag == 8) { /* EAN-8 */ textpos = (17 + xoffset) * si; - draw_string(pixelbuf, textpart1, textpos, default_text_posn, textflags, image_width, image_height); + draw_string(pixelbuf, textpart1, textpos, default_text_posn, textflags, image_width, image_height, si); textpos = (50 + xoffset) * si; - draw_string(pixelbuf, textpart2, textpos, default_text_posn, textflags, image_width, image_height); + draw_string(pixelbuf, textpart2, textpos, default_text_posn, textflags, image_width, image_height, si); textdone = 1; switch (ustrlen(addon)) { case 2: textpos = (77 + xoffset + addon_gap) * si; - draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height); + draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height, si); break; case 5: textpos = (91 + xoffset + addon_gap) * si; - draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height); + draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height, si); break; } } else if (upceanflag == 12) { /* UPC-A */ - textpos = (-5 + xoffset) * si; - draw_string(pixelbuf, textpart1, textpos, default_text_posn, textflags, image_width, image_height); + textpos = (-(5 + upcea_width_adj) + xoffset) * si; + draw_string(pixelbuf, textpart1, textpos, default_text_posn + upcea_height_adj, textflags | SMALL_TEXT, image_width, image_height, si); textpos = (27 + xoffset) * si; - draw_string(pixelbuf, textpart2, textpos, default_text_posn, textflags, image_width, image_height); - textpos = (68 + xoffset) * si; - draw_string(pixelbuf, textpart3, textpos, default_text_posn, textflags, image_width, image_height); - textpos = (100 + xoffset) * si; - draw_string(pixelbuf, textpart4, textpos, default_text_posn, textflags, image_width, image_height); - textdone = 1; - switch (ustrlen(addon)) { - case 2: - textpos = (107 + xoffset + addon_gap) * si; - draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height); - break; - case 5: - textpos = (121 + xoffset + addon_gap) * si; - draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height); - break; - } - - } else if (upceanflag == 13) { /* EAN-13 */ - textpos = (-7 + xoffset) * si; - draw_string(pixelbuf, textpart1, textpos, default_text_posn, textflags, image_width, image_height); - textpos = (24 + xoffset) * si; - draw_string(pixelbuf, textpart2, textpos, default_text_posn, textflags, image_width, image_height); - textpos = (71 + xoffset) * si; - draw_string(pixelbuf, textpart3, textpos, default_text_posn, textflags, image_width, image_height); + draw_string(pixelbuf, textpart2, textpos, default_text_posn, textflags, image_width, image_height, si); + textpos = (67 + xoffset) * si; + draw_string(pixelbuf, textpart3, textpos, default_text_posn, textflags, image_width, image_height, si); + textpos = (95 + 5 + upcea_width_adj + xoffset) * si; + draw_string(pixelbuf, textpart4, textpos, default_text_posn + upcea_height_adj, textflags | SMALL_TEXT, image_width, image_height, si); textdone = 1; switch (ustrlen(addon)) { case 2: textpos = (105 + xoffset + addon_gap) * si; - draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height); + draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height, si); break; case 5: textpos = (119 + xoffset + addon_gap) * si; - draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height); + draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height, si); + break; + } + + } else if (upceanflag == 13) { /* EAN-13 */ + textpos = (-(5 + ean_width_adj) + xoffset) * si; + draw_string(pixelbuf, textpart1, textpos, default_text_posn, textflags, image_width, image_height, si); + textpos = (24 + xoffset) * si; + draw_string(pixelbuf, textpart2, textpos, default_text_posn, textflags, image_width, image_height, si); + textpos = (71 + xoffset) * si; + draw_string(pixelbuf, textpart3, textpos, default_text_posn, textflags, image_width, image_height, si); + textdone = 1; + switch (ustrlen(addon)) { + case 2: + textpos = (105 + xoffset + addon_gap) * si; + draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height, si); + break; + case 5: + textpos = (119 + xoffset + addon_gap) * si; + draw_string(pixelbuf, addon, textpos, addon_text_posn, textflags, image_width, image_height, si); break; } } @@ -1031,7 +1070,7 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int to_iso8859_1(symbol->text, local_text); /* Put the human readable text at the bottom */ textpos = (main_width / 2 + xoffset) * si; - draw_string(pixelbuf, local_text, textpos, default_text_posn, textflags, image_width, image_height); + draw_string(pixelbuf, local_text, textpos, default_text_posn, textflags, image_width, image_height, si); } } diff --git a/backend/tests/data/png/ean13_2addon_ggs_5.2.2.5.1-2.png b/backend/tests/data/png/ean13_2addon_ggs_5.2.2.5.1-2.png index bb63e837..171504c5 100644 Binary files a/backend/tests/data/png/ean13_2addon_ggs_5.2.2.5.1-2.png and b/backend/tests/data/png/ean13_2addon_ggs_5.2.2.5.1-2.png differ diff --git a/backend/tests/data/png/ean13_5addon_ggs_5.2.2.5.2-2.png b/backend/tests/data/png/ean13_5addon_ggs_5.2.2.5.2-2.png index c9f5b36a..e1925c96 100644 Binary files a/backend/tests/data/png/ean13_5addon_ggs_5.2.2.5.2-2.png and b/backend/tests/data/png/ean13_5addon_ggs_5.2.2.5.2-2.png differ diff --git a/backend/tests/data/png/ean2.png b/backend/tests/data/png/ean2.png index b631d74c..dc530243 100644 Binary files a/backend/tests/data/png/ean2.png and b/backend/tests/data/png/ean2.png differ diff --git a/backend/tests/data/png/ean5.png b/backend/tests/data/png/ean5.png index 8ecf3461..1b1316b6 100644 Binary files a/backend/tests/data/png/ean5.png and b/backend/tests/data/png/ean5.png differ diff --git a/backend/tests/data/png/ean8_2addon.png b/backend/tests/data/png/ean8_2addon.png index c6173982..0e130246 100644 Binary files a/backend/tests/data/png/ean8_2addon.png and b/backend/tests/data/png/ean8_2addon.png differ diff --git a/backend/tests/data/png/ean8_5addon.png b/backend/tests/data/png/ean8_5addon.png index 650f46b8..1ef86bc4 100644 Binary files a/backend/tests/data/png/ean8_5addon.png and b/backend/tests/data/png/ean8_5addon.png differ diff --git a/backend/tests/data/png/upca_2addon_ggs_5.2.6.6-5.png b/backend/tests/data/png/upca_2addon_ggs_5.2.6.6-5.png index 2bf091d8..de571a36 100644 Binary files a/backend/tests/data/png/upca_2addon_ggs_5.2.6.6-5.png and b/backend/tests/data/png/upca_2addon_ggs_5.2.6.6-5.png differ diff --git a/backend/tests/data/png/upca_5addon.png b/backend/tests/data/png/upca_5addon.png index d135b8b4..b2e69a0f 100644 Binary files a/backend/tests/data/png/upca_5addon.png and b/backend/tests/data/png/upca_5addon.png differ diff --git a/backend/tests/data/png/upce_2addon.png b/backend/tests/data/png/upce_2addon.png index 1886da8f..4f156427 100644 Binary files a/backend/tests/data/png/upce_2addon.png and b/backend/tests/data/png/upce_2addon.png differ diff --git a/backend/tests/data/png/upce_5addon.png b/backend/tests/data/png/upce_5addon.png index 2dc34601..72dac18c 100644 Binary files a/backend/tests/data/png/upce_5addon.png and b/backend/tests/data/png/upce_5addon.png differ diff --git a/backend/tests/data/print/bmp/code128_aim.bmp b/backend/tests/data/print/bmp/code128_aim.bmp index 20a3ce29..60469426 100644 Binary files a/backend/tests/data/print/bmp/code128_aim.bmp and b/backend/tests/data/print/bmp/code128_aim.bmp differ diff --git a/backend/tests/data/print/gif/code128_aim.gif b/backend/tests/data/print/gif/code128_aim.gif index 9e43e914..d51ac5a7 100644 Binary files a/backend/tests/data/print/gif/code128_aim.gif and b/backend/tests/data/print/gif/code128_aim.gif differ diff --git a/backend/tests/data/print/pcx/code128_aim.pcx b/backend/tests/data/print/pcx/code128_aim.pcx index d26466d4..899c3d35 100644 Binary files a/backend/tests/data/print/pcx/code128_aim.pcx and b/backend/tests/data/print/pcx/code128_aim.pcx differ diff --git a/backend/tests/data/print/png/code128_aim.png b/backend/tests/data/print/png/code128_aim.png index 41b9d0bc..e961266d 100644 Binary files a/backend/tests/data/print/png/code128_aim.png and b/backend/tests/data/print/png/code128_aim.png differ diff --git a/backend/tests/data/print/tif/code128_aim.tif b/backend/tests/data/print/tif/code128_aim.tif index 17820791..70c67f0c 100644 Binary files a/backend/tests/data/print/tif/code128_aim.tif and b/backend/tests/data/print/tif/code128_aim.tif differ diff --git a/backend/tests/test_raster.c b/backend/tests/test_raster.c index 7c8a757a..d36fcf27 100644 --- a/backend/tests/test_raster.c +++ b/backend/tests/test_raster.c @@ -60,10 +60,10 @@ static void test_options(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_CODE128, "123456", "7890AB", 0, "A", 0, 1, 46, 92, 118 }, - /* 1*/ { BARCODE_CODE128, "123456", "7890ab", 90, "A", 0, 1, 46, 118, 92 }, - /* 2*/ { BARCODE_CODE128, NULL, NULL, 180, "A", 0, 1, 46, 92, 118 }, - /* 3*/ { BARCODE_CODE128, NULL, NULL, 270, "A", 0, 1, 46, 118, 92 }, + /* 0*/ { BARCODE_CODE128, "123456", "7890AB", 0, "A", 0, 1, 46, 92, 116 }, + /* 1*/ { BARCODE_CODE128, "123456", "7890ab", 90, "A", 0, 1, 46, 116, 92 }, + /* 2*/ { BARCODE_CODE128, NULL, NULL, 180, "A", 0, 1, 46, 92, 116 }, + /* 3*/ { BARCODE_CODE128, NULL, NULL, 270, "A", 0, 1, 46, 116, 92 }, /* 4*/ { BARCODE_CODE128, NULL, NULL, 181, "A", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1 }, /* 5*/ { BARCODE_CODE128, "12345", NULL, 0, "A", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1 }, /* 6*/ { BARCODE_CODE128, NULL, "1234567", 0, "A", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1 }, @@ -121,126 +121,126 @@ static void test_buffer(int index, int generate, int debug) { int expected_bitmap_height; }; struct item data[] = { - /* 0*/ { BARCODE_CODE11, "0000000000", "", 50, 1, 99, 198, 118 }, - /* 1*/ { BARCODE_C25STANDARD, "0000000000", "", 50, 1, 117, 234, 118 }, - /* 2*/ { BARCODE_C25INTER, "0000000000", "", 50, 1, 99, 198, 118 }, - /* 3*/ { BARCODE_C25IATA, "0000000000", "", 50, 1, 149, 298, 118 }, - /* 4*/ { BARCODE_C25LOGIC, "0000000000", "", 50, 1, 109, 218, 118 }, - /* 5*/ { BARCODE_C25IND, "0000000000", "", 50, 1, 159, 318, 118 }, - /* 6*/ { BARCODE_CODE39, "0000000000", "", 50, 1, 155, 310, 118 }, - /* 7*/ { BARCODE_EXCODE39, "0000000000", "", 50, 1, 155, 310, 118 }, - /* 8*/ { BARCODE_EANX, "123456789012", "", 50, 1, 95, 226, 118 }, - /* 9*/ { BARCODE_EANX_CHK, "1234567890128", "", 50, 1, 95, 226, 118 }, - /* 10*/ { BARCODE_EANX, "123456789012+12", "", 50, 1, 122, 276, 118 }, - /* 11*/ { BARCODE_EANX_CHK, "1234567890128+12", "", 50, 1, 122, 276, 118 }, - /* 12*/ { BARCODE_EANX, "123456789012+12345", "", 50, 1, 149, 330, 118 }, - /* 13*/ { BARCODE_EANX_CHK, "1234567890128+12345", "", 50, 1, 149, 330, 118 }, - /* 14*/ { BARCODE_EANX, "1234567", "", 50, 1, 67, 162, 118 }, - /* 15*/ { BARCODE_EANX_CHK, "12345670", "", 50, 1, 67, 162, 118 }, - /* 16*/ { BARCODE_EANX, "1234567+12", "", 50, 1, 94, 216, 118 }, - /* 17*/ { BARCODE_EANX_CHK, "12345670+12", "", 50, 1, 94, 216, 118 }, - /* 18*/ { BARCODE_EANX, "1234567+12345", "", 50, 1, 121, 270, 118 }, - /* 19*/ { BARCODE_EANX_CHK, "12345670+12345", "", 50, 1, 121, 270, 118 }, - /* 20*/ { BARCODE_EANX, "1234", "", 50, 1, 47, 118, 118 }, - /* 21*/ { BARCODE_EANX_CHK, "1234", "", 50, 1, 47, 118, 118 }, - /* 22*/ { BARCODE_EANX, "12", "", 50, 1, 20, 64, 118 }, - /* 23*/ { BARCODE_EANX_CHK, "12", "", 50, 1, 20, 64, 118 }, - /* 24*/ { BARCODE_GS1_128, "[01]12345678901234", "", 50, 1, 134, 268, 118 }, - /* 25*/ { BARCODE_CODABAR, "A00000000B", "", 50, 1, 102, 204, 118 }, - /* 26*/ { BARCODE_CODE128, "0000000000", "", 50, 1, 90, 180, 118 }, - /* 27*/ { BARCODE_DPLEIT, "1234567890123", "", 50, 1, 135, 270, 118 }, - /* 28*/ { BARCODE_DPIDENT, "12345678901", "", 50, 1, 117, 234, 118 }, + /* 0*/ { BARCODE_CODE11, "0000000000", "", 50, 1, 99, 198, 116 }, + /* 1*/ { BARCODE_C25STANDARD, "0000000000", "", 50, 1, 117, 234, 116 }, + /* 2*/ { BARCODE_C25INTER, "0000000000", "", 50, 1, 99, 198, 116 }, + /* 3*/ { BARCODE_C25IATA, "0000000000", "", 50, 1, 149, 298, 116 }, + /* 4*/ { BARCODE_C25LOGIC, "0000000000", "", 50, 1, 109, 218, 116 }, + /* 5*/ { BARCODE_C25IND, "0000000000", "", 50, 1, 159, 318, 116 }, + /* 6*/ { BARCODE_CODE39, "0000000000", "", 50, 1, 155, 310, 116 }, + /* 7*/ { BARCODE_EXCODE39, "0000000000", "", 50, 1, 155, 310, 116 }, + /* 8*/ { BARCODE_EANX, "123456789012", "", 50, 1, 95, 226, 116 }, + /* 9*/ { BARCODE_EANX_CHK, "1234567890128", "", 50, 1, 95, 226, 116 }, + /* 10*/ { BARCODE_EANX, "123456789012+12", "", 50, 1, 122, 276, 116 }, + /* 11*/ { BARCODE_EANX_CHK, "1234567890128+12", "", 50, 1, 122, 276, 116 }, + /* 12*/ { BARCODE_EANX, "123456789012+12345", "", 50, 1, 149, 330, 116 }, + /* 13*/ { BARCODE_EANX_CHK, "1234567890128+12345", "", 50, 1, 149, 330, 116 }, + /* 14*/ { BARCODE_EANX, "1234567", "", 50, 1, 67, 162, 116 }, + /* 15*/ { BARCODE_EANX_CHK, "12345670", "", 50, 1, 67, 162, 116 }, + /* 16*/ { BARCODE_EANX, "1234567+12", "", 50, 1, 94, 216, 116 }, + /* 17*/ { BARCODE_EANX_CHK, "12345670+12", "", 50, 1, 94, 216, 116 }, + /* 18*/ { BARCODE_EANX, "1234567+12345", "", 50, 1, 121, 270, 116 }, + /* 19*/ { BARCODE_EANX_CHK, "12345670+12345", "", 50, 1, 121, 270, 116 }, + /* 20*/ { BARCODE_EANX, "1234", "", 50, 1, 47, 118, 116 }, + /* 21*/ { BARCODE_EANX_CHK, "1234", "", 50, 1, 47, 118, 116 }, + /* 22*/ { BARCODE_EANX, "12", "", 50, 1, 20, 64, 116 }, + /* 23*/ { BARCODE_EANX_CHK, "12", "", 50, 1, 20, 64, 116 }, + /* 24*/ { BARCODE_GS1_128, "[01]12345678901234", "", 50, 1, 134, 268, 116 }, + /* 25*/ { BARCODE_CODABAR, "A00000000B", "", 50, 1, 102, 204, 116 }, + /* 26*/ { BARCODE_CODE128, "0000000000", "", 50, 1, 90, 180, 116 }, + /* 27*/ { BARCODE_DPLEIT, "1234567890123", "", 50, 1, 135, 270, 116 }, + /* 28*/ { BARCODE_DPIDENT, "12345678901", "", 50, 1, 117, 234, 116 }, /* 29*/ { BARCODE_CODE16K, "0000000000", "", 20, 2, 70, 162, 44 }, /* 30*/ { BARCODE_CODE49, "0000000000", "", 20, 2, 70, 162, 44 }, - /* 31*/ { BARCODE_CODE93, "0000000000", "", 50, 1, 127, 254, 118 }, + /* 31*/ { BARCODE_CODE93, "0000000000", "", 50, 1, 127, 254, 116 }, /* 32*/ { BARCODE_FLAT, "1234567890", "", 50, 1, 90, 180, 100 }, - /* 33*/ { BARCODE_DBAR_OMN, "1234567890123", "", 50, 1, 96, 192, 118 }, - /* 34*/ { BARCODE_DBAR_LTD, "1234567890123", "", 50, 1, 79, 158, 118 }, - /* 35*/ { BARCODE_DBAR_EXP, "[01]12345678901234", "", 34, 1, 134, 268, 86 }, - /* 36*/ { BARCODE_TELEPEN, "0000000000", "", 50, 1, 208, 416, 118 }, - /* 37*/ { BARCODE_UPCA, "12345678904", "", 50, 1, 95, 226, 118 }, - /* 38*/ { BARCODE_UPCA_CHK, "123456789043", "", 50, 1, 95, 226, 118 }, - /* 39*/ { BARCODE_UPCA, "12345678904+12", "", 50, 1, 124, 276, 118 }, - /* 40*/ { BARCODE_UPCA_CHK, "123456789043+12", "", 50, 1, 124, 276, 118 }, - /* 41*/ { BARCODE_UPCA, "12345678904+12345", "", 50, 1, 151, 330, 118 }, - /* 42*/ { BARCODE_UPCA_CHK, "123456789043+12345", "", 50, 1, 151, 330, 118 }, - /* 43*/ { BARCODE_UPCE, "1234567", "", 50, 1, 51, 134, 118 }, - /* 44*/ { BARCODE_UPCE_CHK, "12345670", "", 50, 1, 51, 134, 118 }, - /* 45*/ { BARCODE_UPCE, "1234567+12", "", 50, 1, 78, 184, 118 }, - /* 46*/ { BARCODE_UPCE_CHK, "12345670+12", "", 50, 1, 78, 184, 118 }, - /* 47*/ { BARCODE_UPCE, "1234567+12345", "", 50, 1, 105, 238, 118 }, - /* 48*/ { BARCODE_UPCE_CHK, "12345670+12345", "", 50, 1, 105, 238, 118 }, + /* 33*/ { BARCODE_DBAR_OMN, "1234567890123", "", 50, 1, 96, 192, 116 }, + /* 34*/ { BARCODE_DBAR_LTD, "1234567890123", "", 50, 1, 79, 158, 116 }, + /* 35*/ { BARCODE_DBAR_EXP, "[01]12345678901234", "", 34, 1, 134, 268, 84 }, + /* 36*/ { BARCODE_TELEPEN, "0000000000", "", 50, 1, 208, 416, 116 }, + /* 37*/ { BARCODE_UPCA, "12345678904", "", 50, 1, 95, 226, 116 }, + /* 38*/ { BARCODE_UPCA_CHK, "123456789043", "", 50, 1, 95, 226, 116 }, + /* 39*/ { BARCODE_UPCA, "12345678904+12", "", 50, 1, 124, 276, 116 }, + /* 40*/ { BARCODE_UPCA_CHK, "123456789043+12", "", 50, 1, 124, 276, 116 }, + /* 41*/ { BARCODE_UPCA, "12345678904+12345", "", 50, 1, 151, 330, 116 }, + /* 42*/ { BARCODE_UPCA_CHK, "123456789043+12345", "", 50, 1, 151, 330, 116 }, + /* 43*/ { BARCODE_UPCE, "1234567", "", 50, 1, 51, 134, 116 }, + /* 44*/ { BARCODE_UPCE_CHK, "12345670", "", 50, 1, 51, 134, 116 }, + /* 45*/ { BARCODE_UPCE, "1234567+12", "", 50, 1, 78, 184, 116 }, + /* 46*/ { BARCODE_UPCE_CHK, "12345670+12", "", 50, 1, 78, 184, 116 }, + /* 47*/ { BARCODE_UPCE, "1234567+12345", "", 50, 1, 105, 238, 116 }, + /* 48*/ { BARCODE_UPCE_CHK, "12345670+12345", "", 50, 1, 105, 238, 116 }, /* 49*/ { BARCODE_POSTNET, "00000000000", "", 12, 2, 185, 370, 24 }, - /* 50*/ { BARCODE_MSI_PLESSEY, "0000000000", "", 50, 1, 127, 254, 118 }, + /* 50*/ { BARCODE_MSI_PLESSEY, "0000000000", "", 50, 1, 127, 254, 116 }, /* 51*/ { BARCODE_FIM, "A", "", 50, 1, 17, 34, 100 }, - /* 52*/ { BARCODE_LOGMARS, "0000000000", "", 50, 1, 191, 382, 118 }, + /* 52*/ { BARCODE_LOGMARS, "0000000000", "", 50, 1, 191, 382, 116 }, /* 53*/ { BARCODE_PHARMA, "123456", "", 50, 1, 58, 116, 100 }, - /* 54*/ { BARCODE_PZN, "123456", "", 50, 1, 142, 284, 118 }, + /* 54*/ { BARCODE_PZN, "123456", "", 50, 1, 142, 284, 116 }, /* 55*/ { BARCODE_PHARMA_TWO, "12345678", "", 10, 2, 29, 58, 20 }, /* 56*/ { BARCODE_PDF417, "0000000000", "", 21, 7, 103, 206, 42 }, /* 57*/ { BARCODE_PDF417COMP, "0000000000", "", 21, 7, 69, 138, 42 }, - /* 58*/ { BARCODE_MAXICODE, "0000000000", "", 165, 33, 30, 300, 300 }, // Differs from vector + /* 58*/ { BARCODE_MAXICODE, "0000000000", "", 165, 33, 30, 300, 300 }, /* 59*/ { BARCODE_QRCODE, "1234567890AB", "", 21, 21, 21, 42, 42 }, - /* 60*/ { BARCODE_CODE128B, "0000000000", "", 50, 1, 145, 290, 118 }, + /* 60*/ { BARCODE_CODE128B, "0000000000", "", 50, 1, 145, 290, 116 }, /* 61*/ { BARCODE_AUSPOST, "12345678901234567890123", "", 8, 3, 133, 266, 16 }, /* 62*/ { BARCODE_AUSREPLY, "12345678", "", 8, 3, 73, 146, 16 }, /* 63*/ { BARCODE_AUSROUTE, "12345678", "", 8, 3, 73, 146, 16 }, /* 64*/ { BARCODE_AUSREDIRECT, "12345678", "", 8, 3, 73, 146, 16 }, - /* 65*/ { BARCODE_ISBNX, "123456789", "", 50, 1, 95, 226, 118 }, - /* 66*/ { BARCODE_ISBNX, "123456789+12", "", 50, 1, 122, 276, 118 }, - /* 67*/ { BARCODE_ISBNX, "123456789+12345", "", 50, 1, 149, 330, 118 }, + /* 65*/ { BARCODE_ISBNX, "123456789", "", 50, 1, 95, 226, 116 }, + /* 66*/ { BARCODE_ISBNX, "123456789+12", "", 50, 1, 122, 276, 116 }, + /* 67*/ { BARCODE_ISBNX, "123456789+12345", "", 50, 1, 149, 330, 116 }, /* 68*/ { BARCODE_RM4SCC, "0000000000", "", 8, 3, 91, 182, 16 }, /* 69*/ { BARCODE_DATAMATRIX, "ABC", "", 10, 10, 10, 20, 20 }, - /* 70*/ { BARCODE_EAN14, "1234567890123", "", 50, 1, 134, 268, 118 }, - /* 71*/ { BARCODE_VIN, "00000000000000000", "", 50, 1, 246, 492, 118 }, + /* 70*/ { BARCODE_EAN14, "1234567890123", "", 50, 1, 134, 268, 116 }, + /* 71*/ { BARCODE_VIN, "00000000000000000", "", 50, 1, 246, 492, 116 }, /* 72*/ { BARCODE_CODABLOCKF, "0000000000", "", 20, 2, 101, 242, 44 }, - /* 73*/ { BARCODE_NVE18, "12345678901234567", "", 50, 1, 156, 312, 118 }, + /* 73*/ { BARCODE_NVE18, "12345678901234567", "", 50, 1, 156, 312, 116 }, /* 74*/ { BARCODE_JAPANPOST, "0000000000", "", 8, 3, 133, 266, 16 }, - /* 75*/ { BARCODE_KOREAPOST, "123456", "", 50, 1, 167, 334, 118 }, + /* 75*/ { BARCODE_KOREAPOST, "123456", "", 50, 1, 167, 334, 116 }, /* 76*/ { BARCODE_DBAR_STK, "0000000000000", "", 13, 3, 50, 100, 26 }, /* 77*/ { BARCODE_DBAR_OMNSTK, "0000000000000", "", 69, 5, 50, 100, 138 }, /* 78*/ { BARCODE_DBAR_EXPSTK, "[01]12345678901234", "", 71, 5, 102, 204, 142 }, /* 79*/ { BARCODE_PLANET, "00000000000", "", 12, 2, 185, 370, 24 }, /* 80*/ { BARCODE_MICROPDF417, "0000000000", "", 12, 6, 82, 164, 24 }, /* 81*/ { BARCODE_USPS_IMAIL, "12345678901234567890", "", 8, 3, 129, 258, 16 }, - /* 82*/ { BARCODE_PLESSEY, "0000000000", "", 50, 1, 227, 454, 118 }, - /* 83*/ { BARCODE_TELEPEN_NUM, "0000000000", "", 50, 1, 128, 256, 118 }, - /* 84*/ { BARCODE_ITF14, "0000000000", "", 50, 1, 135, 330, 138 }, + /* 82*/ { BARCODE_PLESSEY, "0000000000", "", 50, 1, 227, 454, 116 }, + /* 83*/ { BARCODE_TELEPEN_NUM, "0000000000", "", 50, 1, 128, 256, 116 }, + /* 84*/ { BARCODE_ITF14, "0000000000", "", 50, 1, 135, 330, 136 }, /* 85*/ { BARCODE_KIX, "123456ABCDE", "", 8, 3, 87, 174, 16 }, /* 86*/ { BARCODE_AZTEC, "1234567890AB", "", 15, 15, 15, 30, 30 }, /* 87*/ { BARCODE_DAFT, "DAFTDAFTDAFTDAFT", "", 8, 3, 31, 62, 16 }, - /* 88*/ { BARCODE_DPD, "0123456789012345678901234567", "", 50, 1, 189, 378, 118 }, + /* 88*/ { BARCODE_DPD, "0123456789012345678901234567", "", 50, 1, 189, 378, 116 }, /* 89*/ { BARCODE_MICROQR, "12345", "", 11, 11, 11, 22, 22 }, - /* 90*/ { BARCODE_HIBC_128, "0000000000", "", 50, 1, 134, 268, 118 }, - /* 91*/ { BARCODE_HIBC_39, "0000000000", "", 50, 1, 223, 446, 118 }, + /* 90*/ { BARCODE_HIBC_128, "0000000000", "", 50, 1, 134, 268, 116 }, + /* 91*/ { BARCODE_HIBC_39, "0000000000", "", 50, 1, 223, 446, 116 }, /* 92*/ { BARCODE_HIBC_DM, "ABC", "", 12, 12, 12, 24, 24 }, /* 93*/ { BARCODE_HIBC_QR, "1234567890AB", "", 21, 21, 21, 42, 42 }, /* 94*/ { BARCODE_HIBC_PDF, "0000000000", "", 27, 9, 103, 206, 54 }, /* 95*/ { BARCODE_HIBC_MICPDF, "0000000000", "", 34, 17, 38, 76, 68 }, /* 96*/ { BARCODE_HIBC_BLOCKF, "0000000000", "", 30, 3, 101, 242, 64 }, /* 97*/ { BARCODE_HIBC_AZTEC, "1234567890AB", "", 19, 19, 19, 38, 38 }, - /* 98*/ { BARCODE_DOTCODE, "ABC", "", 11, 11, 16, 33, 23 }, // Differs from vector + /* 98*/ { BARCODE_DOTCODE, "ABC", "", 11, 11, 16, 33, 23 }, /* 99*/ { BARCODE_HANXIN, "1234567890AB", "", 23, 23, 23, 46, 46 }, /*100*/ { BARCODE_MAILMARK, "01000000000000000AA00AA0A", "", 10, 3, 155, 310, 20 }, /*101*/ { BARCODE_AZRUNE, "255", "", 11, 11, 11, 22, 22 }, - /*102*/ { BARCODE_CODE32, "12345678", "", 50, 1, 103, 206, 118 }, - /*103*/ { BARCODE_EANX_CC, "123456789012", "[20]01", 50, 7, 99, 234, 118 }, - /*104*/ { BARCODE_EANX_CC, "123456789012+12", "[20]01", 50, 7, 126, 284, 118 }, - /*105*/ { BARCODE_EANX_CC, "123456789012+12345", "[20]01", 50, 7, 153, 338, 118 }, - /*106*/ { BARCODE_GS1_128_CC, "[01]12345678901234", "[20]01", 50, 5, 145, 290, 118 }, - /*107*/ { BARCODE_DBAR_OMN_CC, "1234567890123", "[20]01", 21, 5, 100, 200, 60 }, - /*108*/ { BARCODE_DBAR_LTD_CC, "1234567890123", "[20]01", 19, 6, 79, 158, 56 }, - /*109*/ { BARCODE_DBAR_EXP_CC, "[01]12345678901234", "[20]01", 41, 5, 134, 268, 100 }, - /*110*/ { BARCODE_UPCA_CC, "12345678901", "[20]01", 50, 7, 99, 234, 118 }, - /*111*/ { BARCODE_UPCA_CC, "12345678901+12", "[20]01", 50, 7, 128, 284, 118 }, - /*112*/ { BARCODE_UPCA_CC, "12345678901+12345", "[20]01", 50, 7, 155, 338, 118 }, - /*113*/ { BARCODE_UPCE_CC, "1234567", "[20]01", 50, 9, 55, 142, 118 }, - /*114*/ { BARCODE_UPCE_CC, "1234567+12", "[20]01", 50, 9, 82, 192, 118 }, - /*115*/ { BARCODE_UPCE_CC, "1234567+12345", "[20]01", 50, 9, 109, 246, 118 }, + /*102*/ { BARCODE_CODE32, "12345678", "", 50, 1, 103, 206, 116 }, + /*103*/ { BARCODE_EANX_CC, "123456789012", "[20]01", 50, 7, 99, 234, 116 }, + /*104*/ { BARCODE_EANX_CC, "123456789012+12", "[20]01", 50, 7, 126, 284, 116 }, + /*105*/ { BARCODE_EANX_CC, "123456789012+12345", "[20]01", 50, 7, 153, 338, 116 }, + /*106*/ { BARCODE_GS1_128_CC, "[01]12345678901234", "[20]01", 50, 5, 145, 290, 116 }, + /*107*/ { BARCODE_DBAR_OMN_CC, "1234567890123", "[20]01", 21, 5, 100, 200, 58 }, + /*108*/ { BARCODE_DBAR_LTD_CC, "1234567890123", "[20]01", 19, 6, 79, 158, 54 }, + /*109*/ { BARCODE_DBAR_EXP_CC, "[01]12345678901234", "[20]01", 41, 5, 134, 268, 98 }, + /*110*/ { BARCODE_UPCA_CC, "12345678901", "[20]01", 50, 7, 99, 234, 116 }, + /*111*/ { BARCODE_UPCA_CC, "12345678901+12", "[20]01", 50, 7, 128, 284, 116 }, + /*112*/ { BARCODE_UPCA_CC, "12345678901+12345", "[20]01", 50, 7, 155, 338, 116 }, + /*113*/ { BARCODE_UPCE_CC, "1234567", "[20]01", 50, 9, 55, 142, 116 }, + /*114*/ { BARCODE_UPCE_CC, "1234567+12", "[20]01", 50, 9, 82, 192, 116 }, + /*115*/ { BARCODE_UPCE_CC, "1234567+12345", "[20]01", 50, 9, 109, 246, 116 }, /*116*/ { BARCODE_DBAR_STK_CC, "0000000000000", "[20]01", 24, 9, 56, 112, 48 }, /*117*/ { BARCODE_DBAR_OMNSTK_CC, "0000000000000", "[20]01", 80, 11, 56, 112, 160 }, /*118*/ { BARCODE_DBAR_EXPSTK_CC, "[01]12345678901234", "[20]01", 78, 9, 102, 204, 156 }, - /*119*/ { BARCODE_CHANNEL, "00", "", 50, 1, 19, 38, 118 }, + /*119*/ { BARCODE_CHANNEL, "00", "", 50, 1, 19, 38, 116 }, /*120*/ { BARCODE_CODEONE, "12345678901234567890", "", 22, 22, 22, 44, 44 }, /*121*/ { BARCODE_GRIDMATRIX, "ABC", "", 18, 18, 18, 36, 36 }, /*122*/ { BARCODE_UPNQR, "1234567890AB", "", 77, 77, 77, 154, 154 }, @@ -322,38 +322,38 @@ static void test_upcean_hrt(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_EANX, -1, "123456789012", 0, 50, 1, 95, 226, 118, 103 /*text_row*/, 0, 20, -1, -1, -1 }, // EAN-13 - /* 1*/ { BARCODE_EANX, 0, "123456789012", 0, 50, 1, 95, 226, 118, 103 /*text_row*/, 0, 20, -1, -1, -1 }, // EAN-13 - /* 2*/ { BARCODE_EANX_CHK, -1, "1234567890128", 0, 50, 1, 95, 226, 118, 103 /*text_row*/, 0, 20, -1, -1, -1 }, // EAN-13 - /* 3*/ { BARCODE_EANX_CHK, 0, "1234567890128", 0, 50, 1, 95, 226, 118, 103 /*text_row*/, 0, 20, -1, -1, -1 }, // EAN-13 - /* 4*/ { BARCODE_EANX_CHK, -1, "1234567890128+12", 0, 50, 1, 122, 276, 118, 103 /*text_row*/, 0, 20, 5, 212, 64 }, // EAN-13 + EAN-2 - /* 5*/ { BARCODE_EANX_CHK, 0, "1234567890128+12", 0, 50, 1, 122, 276, 118, 103 /*text_row*/, 0, 20, 5, 212, 64 }, // EAN-13 + EAN-2 - /* 6*/ { BARCODE_EANX, -1, "1234567890128+12345", 0, 50, 1, 149, 330, 118, 103 /*text_row*/, 0, 20, 5, 212, 118 }, // EAN-13 + EAN-5 - /* 7*/ { BARCODE_EANX, 0, "1234567890128+12345", 0, 50, 1, 149, 330, 118, 103 /*text_row*/, 0, 20, 5, 212, 118 }, // EAN-13 + EAN-5 - /* 8*/ { BARCODE_ISBNX, -1, "9784567890120+12345", 0, 50, 1, 149, 330, 118, 103 /*text_row*/, 0, 20, 5, 212, 118 }, // ISBNX + EAN-5 - /* 9*/ { BARCODE_ISBNX, 0, "9784567890120+12345", 0, 50, 1, 149, 330, 118, 103 /*text_row*/, 0, 20, 5, 212, 118 }, // ISBNX + EAN-5 - /* 10*/ { BARCODE_EANX, -1, "123456", 0, 50, 1, 67, 162, 118, 103 /*text_row*/, 20, 58, -1, -1, -1 }, // EAN-8 - /* 11*/ { BARCODE_EANX, 0, "123456", 0, 50, 1, 67, 162, 118, 103 /*text_row*/, 20, 58, -1, -1, -1 }, // EAN-8 - /* 12*/ { BARCODE_EANX, -1, "123456+12", 0, 50, 1, 94, 216, 118, 103 /*text_row*/, 20, 58, 5, 148, 68 }, // EAN-8 + EAN-2 - /* 13*/ { BARCODE_EANX, 0, "123456+12", 0, 50, 1, 94, 216, 118, 103 /*text_row*/, 20, 58, 5, 148, 68 }, // EAN-8 + EAN-2 - /* 14*/ { BARCODE_EANX, -1, "123456+12345", 0, 50, 1, 121, 270, 118, 103 /*text_row*/, 20, 58, 5, 148, 122 }, // EAN-8 + EAN-5 - /* 15*/ { BARCODE_EANX, 0, "123456+12345", 0, 50, 1, 121, 270, 118, 103 /*text_row*/, 20, 58, 5, 148, 122 }, // EAN-8 + EAN-5 - /* 16*/ { BARCODE_EANX, -1, "1234", 0, 50, 1, 47, 118, 118, 103 /*text_row*/, 40, 36, -1, -1, -1 }, // EAN-5 - /* 17*/ { BARCODE_EANX, 0, "1234", 0, 50, 1, 47, 118, 118, 103 /*text_row*/, 40, 36, -1, -1, -1 }, // EAN-5 - /* 18*/ { BARCODE_EANX, -1, "12", 0, 50, 1, 20, 64, 118, 103 /*text_row*/, 20, 20, -1, -1, -1 }, // EAN-2 - /* 19*/ { BARCODE_EANX, 0, "12", 0, 50, 1, 20, 64, 118, 103 /*text_row*/, 20, 20, -1, -1, -1 }, // EAN-2 - /* 20*/ { BARCODE_UPCA, -1, "123456789012", 0, 50, 1, 95, 226, 118, 103 /*text_row*/, 0, 18, -1, -1, -1 }, - /* 21*/ { BARCODE_UPCA, 0, "123456789012", 0, 50, 1, 95, 226, 118, 103 /*text_row*/, 0, 18, -1, -1, -1 }, - /* 22*/ { BARCODE_UPCA, -1, "123456789012+12", 0, 50, 1, 124, 276, 118, 103 /*text_row*/, 0, 18, 5, 208, 68 }, - /* 23*/ { BARCODE_UPCA, 0, "123456789012+12", 0, 50, 1, 124, 276, 118, 103 /*text_row*/, 0, 18, 5, 208, 68 }, - /* 24*/ { BARCODE_UPCA_CHK, -1, "123456789012+12345", 0, 50, 1, 151, 330, 118, 103 /*text_row*/, 0, 18, 5, 208, 122 }, - /* 25*/ { BARCODE_UPCA_CHK, 0, "123456789012+12345", 0, 50, 1, 151, 330, 118, 103 /*text_row*/, 0, 18, 5, 208, 122 }, - /* 26*/ { BARCODE_UPCE, -1, "1234567", 0, 50, 1, 51, 134, 118, 103 /*text_row*/, 0, 18, -1, -1, -1 }, - /* 27*/ { BARCODE_UPCE, 0, "1234567", 0, 50, 1, 51, 134, 118, 103 /*text_row*/, 0, 18, -1, -1, -1 }, - /* 28*/ { BARCODE_UPCE_CHK, -1, "12345670+12", 0, 50, 1, 78, 184, 118, 103 /*text_row*/, 0, 18, 5, 120, 64 }, - /* 29*/ { BARCODE_UPCE_CHK, 0, "12345670+12", 0, 50, 1, 78, 184, 118, 103 /*text_row*/, 0, 18, 5, 120, 64 }, - /* 30*/ { BARCODE_UPCE, -1, "1234567+12345", 0, 50, 1, 105, 238, 118, 103 /*text_row*/, 0, 18, 5, 120, 118 }, - /* 31*/ { BARCODE_UPCE, 0, "1234567+12345", 0, 50, 1, 105, 238, 118, 103 /*text_row*/, 0, 18, 5, 120, 118 }, + /* 0*/ { BARCODE_EANX, -1, "123456789012", 0, 50, 1, 95, 226, 116, 102 /*text_row*/, 0, 20, -1, -1, -1 }, // EAN-13 + /* 1*/ { BARCODE_EANX, 0, "123456789012", 0, 50, 1, 95, 226, 110, 102 /*text_row*/, 0, 20, -1, -1, -1 }, // EAN-13 + /* 2*/ { BARCODE_EANX_CHK, -1, "1234567890128", 0, 50, 1, 95, 226, 116, 102 /*text_row*/, 0, 20, -1, -1, -1 }, // EAN-13 + /* 3*/ { BARCODE_EANX_CHK, 0, "1234567890128", 0, 50, 1, 95, 226, 110, 102 /*text_row*/, 0, 20, -1, -1, -1 }, // EAN-13 + /* 4*/ { BARCODE_EANX_CHK, -1, "1234567890128+12", 0, 50, 1, 122, 276, 116, 102 /*text_row*/, 0, 20, 5, 212, 64 }, // EAN-13 + EAN-2 + /* 5*/ { BARCODE_EANX_CHK, 0, "1234567890128+12", 0, 50, 1, 122, 276, 110, 102 /*text_row*/, 0, 20, 5, 212, 64 }, // EAN-13 + EAN-2 + /* 6*/ { BARCODE_EANX, -1, "1234567890128+12345", 0, 50, 1, 149, 330, 116, 102 /*text_row*/, 0, 20, 5, 212, 118 }, // EAN-13 + EAN-5 + /* 7*/ { BARCODE_EANX, 0, "1234567890128+12345", 0, 50, 1, 149, 330, 110, 102 /*text_row*/, 0, 20, 5, 212, 118 }, // EAN-13 + EAN-5 + /* 8*/ { BARCODE_ISBNX, -1, "9784567890120+12345", 0, 50, 1, 149, 330, 116, 102 /*text_row*/, 0, 20, 5, 212, 118 }, // ISBNX + EAN-5 + /* 9*/ { BARCODE_ISBNX, 0, "9784567890120+12345", 0, 50, 1, 149, 330, 110, 102 /*text_row*/, 0, 20, 5, 212, 118 }, // ISBNX + EAN-5 + /* 10*/ { BARCODE_EANX, -1, "123456", 0, 50, 1, 67, 162, 116, 102 /*text_row*/, 20, 58, -1, -1, -1 }, // EAN-8 + /* 11*/ { BARCODE_EANX, 0, "123456", 0, 50, 1, 67, 162, 110, 102 /*text_row*/, 20, 58, -1, -1, -1 }, // EAN-8 + /* 12*/ { BARCODE_EANX, -1, "123456+12", 0, 50, 1, 94, 216, 116, 102 /*text_row*/, 20, 58, 5, 148, 68 }, // EAN-8 + EAN-2 + /* 13*/ { BARCODE_EANX, 0, "123456+12", 0, 50, 1, 94, 216, 110, 102 /*text_row*/, 20, 58, 5, 148, 68 }, // EAN-8 + EAN-2 + /* 14*/ { BARCODE_EANX, -1, "123456+12345", 0, 50, 1, 121, 270, 116, 102 /*text_row*/, 20, 58, 5, 148, 122 }, // EAN-8 + EAN-5 + /* 15*/ { BARCODE_EANX, 0, "123456+12345", 0, 50, 1, 121, 270, 110, 102 /*text_row*/, 20, 58, 5, 148, 122 }, // EAN-8 + EAN-5 + /* 16*/ { BARCODE_EANX, -1, "1234", 0, 50, 1, 47, 118, 116, 102 /*text_row*/, 40, 36, -1, -1, -1 }, // EAN-5 + /* 17*/ { BARCODE_EANX, 0, "1234", 0, 50, 1, 47, 118, 100, -1 /*text_row*/, -1, -1, -1, -1, -1 }, // EAN-5 + /* 18*/ { BARCODE_EANX, -1, "12", 0, 50, 1, 20, 64, 116, 102 /*text_row*/, 20, 20, -1, -1, -1 }, // EAN-2 + /* 19*/ { BARCODE_EANX, 0, "12", 0, 50, 1, 20, 64, 100, -1 /*text_row*/, -1, -1, -1, -1, -1 }, // EAN-2 + /* 20*/ { BARCODE_UPCA, -1, "123456789012", 0, 50, 1, 95, 226, 116, 104 /*text_row*/, 0, 18, -1, -1, -1 }, + /* 21*/ { BARCODE_UPCA, 0, "123456789012", 0, 50, 1, 95, 226, 110, 104 /*text_row*/, 0, 18, -1, -1, -1 }, + /* 22*/ { BARCODE_UPCA, -1, "123456789012+12", 0, 50, 1, 124, 276, 116, 104 /*text_row*/, 0, 18, 5, 208, 68 }, + /* 23*/ { BARCODE_UPCA, 0, "123456789012+12", 0, 50, 1, 124, 276, 110, 104 /*text_row*/, 0, 18, 5, 208, 68 }, + /* 24*/ { BARCODE_UPCA_CHK, -1, "123456789012+12345", 0, 50, 1, 151, 330, 116, 104 /*text_row*/, 0, 18, 5, 208, 122 }, + /* 25*/ { BARCODE_UPCA_CHK, 0, "123456789012+12345", 0, 50, 1, 151, 330, 110, 104 /*text_row*/, 0, 18, 5, 208, 122 }, + /* 26*/ { BARCODE_UPCE, -1, "1234567", 0, 50, 1, 51, 134, 116, 104 /*text_row*/, 0, 18, -1, -1, -1 }, + /* 27*/ { BARCODE_UPCE, 0, "1234567", 0, 50, 1, 51, 134, 110, 104 /*text_row*/, 0, 18, -1, -1, -1 }, + /* 28*/ { BARCODE_UPCE_CHK, -1, "12345670+12", 0, 50, 1, 78, 184, 116, 104 /*text_row*/, 0, 18, 5, 120, 64 }, + /* 29*/ { BARCODE_UPCE_CHK, 0, "12345670+12", 0, 50, 1, 78, 184, 110, 104 /*text_row*/, 0, 18, 5, 120, 64 }, + /* 30*/ { BARCODE_UPCE, -1, "1234567+12345", 0, 50, 1, 105, 238, 116, 104 /*text_row*/, 0, 18, 5, 120, 118 }, + /* 31*/ { BARCODE_UPCE, 0, "1234567+12345", 0, 50, 1, 105, 238, 110, 104 /*text_row*/, 0, 18, 5, 120, 118 }, }; int data_size = ARRAY_SIZE(data); @@ -376,7 +376,7 @@ static void test_upcean_hrt(int index, int debug) { assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret); assert_nonnull(symbol->bitmap, "i:%d (%d) symbol->bitmap NULL\n", i, data[i].symbology); - if (index != -1) testUtilBitmapPrint(symbol); + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) testUtilBitmapPrint(symbol); assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%s) symbol->rows %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows); @@ -387,6 +387,7 @@ static void test_upcean_hrt(int index, int debug) { i, testUtilBarcodeName(data[i].symbology), symbol->bitmap_height, data[i].expected_bitmap_height); if (data[i].expected_text_row != -1) { + assert_nonzero(symbol->bitmap_height > data[i].expected_text_row, "i:%d symbol->bitmap_height %d <= data[i].expected_text_row %d\n", i, symbol->bitmap_height, data[i].expected_text_row); int text_bits_set = 0; int row = data[i].expected_text_row; for (int column = data[i].expected_text_col; column < data[i].expected_text_col + data[i].expected_text_len; column++) { @@ -455,7 +456,7 @@ static void test_row_separator(int index, int debug) { /* 4*/ { BARCODE_CODABLOCKF, -1, -1, 3, "A", 0, 20, 2, 101, 242, 44, 19, 42, 6 }, /* 5*/ { BARCODE_CODABLOCKF, -1, -1, 4, "A", 0, 20, 2, 101, 242, 44, 18, 42, 8 }, /* 6*/ { BARCODE_CODABLOCKF, -1, -1, 5, "A", 0, 20, 2, 101, 242, 44, 21, 42, 2 }, // > 4 ignored, same as default - /* 7*/ { BARCODE_CODABLOCKF, -1, 1, -1, "A", 0, 5, 1, 46, 132, 32, 0, 20 + 2, 2 }, // CODE128 top separator, add 2 to skip over end of start char; note now includes HRT + /* 7*/ { BARCODE_CODABLOCKF, -1, 1, -1, "A", 0, 5, 1, 46, 132, 30, 0, 20 + 2, 2 }, // CODE128 top separator, add 2 to skip over end of start char; note now includes HRT /* 8*/ { BARCODE_CODABLOCKF, 0, -1, -1, "A", 0, 20, 2, 101, 242, 44, 21, 42, 2 }, // Border width zero, same as default }; int data_size = ARRAY_SIZE(data); @@ -484,7 +485,7 @@ static void test_row_separator(int index, int debug) { int j, separator_bits_set; - //testUtilBitmapPrint(symbol); + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) testUtilBitmapPrint(symbol); for (j = data[i].expected_separator_row; j < data[i].expected_separator_row + data[i].expected_separator_height; j++) { separator_bits_set = is_row_column_black(symbol, j, data[i].expected_separator_col); @@ -531,9 +532,9 @@ static void test_stacking(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_CODE128, -1, -1, -1, "A", "B", 50, 2, 46, 92, 118, -1, -1, -1 }, - /* 1*/ { BARCODE_CODE128, BARCODE_BIND, -1, -1, "A", "B", 50, 2, 46, 92, 118, 49, 4, 2 }, - /* 2*/ { BARCODE_CODE128, BARCODE_BIND, -1, 2, "A", "B", 50, 2, 46, 92, 118, 48, 4, 4 }, + /* 0*/ { BARCODE_CODE128, -1, -1, -1, "A", "B", 50, 2, 46, 92, 116, -1, -1, -1 }, + /* 1*/ { BARCODE_CODE128, BARCODE_BIND, -1, -1, "A", "B", 50, 2, 46, 92, 116, 49, 4, 2 }, + /* 2*/ { BARCODE_CODE128, BARCODE_BIND, -1, 2, "A", "B", 50, 2, 46, 92, 116, 48, 4, 4 }, }; int data_size = ARRAY_SIZE(data); @@ -564,7 +565,7 @@ static void test_stacking(int index, int debug) { int j, separator_bits_set; - if (index != -1) testUtilBitmapPrint(symbol); + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) testUtilBitmapPrint(symbol); if (data[i].expected_separator_row != -1) { for (j = data[i].expected_separator_row; j < data[i].expected_separator_row + data[i].expected_separator_height; j++) { @@ -614,24 +615,24 @@ static void test_output_options(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_CODE128, -1, -1, -1, 0, "A123", 0, 50, 1, 79, 158, 118, 0, 0, 4 }, - /* 1*/ { BARCODE_CODE128, -1, -1, -1, 180, "A123", 0, 50, 1, 79, 158, 118, 0, 117, 4 }, - /* 2*/ { BARCODE_CODE128, -1, 2, -1, 0, "A123", 0, 50, 1, 79, 158, 118, 0, 0, 4 }, - /* 3*/ { BARCODE_CODE128, -1, 2, BARCODE_BIND, 0, "A123", 0, 50, 1, 79, 158, 126, 1, 0, 4 }, - /* 4*/ { BARCODE_CODE128, -1, 2, BARCODE_BIND, 0, "A123", 0, 50, 1, 79, 158, 126, 0, 4, 4 }, - /* 5*/ { BARCODE_CODE128, -1, 2, BARCODE_BOX, 0, "A123", 0, 50, 1, 79, 166, 126, 1, 4, 4 }, - /* 6*/ { BARCODE_CODE128, -1, 0, BARCODE_BIND, 0, "A123", 0, 50, 1, 79, 158, 118, 0, 0, 4 }, - /* 7*/ { BARCODE_CODE128, -1, 0, BARCODE_BOX, 0, "A123", 0, 50, 1, 79, 158, 118, 0, 4, 4 }, - /* 8*/ { BARCODE_CODE128, -1, -1, -1, 0, "A123", 0, 50, 1, 79, 158, 118, 0, 0, 8 }, - /* 9*/ { BARCODE_CODE128, 3, -1, -1, 0, "A123", 0, 50, 1, 79, 170, 118, 1, 0, 8 }, - /* 10*/ { BARCODE_CODE128, 3, 4, -1, 0, "A123", 0, 50, 1, 79, 170, 118, 1, 0, 8 }, - /* 11*/ { BARCODE_CODE128, 3, 4, BARCODE_BIND, 0, "A123", 0, 50, 1, 79, 170, 134, 1, 0, 0 }, - /* 12*/ { BARCODE_CODE128, 3, 4, BARCODE_BIND, 0, "A123", 0, 50, 1, 79, 170, 134, 0, 8, 0 }, - /* 13*/ { BARCODE_CODE128, 3, 4, BARCODE_BOX, 0, "A123", 0, 50, 1, 79, 186, 134, 1, 8, 0 }, + /* 0*/ { BARCODE_CODE128, -1, -1, -1, 0, "A123", 0, 50, 1, 79, 158, 116, 0, 0, 4 }, + /* 1*/ { BARCODE_CODE128, -1, -1, -1, 180, "A123", 0, 50, 1, 79, 158, 116, 0, 115, 4 }, + /* 2*/ { BARCODE_CODE128, -1, 2, -1, 0, "A123", 0, 50, 1, 79, 158, 116, 0, 0, 4 }, + /* 3*/ { BARCODE_CODE128, -1, 2, BARCODE_BIND, 0, "A123", 0, 50, 1, 79, 158, 124, 1, 0, 4 }, + /* 4*/ { BARCODE_CODE128, -1, 2, BARCODE_BIND, 0, "A123", 0, 50, 1, 79, 158, 124, 0, 4, 4 }, + /* 5*/ { BARCODE_CODE128, -1, 2, BARCODE_BOX, 0, "A123", 0, 50, 1, 79, 166, 124, 1, 4, 4 }, + /* 6*/ { BARCODE_CODE128, -1, 0, BARCODE_BIND, 0, "A123", 0, 50, 1, 79, 158, 116, 0, 0, 4 }, + /* 7*/ { BARCODE_CODE128, -1, 0, BARCODE_BOX, 0, "A123", 0, 50, 1, 79, 158, 116, 0, 4, 4 }, + /* 8*/ { BARCODE_CODE128, -1, -1, -1, 0, "A123", 0, 50, 1, 79, 158, 116, 0, 0, 8 }, + /* 9*/ { BARCODE_CODE128, 3, -1, -1, 0, "A123", 0, 50, 1, 79, 170, 116, 1, 0, 8 }, + /* 10*/ { BARCODE_CODE128, 3, 4, -1, 0, "A123", 0, 50, 1, 79, 170, 116, 1, 0, 8 }, + /* 11*/ { BARCODE_CODE128, 3, 4, BARCODE_BIND, 0, "A123", 0, 50, 1, 79, 170, 132, 1, 0, 0 }, + /* 12*/ { BARCODE_CODE128, 3, 4, BARCODE_BIND, 0, "A123", 0, 50, 1, 79, 170, 132, 0, 8, 0 }, + /* 13*/ { BARCODE_CODE128, 3, 4, BARCODE_BOX, 0, "A123", 0, 50, 1, 79, 186, 132, 1, 8, 0 }, /* 14*/ { BARCODE_CODE128, -1, -1, BARCODE_DOTTY_MODE, 0, "A123", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1, -1, -1, -1, -1 }, - /* 15*/ { BARCODE_CODE128, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, "A123", 0, 50, 1, 79, 158, 118, 0, 0, 4 }, - /* 16*/ { BARCODE_CODE128, -1, -1, OUT_BUFFER_INTERMEDIATE, 180, "A123", 0, 50, 1, 79, 158, 118, 0, 117, 4 }, - /* 17*/ { BARCODE_CODE128, 3, 4, BARCODE_BOX | OUT_BUFFER_INTERMEDIATE, 0, "A123", 0, 50, 1, 79, 186, 134, 1, 8, 0 }, + /* 15*/ { BARCODE_CODE128, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, "A123", 0, 50, 1, 79, 158, 116, 0, 0, 4 }, + /* 16*/ { BARCODE_CODE128, -1, -1, OUT_BUFFER_INTERMEDIATE, 180, "A123", 0, 50, 1, 79, 158, 116, 0, 115, 4 }, + /* 17*/ { BARCODE_CODE128, 3, 4, BARCODE_BOX | OUT_BUFFER_INTERMEDIATE, 0, "A123", 0, 50, 1, 79, 186, 132, 1, 8, 0 }, /* 18*/ { BARCODE_QRCODE, -1, -1, -1, 0, "A123", 0, 21, 21, 21, 42, 42, 0, 2, 2 }, /* 19*/ { BARCODE_QRCODE, -1, -1, -1, 180, "A123", 0, 21, 21, 21, 42, 42, 0, 39, 2 }, /* 20*/ { BARCODE_QRCODE, -1, 3, -1, 0, "A123", 0, 21, 21, 21, 42, 42, 0, 2, 2 }, @@ -667,12 +668,12 @@ static void test_output_options(int index, int debug) { /* 50*/ { BARCODE_MAXICODE, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, "A123", 0, 165, 33, 30, 300, 300, 0, 0, 0 }, /* 51*/ { BARCODE_MAXICODE, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, "A123", 0, 165, 33, 30, 300, 300, 1, 0, 14 }, /* 52*/ { BARCODE_MAXICODE, -1, -1, OUT_BUFFER_INTERMEDIATE, 270, "A123", 0, 165, 33, 30, 300, 300, 0, 0, 0 }, - /* 53*/ { BARCODE_ITF14, -1, -1, -1, 0, "123", 0, 50, 1, 135, 330, 138, 1, 110, 0 }, - /* 54*/ { BARCODE_ITF14, -1, -1, -1, 90, "123", 0, 50, 1, 135, 138, 330, 1, 0, 110 }, - /* 55*/ { BARCODE_ITF14, -1, 0, -1, 0, "123", 0, 50, 1, 135, 330, 138, 1, 110, 0 }, - /* 56*/ { BARCODE_ITF14, -1, 0, BARCODE_BOX, 0, "123", 0, 50, 1, 135, 310, 118, 0, 100, 0 }, - /* 57*/ { BARCODE_ITF14, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, "123", 0, 50, 1, 135, 330, 138, 1, 110, 0 }, - /* 58*/ { BARCODE_ITF14, -1, -1, OUT_BUFFER_INTERMEDIATE, 90, "123", 0, 50, 1, 135, 138, 330, 1, 0, 110 }, + /* 53*/ { BARCODE_ITF14, -1, -1, -1, 0, "123", 0, 50, 1, 135, 330, 136, 1, 110, 0 }, + /* 54*/ { BARCODE_ITF14, -1, -1, -1, 90, "123", 0, 50, 1, 135, 136, 330, 1, 0, 110 }, + /* 55*/ { BARCODE_ITF14, -1, 0, -1, 0, "123", 0, 50, 1, 135, 330, 136, 1, 110, 0 }, + /* 56*/ { BARCODE_ITF14, -1, 0, BARCODE_BOX, 0, "123", 0, 50, 1, 135, 310, 116, 0, 100, 0 }, + /* 57*/ { BARCODE_ITF14, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, "123", 0, 50, 1, 135, 330, 136, 1, 110, 0 }, + /* 58*/ { BARCODE_ITF14, -1, -1, OUT_BUFFER_INTERMEDIATE, 90, "123", 0, 50, 1, 135, 136, 330, 1, 0, 110 }, }; int data_size = ARRAY_SIZE(data); @@ -702,7 +703,7 @@ static void test_output_options(int index, int debug) { if (ret < 5) { assert_nonnull(symbol->bitmap, "i:%d (%d) symbol->bitmap NULL\n", i, data[i].symbology); - if (index != -1) testUtilBitmapPrint(symbol); + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) testUtilBitmapPrint(symbol); assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %d != %d\n", i, data[i].symbology, symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); @@ -747,9 +748,9 @@ static void test_draw_string_wrap(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_CODE128, -1, "12", " E", 50, 1, 46, 92, 118, 104, 0 }, - /* 1*/ { BARCODE_CODE128, BOLD_TEXT, "12", " E", 50, 1, 46, 92, 118, 104, 0 }, - /* 2*/ { BARCODE_CODE128, SMALL_TEXT, "12", " E", 50, 1, 46, 92, 118, 103, 0 }, + /* 0*/ { BARCODE_CODE128, -1, "12", " E", 50, 1, 46, 92, 116, 104, 0 }, + /* 1*/ { BARCODE_CODE128, BOLD_TEXT, "12", " E", 50, 1, 46, 92, 116, 104, 0 }, + /* 2*/ { BARCODE_CODE128, SMALL_TEXT, "12", " E", 50, 1, 46, 92, 112, 103, 0 }, }; int data_size = sizeof(data) / sizeof(struct item); @@ -778,7 +779,7 @@ static void test_draw_string_wrap(int index, int debug) { assert_equal(symbol->bitmap_width, data[i].expected_bitmap_width, "i:%d (%d) symbol->bitmap_width %d != %d\n", i, data[i].symbology, symbol->bitmap_width, data[i].expected_bitmap_width); assert_equal(symbol->bitmap_height, data[i].expected_bitmap_height, "i:%d (%d) symbol->bitmap_height %d != %d\n", i, data[i].symbology, symbol->bitmap_height, data[i].expected_bitmap_height); - //testUtilBitmapPrint(symbol); + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) testUtilBitmapPrint(symbol); ret = ZBarcode_Print(symbol, 0); assert_zero(ret, "i:%d ZBarcode_Print(%d) ret %d != 0\n", i, data[i].symbology, ret); @@ -818,7 +819,7 @@ static void test_code128_utf8(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { "é", 50, 1, 57, 114, 118, 109, 53, 6 }, + /* 0*/ { "é", 50, 1, 57, 114, 116, 110, 53, 6 }, }; int data_size = ARRAY_SIZE(data); @@ -844,7 +845,7 @@ static void test_code128_utf8(int index, int debug) { assert_equal(symbol->bitmap_width, data[i].expected_bitmap_width, "i:%d (%d) symbol->bitmap_width %d != %d\n", i, BARCODE_CODE128, symbol->bitmap_width, data[i].expected_bitmap_width); assert_equal(symbol->bitmap_height, data[i].expected_bitmap_height, "i:%d (%d) symbol->bitmap_height %d != %d\n", i, BARCODE_CODE128, symbol->bitmap_height, data[i].expected_bitmap_height); - if (index != -1) testUtilBitmapPrint(symbol); + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) testUtilBitmapPrint(symbol); ret = ZBarcode_Print(symbol, 0); assert_zero(ret, "i:%d ZBarcode_Print(%d) ret %d != 0\n", i, BARCODE_CODE128, ret); @@ -904,6 +905,13 @@ static void test_scale(int index, int debug) { /* 12*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 1.5, "1", 18, 6, 103, 218 * 1.5, 48 * 1.5, 0, 48 * 1.5, 176 * 1.5, 14 * 1.5 }, /* 13*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 2.5, "1", 18, 6, 103, 218 * 2.5, 48 * 2.5, 0, 48 * 2.5, 176 * 2.5, 14 * 2.5 }, /* 14*/ { BARCODE_PDF417, -1, 3, OUT_BUFFER_INTERMEDIATE, 1.3, "1", 18, 6, 103, 206 * 1.3, 36 * 1.3, 0, 36 * 1.3, 170 * 1.3 + 1, 14 * 1.3 }, // +1 set_col due to some scaling inversion difference + /* 15*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 0, "123456789012", 50, 1, 79, 158, 116, 104, 114, 20, 2 }, // With no scaling + /* 16*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 1.5, "123456789012", 50, 1, 79, 158 * 1.5, 116 * 1.5, 104 * 1.5, 114 * 1.5, 20 * 1.5, 1 * 1.5 }, + /* 17*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 2.0, "123456789012", 50, 1, 79, 158 * 2.0, 116 * 2.0, 104 * 2.0, 114 * 2.0, 20 * 2.0, 1 * 2.0 }, + /* 18*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 3.5, "123456789012", 50, 1, 79, 158 * 3.5, 116 * 3.5, 104 * 3.5, 114 * 3.5, 20 * 3.5, 1 * 3.5 }, + /* 19*/ { BARCODE_UPCA, -1, -1, -1, 0, "12345678904", 50, 1, 95, 226, 116, 104, 114, 5, 2 }, // With no scaling + /* 20*/ { BARCODE_UPCA, -1, -1, -1, 2.5, "12345678904", 50, 1, 95, 226 * 2.5, 116 * 2.5, 104 * 2.5, 114 * 2.5, 5 * 2.5, 2 * 2.5 }, + /* 21*/ { BARCODE_UPCA, -1, -1, -1, 4.5, "12345678904", 50, 1, 95, 226 * 4.5, 116 * 4.5, 104 * 4.5, 114 * 4.5, 5 * 4.5, 2 * 4.5 }, }; int data_size = ARRAY_SIZE(data); @@ -929,17 +937,19 @@ static void test_scale(int index, int debug) { assert_zero(ret, "i:%d ZBarcode_Buffer(%d) ret %d != 0\n", i, data[i].symbology, ret); assert_nonnull(symbol->bitmap, "i:%d (%d) symbol->bitmap NULL\n", i, data[i].symbology); + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) testUtilBitmapPrint(symbol); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %d != %d\n", i, data[i].symbology, symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); assert_equal(symbol->bitmap_width, data[i].expected_bitmap_width, "i:%d (%d) symbol->bitmap_width %d != %d\n", i, data[i].symbology, symbol->bitmap_width, data[i].expected_bitmap_width); assert_equal(symbol->bitmap_height, data[i].expected_bitmap_height, "i:%d (%d) symbol->bitmap_height %d != %d\n", i, data[i].symbology, symbol->bitmap_height, data[i].expected_bitmap_height); - if (index != -1) testUtilBitmapPrint(symbol); - ret = ZBarcode_Print(symbol, 0); assert_zero(ret, "i:%d ZBarcode_Print(%d) ret %d != 0\n", i, data[i].symbology, ret); + assert_nonzero(data[i].expected_set_rows > data[i].expected_set_row, "i:%d (%d) expected_set_rows %d < expected_set_rows %d\n", + i, data[i].symbology, data[i].expected_set_rows, data[i].expected_set_row); for (int row = data[i].expected_set_row; row < data[i].expected_set_rows; row++) { int bits_set = 0; for (int column = data[i].expected_set_col; column < data[i].expected_set_col + data[i].expected_set_len; column++) { @@ -949,7 +959,6 @@ static void test_scale(int index, int debug) { } assert_equal(bits_set, data[i].expected_set_len, "i:%d (%d) row %d bits_set %d != expected_set_len %d\n", i, data[i].symbology, row, bits_set, data[i].expected_set_len); } - ZBarcode_Delete(symbol); }