Render Barcode extension problems

The "Render Barcode" extension seems to have some problems:
1. The font for the numbers is specified as "sans-serif", rather than being a specific monospace font such as Courier. The extension should either check the system for a few fonts and use a suitable one, or use fixed paths. 2. The numbers are laid out using spaces instead of the "dx" attribute (kerning), so the spacing is more font-dependent than it should. 3. The layout of numbers looks nothing like the example in Wikipedia, and the quiet zone mark ">" on the right is missing.
Regards, Krzysztof

On Fri, 2014-05-16 at 06:18 +0200, Krzysztof Kosiński wrote:
- The font for the numbers is specified as "sans-serif", rather than
being a specific monospace font such as Courier. The extension should either check the system for a few fonts and use a suitable one, or use fixed paths. 2. The numbers are laid out using spaces instead of the "dx" attribute (kerning), so the spacing is more font-dependent than it should. 3. The layout of numbers looks nothing like the example in Wikipedia, and the quiet zone mark ">" on the right is missing.
Thanks for the bug report. You've prompted me to push my code cleanup from last year and test everything.
I'm not sure about dx units, I know the text attribute is made in Barcode/Base.py:109 and is as basic as it gets. It doesn't even set a font, I think inkscape must do that.
Best Regards, Martin Owens

On Fri, 16 May 2014 09:54:02 -0400 Martin Owens <doctormo@...400...> wrote:
On Fri, 2014-05-16 at 06:18 +0200, Krzysztof Kosiński wrote:
- The font for the numbers is specified as
"sans-serif", rather than being a specific monospace font such as Courier. The extension should either check the system for a few fonts and use a suitable one, or use fixed paths. 2. The numbers are laid out using spaces instead of the "dx" attribute (kerning), so the spacing is more font-dependent than it should. 3. The layout of numbers looks nothing like the example in Wikipedia, and the quiet zone mark ">" on the right is missing.
Thanks for the bug report. You've prompted me to push my code cleanup from last year and test everything.
I'm not sure about dx units, I know the text attribute is made in Barcode/Base.py:109 and is as basic as it gets. It doesn't even set a font, I think inkscape must do that.
Best Regards, Martin Owens
For ISBN numbers OCRB font is the commonest usage although OCRA is still seen on some important books like Masterson's "Book design and Production".

rev 13386 has broken the scaling of the barcodes when changing document units, please fix, see Bug 1320317
Alvin
-- View this message in context: http://inkscape.13.x6.nabble.com/Render-Barcode-extension-problems-tp4970588... Sent from the Inkscape - Dev mailing list archive at Nabble.com.

thanks, that fixed it.
Alvin
-- View this message in context: http://inkscape.13.x6.nabble.com/Render-Barcode-extension-problems-tp4970588... Sent from the Inkscape - Dev mailing list archive at Nabble.com.

with an updated extensions directory, rev 13393, I am getting the following failures when running render_barcode_test.py. Don't know the cause ????
Alvin
..................................................... C:\InkscapeBZR\inkscape\share\extensions\test>render_barcode.test.py EEEEENo barcode format given! Unable to make barcode with: {'text': '', 'type': '', 'ids': [], 'height': 30} . ====================================================================== ERROR: Barcode IAN5 ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", l ine 54, in test_render_barcode_ian13 self.barcode_test( 'ean13', Barcode.Ean13 ) File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", l ine 71, in barcode_test code2 = module.Object( {'text': text} ).encode(text) AttributeError: 'module' object has no attribute 'Object'
====================================================================== ERROR: Barcode IAN5 ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 46, in test_render_barcode_ian5 self.barcode_test( 'ean5', Barcode.Ean5 ) File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 71, in barcode_test code2 = module.Object( {'text': text} ).encode(text) AttributeError: 'module' object has no attribute 'Object'
====================================================================== ERROR: Barcode IAN5 ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 50, in test_render_barcode_ian8 self.barcode_test( 'ean8', Barcode.Ean8 ) File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 71, in barcode_test code2 = module.Object( {'text': text} ).encode(text) AttributeError: 'module' object has no attribute 'Object'
====================================================================== ERROR: Barcode IAN5 ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 58, in test_render_barcode_upca self.barcode_test( 'upca', Barcode.Upca ) File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 71, in barcode_test code2 = module.Object( {'text': text} ).encode(text) AttributeError: 'module' object has no attribute 'Object'
====================================================================== ERROR: Barcode UPCE ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 62, in test_render_barcode_upce self.barcode_test( 'upce', Barcode.Upce ) File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 71, in barcode_test code2 = module.Object( {'text': text} ).encode(text) AttributeError: 'module' object has no attribute 'Object'
---------------------------------------------------------------------- Ran 6 tests in 0.016s
FAILED (errors=5)
-- View this message in context: http://inkscape.13.x6.nabble.com/Render-Barcode-extension-problems-tp4970588... Sent from the Inkscape - Dev mailing list archive at Nabble.com.

