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
ad9933c3bdd809813acc78673fcc580cd326bcd6Martin Owens# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA.
1ef3c8b1b935901dd133c337031a7300334db424JazzyNicoGenerate barcodes for Code25-interleaved 2 of 5, for Inkscape.
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico# 1 means thick, 0 means thin
ad9933c3bdd809813acc78673fcc580cd326bcd6Martin Owens """Convert a text into string binary of black and white markers"""
ad9933c3bdd809813acc78673fcc580cd326bcd6Martin Owens # Start and stop code are already encoded into white (0) and black(1) bars
ad9933c3bdd809813acc78673fcc580cd326bcd6Martin Owens return self.error(number, "CODE25 can only encode numbers.")
ad9933c3bdd809813acc78673fcc580cd326bcd6Martin Owens # Number of figures to encode must be even,
ad9933c3bdd809813acc78673fcc580cd326bcd6Martin Owens # 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)