Code25i.py revision 12a239f8730c2bb6e3738d5e75b3237877594d07
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# Copyright (C) 2010 Geoffrey Mosini
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# This program is free software; you can redistribute it and/or modify
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# it under the terms of the GNU General Public License as published by
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# the Free Software Foundation; either version 2 of the License, or
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# (at your option) any later version.
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# This program is distributed in the hope that it will be useful,
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# but WITHOUT ANY WARRANTY; without even the implied warranty of
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# GNU General Public License for more details.
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# You should have received a copy of the GNU General Public License
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# along with this program; if not, write to the Free Software
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1ef3c8b1b935901dd133c337031a7300334db424JazzyNicoGenerate barcodes for Code25-interleaved 2 of 5, for Inkscape.
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# 1 means thick, 0 means thin
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# Start and stop code are already encoded into white (0) and black(1) bars
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico # Convert a text into string binary of black and white markers
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico sys.stderr.write("CODE25 can only encode numbers.\n")
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico # Number of figures to encode must be even, a 0 is added to the left in case it's odd.
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico # Number is encoded by pairs of 2 figures
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico # First in the pair is encoded in black (1), second in white (0)