The test needs updated based on the recent changes. I tinkered with it to fix the class names but it needs more work than that.
On Sat, May 17, 2014 at 02:50:07PM -0700, alvinpenner wrote:
with an updated extensions directory, rev 13393, I am getting the following failures when running render_barcode_test.py. Don't know the cause ????
Alvin
..................................................... C:\InkscapeBZR\inkscape\share\extensions\test>render_barcode.test.py EEEEENo barcode format given! Unable to make barcode with: {'text': '', 'type': '', 'ids': [], 'height': 30} . ====================================================================== ERROR: Barcode IAN5
Traceback (most recent call last): File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", l ine 54, in test_render_barcode_ian13 self.barcode_test( 'ean13', Barcode.Ean13 ) File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", l ine 71, in barcode_test code2 = module.Object( {'text': text} ).encode(text) AttributeError: 'module' object has no attribute 'Object'
====================================================================== ERROR: Barcode IAN5
Traceback (most recent call last): File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 46, in test_render_barcode_ian5 self.barcode_test( 'ean5', Barcode.Ean5 ) File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 71, in barcode_test code2 = module.Object( {'text': text} ).encode(text) AttributeError: 'module' object has no attribute 'Object'
====================================================================== ERROR: Barcode IAN5
Traceback (most recent call last): File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 50, in test_render_barcode_ian8 self.barcode_test( 'ean8', Barcode.Ean8 ) File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 71, in barcode_test code2 = module.Object( {'text': text} ).encode(text) AttributeError: 'module' object has no attribute 'Object'
====================================================================== ERROR: Barcode IAN5
Traceback (most recent call last): File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 58, in test_render_barcode_upca self.barcode_test( 'upca', Barcode.Upca ) File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 71, in barcode_test code2 = module.Object( {'text': text} ).encode(text) AttributeError: 'module' object has no attribute 'Object'
====================================================================== ERROR: Barcode UPCE
Traceback (most recent call last): File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 62, in test_render_barcode_upce self.barcode_test( 'upce', Barcode.Upce ) File "C:\InkscapeBZR\inkscape\share\extensions\test\render_barcode.test.py", line 71, in barcode_test code2 = module.Object( {'text': text} ).encode(text) AttributeError: 'module' object has no attribute 'Object'
Ran 6 tests in 0.016s
FAILED (errors=5)
-- View this message in context: http://inkscape.13.x6.nabble.com/Render-Barcode-extension-problems-tp4970588... Sent from the Inkscape - Dev mailing list archive at Nabble.com.
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel

appears to have been fixed in rev 13394.
thanks, Alvin
-- View this message in context: http://inkscape.13.x6.nabble.com/Render-Barcode-extension-problems-tp4970588... Sent from the Inkscape - Dev mailing list archive at Nabble.com.
participants (5)
-
alvinpenner
-
Bryce Harrington
-
john Culleton
-
Krzysztof Kosiński
-
Martin Owens