Barcode Plugin Development: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
(Clarify that the imported object is currently a vector; cleanups)
 
(11 intermediate revisions by the same user not shown)
Line 5: Line 5:
The BWIPP wiki provides [https://github.com/bwipp/postscriptbarcode/wiki/Developing-a-Frontend-to-BWIPP some recommendations for frontends].  
The BWIPP wiki provides [https://github.com/bwipp/postscriptbarcode/wiki/Developing-a-Frontend-to-BWIPP some recommendations for frontends].  


==Simple tasks==
==Scribus tasks==


* Hexify the data and options string input from Scribus to BWIPP to prevent PostScript injection by means of unescaped ")" or otherwise. See this discussion [https://bitbucket.org/whosaysni/elaphe/issue/18/make-codestring-optionstring-hexilified here]. NOW MERGED
* Create a new type of Scribus Barcode Item:
* Add an advanced textbox that allows the user to directly provide the options string to the library for advanced users who follow the [https://github.com/bwipp/postscriptbarcode/wiki BWIPP reference]. NOW MERGED
** The input is currently a vector item that can be ungrouped. Ungrouping makes little sense because it typically changes the relationship between the barcode elements, spoiling the meaning of the barcode.
** The imported object should initially have a fixed aspect ratio. Only occasionally does it make sense to re-scale the imported image since nominal symbol sizes are standardised.
** Ideally, double-clicking on such an item would bring up the barcode dialogue (not the Group Tab of the PP), so that a user can change the data, and the barcode drawing would be updated after clicking an "Update" button. For this, Scribus must store the value behind the created barcode: codeEdit, optionsEdit, lnColor, bgColor, txtColor (Checkbox states unnecessary as encoded in optionsEdit).


==Moderate tasks==
* Add support for the remaining barcode symbologies that are supported by BWIPP: NOW MERGED
* To make the presentation of the list of barcode formats manageable we should sort the list of barcodes in the same/similar way as the web-based generator [http://www.terryburton.co.uk/barcodewriter/generator/ here]. PARTIAL
** The list is still long and may be unworkable on certain platforms. Consider a multi-combo approach or other.
* Extract descriptions, example data and example options from the barcode.ps metadata by scanning for DESC, EXAM and EXOP stanzas within BEGIN/ENCODER ENCODER blocks. NOW MERGED
* Use the BWIPP error reporting mechanism to provide specific error messages to users so that they can understand why a given input is invalid. IN PROGRESS
* Allow the location of the barcode.ps file to be configured by the user so that non-admins users can provide a local version and distributions that deprecate bundled libraries can provide a separately packaged version. One way to do this is to provide a configuration dialog with PATH_TO_BWIPP=USER|DEFAULT.
** Use the user supplied path if PATH_TO_BWIPP=USER.
** Apply the following search order if PATH_TO_BWIPP=DEFAULT:
*** ~/.scribus/plugins/barcode.ps (user replacement)
*** [%APP_INSTALL_DIR%]/share/scribus/plugins/barcode.ps (bundled version)
*** /usr/share/postscriptbarcode/barcode.ps (Fedora's postscriptbarcode package)
*** /usr/share/libpostscriptbarcode/barcode.ps (Debian's libpostscriptbarcode package)
** In either case, if barcode.ps is not found, prompt the user by showing the dialog with PATH_TO_BWIPP=USER pre-selected.
==Harder tasks==
* Create a new type of Scribus Barcode Item:
** A vector item that cannot be ungrouped
** Initially fixed aspect ratio
** Stores the value behind the created barcode: codeEdit, optionsEdit, lnColor, bgColor, txtColor (Checkbox states unnecessary as encoded in optionsEdit)
** Ideally, double-clicking on such an item would bring up the barcode dialogue (not the Group Tab of the PP), so that a user can change the data, and the barcode drawing would be updated after clicking an "Update" button. This would, obviously, require some extensions to the Scribus core, as well as changes to the file format.
* Render the preview in a background QThread so that updating the preview image doesn't snatch attention away from the UI. See [http://lists.scribus.net/pipermail/scribus-dev/2015-February/002487.html here].
* Allow the barcode plugin to be driven from ScripterNG.
* Allow the barcode plugin to be driven from ScripterNG.


Line 40: Line 18:
The following tasks require some degree of coordination between Scribus and [[User:Terryburton|Terry Burton]], the author of BWIPP.
The following tasks require some degree of coordination between Scribus and [[User:Terryburton|Terry Burton]], the author of BWIPP.


* Extend the barcode.ps metadata to describe the options that are available for each encoder so that any frontends such as the Scribus plugin can be light on compiled in data and enhanced with new format by simply replacing the barcode.ps file.
* Extend the barcode.ps metadata to describe the options that are available for each encoder so that any frontends such as the Scribus plugin can be light on compiled in data and enhanced with new format by simply replacing the barcode.ps file. [IN PROGRESS UPSTREAM - https://github.com/bwipp/postscriptbarcode/tree/master/libs]
* Mentor a GSOC student on this barcode plugin.

Latest revision as of 11:02, 18 September 2023

This article is part of the Ongoing Discussions series.
Installation Usability MacOS Fonts Other

This page is intended to provide a collaboration point to coordinate improvements to the barcode plugin which is based on Barcode Writer in Pure PostScript (BWIPP). Please extend, debate and discuss as appropriate.

The BWIPP wiki provides some recommendations for frontends.

Scribus tasks

  • Create a new type of Scribus Barcode Item:
    • The input is currently a vector item that can be ungrouped. Ungrouping makes little sense because it typically changes the relationship between the barcode elements, spoiling the meaning of the barcode.
    • The imported object should initially have a fixed aspect ratio. Only occasionally does it make sense to re-scale the imported image since nominal symbol sizes are standardised.
    • Ideally, double-clicking on such an item would bring up the barcode dialogue (not the Group Tab of the PP), so that a user can change the data, and the barcode drawing would be updated after clicking an "Update" button. For this, Scribus must store the value behind the created barcode: codeEdit, optionsEdit, lnColor, bgColor, txtColor (Checkbox states unnecessary as encoded in optionsEdit).
  • Allow the barcode plugin to be driven from ScripterNG.

Collaborative tasks

The following tasks require some degree of coordination between Scribus and Terry Burton, the author of BWIPP.

  • Extend the barcode.ps metadata to describe the options that are available for each encoder so that any frontends such as the Scribus plugin can be light on compiled in data and enhanced with new format by simply replacing the barcode.ps file. [IN PROGRESS UPSTREAM - https://github.com/bwipp/postscriptbarcode/tree/master/libs]