Skip to contentSkip to conversation

Contributing braille embosser support

Printing-architecture Samuel Thibault 3 participants 26 messages Dec 9, 2015 – Nov 29, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

I have been working on braille embosser support for CUPS, so that embossing a document can be as easy as printing it. I have attached the result.

The principle I have followed is to use the cups architecture to separate on one hand frontends which turn documents into braille text (text/vnd.cups-brf) or braille graphics (image/vnd.cups-brf), notably based on liblouis, and on the other hand backends which emboss braille text or braille graphics (I have implemented a generic driver which should work on all embossers, and a driver for the Index embosser which I can actually test).

For now, I have made a separate package, so it is easy to test it already, but ideally, I would like to see this work integrated into CUPS filters, so that blind people don't need to install a separate package, but just configure CUPS for their embosser. How should we proceed? Perhaps first iterate over the packaged version, until the code is fine for integration, and then I'll submit a patch against cups-filters?

Samuel

#1 lore raw

Samuel,

This is very cool, thank you!

Quoted 23 lines · Samuel Thibault

Hello,

I have been working on braille embosser support for CUPS, so that embossing a document can be as easy as printing it. I have attached the result.

The principle I have followed is to use the cups architecture to separate on one hand frontends which turn documents into braille text (text/vnd.cups-brf) or braille graphics (image/vnd.cups-brf), notably based on liblouis, and on the other hand backends which emboss braille text or braille graphics (I have implemented a generic driver which should work on all embossers, and a driver for the Index embosser which I can actually test).

For now, I have made a separate package, so it is easy to test it already, but ideally, I would like to see this work integrated into CUPS filters, so that blind people don't need to install a separate package, but just configure CUPS for their embosser. How should we proceed? Perhaps first iterate over the packaged version, until the code is fine for integration, and then I'll submit a patch against cups-filters?

Quoted 5 lines

Samuel <cups-braille_0.1.tar.gz>_______________________________________________ Printing-architecture mailing list [email protected]
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.linuxfoundation.org_mailman_listinfo_printing-2Darchitecture&d=BQICAg&c=Hw-EJUFt2_D9PK5csBJ29kRV40HqSDXWTLPyZ6W8u84&r=celVg12QtW5bvoWXWyIdeQ&m=jeSlmoaZFovntwF_U0gp292XY4VsyoMEUfKz0PUGsAg&s=3XIbVXdJdTkphd6bQFfESaGPKGkmo-h4RVOy2MW_slQ&e=

_________________________________________________________
Michael Sweet, Senior Printing System Engineer

#2 lore raw
In reply to Samuel Thibault

Hi,

Thank you very much for this great effort. This is really missing in the Linux operating system.

I am looking into integrating it into cups-filters, but I would like to have the following improvements on it:

1. PPD files: If there are different options, like LibLouis2, libLouis3, ... their name translations/long names should also be different, not having "Additional Braille transcription" for all of them, but rather "Additional Braille transcription (2)" for LibLouis2, "Additional Braille transcription (3)" for LibLouis3, ... Otherwise it is rather confusing having several options showing with the same name in a print dialog.

2. Cluttering of /usr/lib/cups/filter/: This directory should only contain the actual CUPS filters (executables called by CUPS in the filter chain for a job. The auxiliary files should go into a separate directory, like /usr/share/cups/braille/ (if there are no architecture-dependent executables or libraries) or /usr/lib/cups/braille (if there are architecture-dependent executables or libraries).

3. Binary bytes in shell scripts: Some scripts, like drivers/index/textbrftoindexv3 contain binary bytes. This leads to problems with version control systems like GIT or BZR. Please avoid any binary bytes in scripts or source files, generally in any file contained in the source tarball. There are ways to express this with pure text. Or do everything in C (this is even better), there are for sure ways to avoid binary bytes.

I am grateful if you could fix that.

Till

Quoted 30 lines · Samuel Thibault

Hello,

I have been working on braille embosser support for CUPS, so that embossing a document can be as easy as printing it. I have attached the result.

The principle I have followed is to use the cups architecture to separate on one hand frontends which turn documents into braille text (text/vnd.cups-brf) or braille graphics (image/vnd.cups-brf), notably based on liblouis, and on the other hand backends which emboss braille text or braille graphics (I have implemented a generic driver which should work on all embossers, and a driver for the Index embosser which I can actually test).

For now, I have made a separate package, so it is easy to test it already, but ideally, I would like to see this work integrated into CUPS filters, so that blind people don't need to install a separate package, but just configure CUPS for their embosser. How should we proceed? Perhaps first iterate over the packaged version, until the code is fine for integration, and then I'll submit a patch against cups-filters?

Samuel

_______________________________________________
Printing-architecture mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/printing-architecture

#3 lore raw

Hello,

Quoted 1 line · Till Kamppeter, on Thu 10 Dec 2015 18:29:40 -0200, wrote:

I am looking into integrating it into cups-filters,

Cool :)

Quoted 2 lines

1. PPD files: If there are different options, like LibLouis2, libLouis3, ... their name translations/long names should also be different,

Sure, easy :)

Quoted 5 lines

2. Cluttering of /usr/lib/cups/filter/: This directory should only contain the actual CUPS filters

The auxiliary files should go into a separate directory, like /usr/share/cups/braille/

Sure, easy :)

Quoted 2 lines

3. Binary bytes in shell scripts: Some scripts, like drivers/index/textbrftoindexv3 contain binary bytes.

Right. I'll use bash's $'\015' then.

Quoted 1 line

Or do everything in C (this is even better),

I had been wondering about turning these into C indeed, but the shell version seems to me easier to read and maintain actually.

Samuel

#4 lore raw
Quoted 23 lines · Samuel Thibault

Hello,

Quoted 1 line · Till Kamppeter, on Thu 10 Dec 2015 18:29:40 -0200, wrote:

I am looking into integrating it into cups-filters,

Cool :)

Quoted 2 lines

1. PPD files: If there are different options, like LibLouis2, libLouis3, ... their name translations/long names should also be different,

Sure, easy :)

Quoted 5 lines

2. Cluttering of /usr/lib/cups/filter/: This directory should only contain the actual CUPS filters

The auxiliary files should go into a separate directory, like /usr/share/cups/braille/

Sure, easy :)

Quoted 2 lines

3. Binary bytes in shell scripts: Some scripts, like drivers/index/textbrftoindexv3 contain binary bytes.

Quoted 7 lines

Right. I'll use bash's $'\015' then.

Quoted 1 line

Or do everything in C (this is even better),

I had been wondering about turning these into C indeed, but the shell version seems to me easier to read and maintain actually.

OK, thanks. So please go ahead with the fixes.

And I am also grateful if you do the maintenance of your code when it is in cups-filters as I do not know much about Braille embossers and also do not have such a device available to me.

How are Braille embossers connected and how do they appear for the computer? Do they work with the standard usb/parallel/socket/ipp backends of CUPS?

Till

#5 lore raw
Quoted 1 line · Till Kamppeter, on Thu 10 Dec 2015 19:02:03 -0200, wrote:

OK, thanks. So please go ahead with the fixes.

Here is an updated tarball.

BTW, which licence would it be better to release this code under? I'm fine with most free software licences.

Quoted 3 lines

And I am also grateful if you do the maintenance of your code when it is in cups-filters as I do not know much about Braille embossers and also do not have such a device available to me.

Sure! That's what I planned. I'll probably try to contact other braille embossers manufacturers to get protocol or even devices. Index is very common in Europe, so it is good enough for a start.

Quoted 2 lines

How are Braille embossers connected and how do they appear for the computer? Do they work with the standard usb/parallel/socket/ipp backends of CUPS?

Yes, they really look like usual printers. Just configuring them as generic text printers would work for instance. In the case of Index embossers, they have serial, USB (line-printer interface), and network (HP JetDirect) support.

Samuel

#6 lore raw
Quoted 5 lines · Samuel Thibault
Quoted 1 line · Till Kamppeter, on Thu 10 Dec 2015 19:02:03 -0200, wrote:

OK, thanks. So please go ahead with the fixes.

Here is an updated tarball.

Thank you very much. I will look into it.

Quoted 3 lines

BTW, which licence would it be better to release this code under? I'm fine with most free software licences.

I think MIT would be best.

Quoted 8 lines
Quoted 3 lines

And I am also grateful if you do the maintenance of your code when it is in cups-filters as I do not know much about Braille embossers and also do not have such a device available to me.

Sure! That's what I planned. I'll probably try to contact other braille embossers manufacturers to get protocol or even devices. Index is very common in Europe, so it is good enough for a start.

Great.

Quoted 8 lines
Quoted 2 lines

How are Braille embossers connected and how do they appear for the computer? Do they work with the standard usb/parallel/socket/ipp backends of CUPS?

Yes, they really look like usual printers. Just configuring them as generic text printers would work for instance. In the case of Index embossers, they have serial, USB (line-printer interface), and network (HP JetDirect) support.

OK, then no new backends are needed.

Till

#7 lore raw
Quoted 1 line · Till Kamppeter, on Thu 10 Dec 2015 22:19:54 -0200, wrote:

I think MIT would be best.

Here is a tarball with fixed copyrights. I have also moved the shell helpers to /usr/share instead of /usr/lib since they are architecture-independent.

Samuel

#8 lore raw
Quoted 9 lines · Samuel Thibault
Quoted 1 line · Till Kamppeter, on Thu 10 Dec 2015 22:19:54 -0200, wrote:

I think MIT would be best.

Here is a tarball with fixed copyrights. I have also moved the shell helpers to /usr/share instead of /usr/lib since they are architecture-independent.

Samuel

All OK now, I will integrate your software in cups-filters 1.4.0.

Thank you very much.

Till

#9 lore raw
In reply to Samuel Thibault
Quoted 9 lines · Samuel Thibault
Quoted 1 line · Till Kamppeter, on Thu 10 Dec 2015 22:19:54 -0200, wrote:

I think MIT would be best.

Here is a tarball with fixed copyrights. I have also moved the shell helpers to /usr/share instead of /usr/lib since they are architecture-independent.

Samuel

Thank you very much for the tarball.

I have integrated your software in cups-filters now and committed it to the BZR repository. Please download and try, and tell me whether everything is working.

I have the following remarks:

- I have integrated your files into the build system of cups-filters following all free software standards. Especially the configure script of cups-filters checks the presence of liblouis and also takes an "--enable-braille"/"--disable-braille" command line option pair. with Braille support being enabled by default if liblouis is present. Paths in the scripts are fitted to the system by configure, therefore the scripts in the source are *.in files with "@...@" placeholders.

- PPD files are not pre-built by the Makefile. The *.drv and *.defs files are put into the standard places in the CUPS directories, so that PPDs are generated on-the-fly.

- Documentation of the README and TODO files is joined to the README file of cups-filters.

- Your name is in the COPYING file now.

- There are three files which I have dropped as they do not get used (no reference to them in the other files): drivers/generic/fr.po, drivers/index/fr.po, and drivers/index/ubrlto4dot.c. For what are these files used, especially what does drivers/index/ubrlto4dot.c do?

- I have dropped the debian/ directory. Upstream packages should never ship a debian/ directory, independent if it contains the files for generating Debian packages or something else.

- The Generic embosser PPD file passes cupstestppd, the files for the Index printers not. The error message is:

**FAIL** Multiple occurrences of option IndexTable choice name 24.

and indeed the option "IndexTable" has two choices with "24" as short name. As I do not have the printers, I do not know how to fix this correctly. Can you fix this? (Found by running the command "/usr/lib/cups/daemon/cups-driverd cat drv:///indexv4.drv/ibrlbox4.ppd | cupstestppd -" on a system with the current state of the cups-filters BZR installed).

Thanks again for your great contribution.

Till

#10 lore raw
Quoted 5 lines · Till Kamppeter

- There are three files which I have dropped as they do not get used (no reference to them in the other files): drivers/generic/fr.po, drivers/index/fr.po, and drivers/index/ubrlto4dot.c. For what are these files used, especially what does drivers/index/ubrlto4dot.c do?

I have found out for what the fr.po files are good for: If I put them into /usr/share/cups/ppdc/ directory, the on-the-fly-generated PPD files get a French locale added. Only problem is that only one fr.po can be placed in /usr/share/cups/ppdc/, so I will look into renaming them and add the two renamed files to cups-filter. I assume I have to rename the references in the *.drv files appropriately then.

Is this correct?

So the only file staying unclear to me is drivers/index/ubrlto4dot.c. For what does this file serve?

Till

#11 lore raw
Quoted 2 lines · Till Kamppeter, on Sat 12 Dec 2015 00:28:34 -0200, wrote:

I have integrated your software in cups-filters now and committed it to the BZR repository.

Great! Thank you very much for the integration work!

Quoted 2 lines

Please download and try, and tell me whether everything is working.

I'll give it a try as soon as I get time.

Quoted 5 lines

- I have integrated your files into the build system of cups-filters following all free software standards. Especially the configure script of cups-filters checks the presence of liblouis and also takes an "--enable-braille"/"--disable-braille" command line option pair. with Braille support being enabled by default if liblouis is present.

Good :) I was lazy to do it in my prototype cups-braille package :)

Quoted 3 lines

- PPD files are not pre-built by the Makefile. The *.drv and *.defs files are put into the standard places in the CUPS directories, so that PPDs are generated on-the-fly.

Oh, I didn't know cups was able to do this. Even better then.

Quoted 2 lines

If I put them into /usr/share/cups/ppdc/ directory, the on-the-fly-generated PPD files get a French locale added.

Yes; that's very useful.

Quoted 4 lines

Only problem is that only one fr.po can be placed in /usr/share/cups/ppdc/, so I will look into renaming them and add the two renamed files to cups-filter. I assume I have to rename the references in the *.drv files appropriately then.

Yes, please do. Actually I was suprised that the documentation tells to use "fr.po" name, since as seen by this conflict they have to *not* have that name :)

Actually they could even be merged, that'd be better since otherwise there would be a lot of duplication. I have attached the resulting merge.

Quoted 2 lines

and drivers/index/ubrlto4dot.c. For what are these files used, especially what does drivers/index/ubrlto4dot.c do?

This file is used to generate the translation table in drivers/index/imageubrltoindexv[34]. I felt it was good to integrate it as "source code" for them, even if actually running the generation in Makefile is more tedious than really useful.

Quoted 3 lines

- I have dropped the debian/ directory. Upstream packages should never ship a debian/ directory, independent if it contains the files for generating Debian packages or something else.

Sure, no problem.

Quoted 6 lines

- The Generic embosser PPD file passes cupstestppd, the files for the Index printers not. The error message is:

**FAIL** Multiple occurrences of option IndexTable choice name 24.

and indeed the option "IndexTable" has two choices with "24" as short name.

Oops... I must admit I didn't test polish & dutch braille since I speak them and don't have an index4 device :) I have attached a patch.

Quoted 1 line

Thanks again for your great contribution.

Thanks for your reactivity!

Samuel

#
# Copyright (c) 2015 Samuel Thibault <[email protected]> #
# Permission is hereby granted, free of charge, to any person obtaining a copy

# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# 
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# 

msgid "Generic"
msgstr "Generique"

msgid "Braille embosser"
msgstr "Embosseuse braille"

msgid "A4 Tractor Feed"
msgstr "A4 Traction papier"

msgid "Yes"
msgstr "Oui"

msgid "No"
msgstr "Non"

msgid "Braille transcription"
msgstr "Transcription Braille"

msgid "None"
msgstr "Aucune"

msgid "Additional Braille transcription"
msgstr "Transcription Braille additionnelle"

msgid "Text dot distance"
msgstr "Distance points texte"

msgid "Text dots"
msgstr "Points text"

msgid "8 dots"
msgstr "8 points"

msgid "6 dots"
msgstr "6 points"

msgid "Graphic dot distance"
msgstr "Distance points graphique"

msgid "Line spacing"
msgstr "Espacement de ligne"

msgid "Image conversion"
msgstr "Conversion d'image"

msgid "Rotation"
msgstr "Rotation"

msgid "No rotation"
msgstr "Pas de rotation"

msgid "Rotate clockwise to portrait"
msgstr "Rotation horaire vers portrait"

msgid "Rotate clockwise to landscape"
msgstr "Rotation horaire vers paysage"

msgid "Rotate counter clockwise to portrait"
msgstr "Rotation anti-horaire vers portrait"

msgid "Rotate counter clockwise to landscape"
msgstr "Rotation anti-horaire vers paysage"

msgid "Clockwise"
msgstr "Horaire"

msgid "Counter clockwise"
msgstr "Anti-horaire"

msgid "Upside Down"
msgstr "Retourner"

msgid "Edge detection"
msgstr "Détection de contour"

msgid "Simple"
msgstr "Simple"

msgid "Canny"
msgstr "Canny"

msgid "Negate"
msgstr "Inversion"

msgid "EdgeFactor"
msgstr "Facteur de contour"

msgid "CannyRadius"
msgstr "Radius Canny"

msgid "CannySigma"
msgstr "Sigma Canny"

msgid "CannyLower"
msgstr "Lower Canny"

msgid "CannyUpper"
msgstr "Upper Canny"

msgid "Index support"
msgstr "Support Index"

msgid "Installed firmware version"
msgstr "Version de firmware installée"

msgid "10.20 or above"
msgstr "10.20 ou supérieur"

msgid "10.30 or above"
msgstr "10.30 ou supérieur"

msgid "11.02.1 or above"
msgstr "11.02.1 ou supérieur"

msgid "11.03.2 or above"
msgstr "11.03.2 ou supérieur"

msgid "12.01.3 or above"
msgstr "12.01.3 ou supérieur"

msgid "Page folding"
msgstr "Recto-Verso"

msgid "Single-sided"
msgstr "Recto seul"

msgid "Double-sided"
msgstr "Recto-Verso"

msgid "Single-sided z-folding"
msgstr "Recto seul, pliage Z"

msgid "Double-sided z-folding"
msgstr "Recto-Verso, pliage Z"

msgid "Single-sided sideways z-folding"
msgstr "Recto seul paysage, pliage Z"

msgid "Double-sided sideways z-folding"
msgstr "Recto-Verso paysage, pliage Z"

msgid "Double-sided saddle stitch 4 pages"
msgstr "Recto-Verso cahier 4 pages"

msgid "Single-sided saddle stitch 4 pages"
msgstr "Recto cahier 4 pages"

msgid "Firmware Braille Table"
msgstr "Table Braille Firmware"

msgid "6-dot MIT table"
msgstr "Table MIT 6 points"

msgid "User-defined Table 1"
msgstr "Table 1 définie par l'utilisateur"

msgid "User-defined Table 2"
msgstr "Table 2 définie par l'utilisateur"

msgid "User-defined Table 3"
msgstr "Table 3 définie par l'utilisateur"

msgid "User-defined Table 4"
msgstr "Table 4 définie par l'utilisateur"

msgid "Multiple impact"
msgstr "Impact multiple"

=== modified file 'drv/indexv4.drv'

indexv4.drv +2 -2
@@ -74,8 +74,8 @@ Group "Braille"
   Choice "22/Polish literal with capital" ""
   Choice "23/Polish own table 03" ""
   Choice "24/Polish own table 04" ""
-  Choice "24/Dutch computer 6 dots" ""
-  Choice "25/Dutch own table 02" ""
+  Choice "25/Dutch computer 6 dots" ""
+  Choice "26/Dutch own table 02" ""
 
 
 //
#12 lore raw
Quoted 5 lines · Samuel Thibault, on Sat 12 Dec 2015 09:36:05 +0100, wrote:
Quoted 2 lines · Till Kamppeter, on Sat 12 Dec 2015 00:28:34 -0200, wrote:

Please download and try, and tell me whether everything is working.

I'll give it a try as soon as I get time.

A graphical test seems to be working, I'll do more thorough tests.

Samuel

#13 lore raw
In reply to Samuel Thibault

Thanks, the problems I mentioned are solved by the patches, but the new fr-braille.po file has some problems (output of cupstestppd):

**FAIL** Bad UTF-8 "fr" translation string for option Edge. **FAIL** Bad UTF-8 "fr" translation string for option
IndexFirmwareVersio
n.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexFirmwareVersio
n, choice 102000.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexFirmwareVersio
n, choice 103000.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexTable, choice
1.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexTable, choice
2.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexTable, choice
3.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexTable, choice 4.

Can you fix that?

Till

Quoted 4 lines · Samuel Thibault

Actually they could even be merged, that'd be better since otherwise there would be a lot of duplication. I have attached the resulting merge.

[...]

Quoted 10 lines
Quoted 6 lines

- The Generic embosser PPD file passes cupstestppd, the files for the Index printers not. The error message is:

**FAIL** Multiple occurrences of option IndexTable choice name 24.

and indeed the option "IndexTable" has two choices with "24" as short name.

Oops... I must admit I didn't test polish & dutch braille since I speak them and don't have an index4 device :) I have attached a patch.

#14 lore raw

I have committed your changes now, but pleas fix the translations. Thanks.

Till

Quoted 52 lines · Till Kamppeter

Thanks, the problems I mentioned are solved by the patches, but the new fr-braille.po file has some problems (output of cupstestppd):

**FAIL** Bad UTF-8 "fr" translation string for option Edge. **FAIL** Bad UTF-8 "fr" translation string for option
IndexFirmwareVersio
n.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexFirmwareVersio
n, choice 102000.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexFirmwareVersio
n, choice 103000.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexTable, choice
1.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexTable, choice
2.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexTable, choice
3.
**FAIL** Bad UTF-8 "fr" translation string for option
IndexTable, choice 4.

Can you fix that?

Till

Quoted 4 lines · Samuel Thibault

Actually they could even be merged, that'd be better since otherwise there would be a lot of duplication. I have attached the resulting merge.

[...]

Quoted 12 lines
Quoted 8 lines

- The Generic embosser PPD file passes cupstestppd, the files for the Index
printers not. The error message is:

**FAIL** Multiple occurrences of option IndexTable choice name 24.

and indeed the option "IndexTable" has two choices with "24" as short name.

Oops... I must admit I didn't test polish & dutch braille since I speak them and don't have an index4 device :) I have attached a patch.

#15 lore raw
In reply to Till Kamppeter

Hello,

Quoted 2 lines · Till Kamppeter, on Sat 12 Dec 2015 09:53:49 -0200, wrote:

Thanks, the problems I mentioned are solved by the patches, but the new fr-braille.po file has some problems (output of cupstestppd):

It seems my mailer simplified the encoding of the attachment, thus turning the file into latin1 instead of utf-8. Here is a patch.

Samuel

#16 lore raw
Quoted 11 lines · Samuel Thibault

Hello,

Quoted 2 lines · Till Kamppeter, on Sat 12 Dec 2015 09:53:49 -0200, wrote:

Thanks, the problems I mentioned are solved by the patches, but the new fr-braille.po file has some problems (output of cupstestppd):

It seems my mailer simplified the encoding of the attachment, thus turning the file into latin1 instead of utf-8. Here is a patch.

Samuel

Thank you very much. The patch works and I have applied and committed it. Now please download the BZR of cups-filters and check whether everything is OK. Thanks.

Till

#17 lore raw

Hello,

Quoted 2 lines · Till Kamppeter, on Sun 13 Dec 2015 09:07:45 -0200, wrote:

Now please download the BZR of cups-filters and check whether everything is OK. Thanks.

It seems I didn't test enough the case where the user didn't select any braille translation to let the embosser do it. The attached patch fixes that case: since we just use fmt to render the text, we need to make converters emit pure text, not xml.

Samuel

=== modified file 'filter/braille/filters/cups-braille.sh.in'

braille/filters/cups-braille.sh.in +4 -4
@@ -224,7 +224,7 @@ echo "DEBUG: Table2 $LIBLOUIS2" >&2
 echo "DEBUG: Table3 $LIBLOUIS3" >&2
 echo "DEBUG: Table4 $LIBLOUIS4" >&2
 
-LIBLOUIS_TABLES="$LIBLOUIS1"
-[ -n "$LIBLOUIS2" ] && LIBLOUIS_TABLES="${LIBLOUIS_TABLES:+$LIBLOUIS_TABLES,}$LIBLOUIS2"
-[ -n "$LIBLOUIS3" ] && LIBLOUIS_TABLES="${LIBLOUIS_TABLES:+$LIBLOUIS_TABLES,}$LIBLOUIS3"
-[ -n "$LIBLOUIS4" ] && LIBLOUIS_TABLES="${LIBLOUIS_TABLES:+$LIBLOUIS_TABLES,}$LIBLOUIS4"
+[ "$LIBLOUIS1" != None ] && LIBLOUIS_TABLES="$LIBLOUIS1"
+[ "$LIBLOUIS2" != None ] && LIBLOUIS_TABLES="${LIBLOUIS_TABLES:+$LIBLOUIS_TABLES,}$LIBLOUIS2"
+[ "$LIBLOUIS3" != None ] && LIBLOUIS_TABLES="${LIBLOUIS_TABLES:+$LIBLOUIS_TABLES,}$LIBLOUIS3"
+[ "$LIBLOUIS4" != None ] && LIBLOUIS_TABLES="${LIBLOUIS_TABLES:+$LIBLOUIS_TABLES,}$LIBLOUIS4"

=== modified file 'filter/braille/filters/texttobrf.in'

braille/filters/texttobrf.in +67 -40

123 lines not on this page · raw message

#18 lore raw
In reply to Till Kamppeter
Quoted 2 lines · Till Kamppeter, on Sun 13 Dec 2015 09:07:45 -0200, wrote:

Now please download the BZR of cups-filters and check whether everything is OK. Thanks.

A second change which will be useful is as attached: for now imagemagick introduces some header in the produced braille-formatted images. We will however probably want to remove it in the future. The attached patch makes cups-filters cope with both the header being present or not.

Samuel

braille/filters/imagetobrf.in +2 -2
@@ -86,9 +86,9 @@ echo "INFO: Converting image" 1>&2
 if [ -z "$FILE" ]
 then
   printf "DEBUG: Calling $RENDER_CALL from stdin\n" 1>&2
-  $RENDER_CALL | tail -n +4
+  $RENDER_CALL | sed -e '/^Width: [0-9]*$/,/^$/d' 
 else
   printf "DEBUG: Calling $RENDER_CALL on '%s'\n" "$FILE" 1>&2
-  $RENDER_CALL < "$FILE" | tail -n +4
+  $RENDER_CALL < "$FILE" | sed -e '/^Width: [0-9]*$/,/^$/d' 
 fi
 echo "INFO: Ready" >&2
#19 lore raw
Quoted 11 lines · Samuel Thibault
Quoted 2 lines · Till Kamppeter, on Sun 13 Dec 2015 09:07:45 -0200, wrote:

Now please download the BZR of cups-filters and check whether everything is OK. Thanks.

A second change which will be useful is as attached: for now imagemagick introduces some header in the produced braille-formatted images. We will however probably want to remove it in the future. The attached patch makes cups-filters cope with both the header being present or not.

Samuel

Thank you very much for the two patches I have applied them to the cups-filters BZR repository now.

Till

#20 lore raw
In reply to Samuel Thibault

Hello,

One thing I forgot to document about Index embossers firmware version, here is a patch.

Samuel

=== modified file 'README'

README +5 -0
@@ -1628,6 +1628,11 @@ lp -o "GraphicDotDistance=160" file.png
 
 to select 1.6mm dots spacing
 
+Troubleshooting: if your embosser starts every document with spurious
+"TM0,BM0,IM0,OM0" or "TM0,BI0", your embosser is most probably still using an
+old 10.20 firmware.  Please either reflash the embosser with a firmware version
+10.30 or above, or select the 10.20 firmware version in the "index" panel of the
+cups printer options.
 
 ----------------------
 Braille output options
#21 lore raw
Quoted 7 lines · Samuel Thibault

Hello,

One thing I forgot to document about Index embossers firmware version, here is a patch.

Samuel

Committed.

Thank you very much.

Till

#22 lore raw
In reply to Samuel Thibault
Quoted 7 lines · Samuel Thibault
Quoted 2 lines
Quoted 2 lines

and drivers/index/ubrlto4dot.c. For what are these files used, especially what does drivers/index/ubrlto4dot.c do?

This file is used to generate the translation table in drivers/index/imageubrltoindexv[34]. I felt it was good to integrate it as "source code" for them, even if actually running the generation in Makefile is more tedious than really useful.

Added the drivers/index/ubrlto4dot.c to cups-filters now and documented the fact in README.

Till

#23 lore raw
In reply to Samuel Thibault

Hello,

I haven't had time to work on braille embossing support in the past months, I thought I should just write down my remaining TODO ideas, so they don't get lost :)

Could the attached file be put in the following directory?

cups-filters/filter/braille/filters/

Thanks,
Samuel

Add title option for pictures

In addition to drawing contour, use textures to render colors of areas

#24 lore raw

Done.

Till

Quoted 12 lines · Samuel Thibault

Hello,

I haven't had time to work on braille embossing support in the past months, I thought I should just write down my remaining TODO ideas, so they don't get lost :)

Could the attached file be put in the following directory?

cups-filters/filter/braille/filters/

Thanks,
Samuel

#25 lore raw
In reply to Samuel Thibault

Hello,

This is an update for the Index braille driver, to add support for text margins.

Samuel

=== modified file 'filter/braille/drivers/index/index.defs'

braille/drivers/index/index.defs +68 -1
@@ -1,5 +1,5 @@
 // 
-// Copyright (c) 2015 Samuel Thibault <[email protected]>
+// Copyright (c) 2015-2016 Samuel Thibault <[email protected]>
 // 
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -56,3 +56,70 @@ Group "Braille"
   Choice "3/User-defined Table 3" ""
   Choice "4/User-defined Table 4" ""
 
+Option "TopMargin/Top margin" PickOne AnySetup 10
+  Choice "0" ""
+  Choice "1" ""
+  *Choice "2" ""
+  Choice "3" ""
+  Choice "4" ""
+  Choice "5" ""
+  Choice "6" ""
+  Choice "7" ""
+  Choice "8" ""
+  Choice "9" ""
+  Choice "10" ""
+
+Option "BottomMargin/Bottom margin" PickOne AnySetup 10
+  Choice "0" ""
+  Choice "1" ""
+  *Choice "2" ""
+  Choice "3" ""
+  Choice "4" ""
+  Choice "5" ""
+  Choice "6" ""
+  Choice "7" ""
+  Choice "8" ""
+  Choice "9" ""
+  Choice "10" ""
+
+Option "InnerMargin/Inner margin" PickOne AnySetup 10
+  Choice "0" ""
+  Choice "1" ""
+  *Choice "2" ""
+  Choice "3" ""
+  Choice "4" ""
+  Choice "5" ""
+  Choice "6" ""
+  Choice "7" ""
+  Choice "8" ""
+  Choice "9" ""
+  Choice "10" ""
+
+Option "OuterMargin/Outer margin" PickOne AnySetup 10
+  Choice "0" ""
+  Choice "1" ""
+  *Choice "2" ""
+  Choice "3" ""
+  Choice "4" ""
+  Choice "5" ""
+  Choice "6" ""
+  Choice "7" ""
+  Choice "8" ""
+  Choice "9" ""
+  Choice "10" ""
+
+Option "PageNumber/Page Number" PickOne AnySetup 10
+  Choice "None/None" ""
+  Choice "Top/Top-middle" ""
+  Choice "TopLeft/Top-left" ""
+  Choice "TopRight/Top-right" ""
+  Choice "Bottom/Bottom-middle" ""
+  Choice "BottomLeft/Bottom-left" ""
+  Choice "BottomRight/Bottom-right" ""
+
+UIConstraints "*TopMargin 0 *PageNumber Top"
+UIConstraints "*TopMargin 0 *PageNumber TopLeft"
+UIConstraints "*TopMargin 0 *PageNumber TopRight"
+UIConstraints "*BottomMargin 0 *PageNumber Bottom"
+UIConstraints "*BottomMargin 0 *PageNumber BottomLeft"
+UIConstraints "*BottomMargin 0 *PageNumber BottomRight"

=== modified file 'filter/braille/drivers/index/index.sh.in'

braille/drivers/index/index.sh.in +17 -5
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015 Samuel Thibault <[email protected]>
+# Copyright (c) 2015-2016 Samuel Thibault <[email protected]>
 # 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -28,6 +28,7 @@ FIRMWARE=$(getOptionNumber IndexFirmware
 FOLDING=$(getOption IndexFolding)
 TABLE=$(getOptionNumber IndexTable)
 MULTIPLEIMPACT=$(getOptionNumber IndexMultipleImpact)
+PAGENUMBER=$(getOption PageNumber)
 
 # Convert from 100th of mm to Inch fraction
 mmToIndexIn () {
@@ -71,7 +72,7 @@ mmToIndexIn () {
 commonOptions() {
   INIT=
   # Disable options we don't want: first line offset and page numbering
-  INIT+=,FO0,PN0
+  INIT+=,FO0
 
   # Support hardware-assisted multiple copies
   if [ $NB != 1 ]
@@ -82,7 +83,7 @@ commonOptions() {
   INIT+=,MI$MULTIPLEIMPACT
 
   # Support page folding
-  case $FOLDING in
+  case "$FOLDING" in
     Single)  INIT+=,DP1 ;;
     Double)  INIT+=,DP2 ;;
     SingleZ) INIT+=,DP5 ;;
@@ -101,11 +102,22 @@ commonOptions() {
     320) INIT+=,TD2 ;;
     *)   printf "ERROR: unsupported '%s' text dot distance\n" "$TEXTDOTDISTANCE" >&2 ; exit 1 ;;
   esac
-  case $GRAPHICDOTDISTANCE in
+  case "$GRAPHICDOTDISTANCE" in
     160) INIT+=,GD2 ;;
     200) INIT+=,GD0 ;;
     250) INIT+=,GD1 ;;
-    *)   printf "ERROR: unsupported '%s'graphic dot distance\n" "$GRAPHICDOTDISTANCE" >&2 ; exit 1 ;;
+    *)   printf "ERROR: unsupported '%s' graphic dot distance\n" "$GRAPHICDOTDISTANCE" >&2 ; exit 1 ;;
+  esac
+
+  case "$PAGENUMBER" in
+    None)        INIT+=,PN0 ;;
+    Top)         INIT+=,PN1 ;;
+    TopLeft)     INIT+=,PN2 ;;
+    TopRight)    INIT+=,PN3 ;;
+    Bottom)      INIT+=,PN4 ;;
+    BottomLeft)  INIT+=,PN5 ;;
+    BottomRight) INIT+=,PN6 ;;
+    *)   echo "ERROR: unsupported $PAGENUMBER page number" >&2 ; exit 1 ;;
   esac
 
   echo "$INIT"

=== modified file 'filter/braille/drivers/index/indexv3.sh.in'

braille/drivers/index/indexv3.sh.in +2 -2
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015 Samuel Thibault <[email protected]>
+# Copyright (c) 2015-2016 Samuel Thibault <[email protected]>
 # 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,7 @@ then
   INIT=$'\033'D
 
   # Disable margins
-  INIT+=TM0,BM0,IM0,OM0
+  INIT+=TM$TOPMARGIN,BM$BOTTOMMARGIN,IM$INNERMARGIN,OM$OUTERMARGIN
 
   # Trying to disable banner page seems to pose problems
   #INIT+=,BP

=== modified file 'filter/braille/drivers/index/indexv4.sh.in'

braille/drivers/index/indexv4.sh.in +2 -2
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015 Samuel Thibault <[email protected]>
+# Copyright (c) 2015-2016 Samuel Thibault <[email protected]>
 # 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -30,7 +30,7 @@ then
   INIT=$'\033'D
 
   # Disable margins
-  INIT+=TM0,BI0
+  INIT+=TM$TOPMARGIN,BI$INNERMARGIN
 
   # Common options
   INIT+="$(setCommonOptions)"

=== modified file 'filter/braille/filters/cups-braille.sh.in'

braille/filters/cups-braille.sh.in +24 -3
@@ -144,7 +144,7 @@ case "$PAGESIZE" in
     ;;
 esac
 
-# TODO: hardcoded margin
+# TODO: hardcoded embosser margin
 PRINTABLEWIDTH=$((PAGEWIDTH - 1000))
 PRINTABLEHEIGHT=$((PAGEHEIGHT - 1000))
 
@@ -167,9 +167,30 @@ esac
 TEXTDOTS=$(getOptionNumber TextDots)
 LINESPACING=$(getOptionNumber LineSpacing)
 
+# Cell dimension, including spacing
+TEXTCELLWIDTH=$(( $TEXTDOTDISTANCE + $TEXTCELLDISTANCE ))
+TEXTCELLHEIGHT=$(( $TEXTDOTDISTANCE * ($TEXTDOTS / 2 - 1) + $LINESPACING ))
+
+if [ "$(getOption TopMargin)" = "" ]
+then
+  # No margin
+  TEXTAREAWIDTH=$PRINTABLEWIDTH
+  TEXTAREAHEIGHT=$PRINTABLEHEIGHT
+else
+  # Margins in cells
+  TOPMARGIN=$(getOptionNumber TopMargin)
+  BOTTOMMARGIN=$(getOptionNumber BottomMargin)
+  INNERMARGIN=$(getOptionNumber InnerMargin)
+  OUTERMARGIN=$(getOptionNumber OuterMargin)
+  
+  # Subtract margins from printable area
+  TEXTAREAWIDTH=$(( $PRINTABLEWIDTH - ($INNERMARGIN + $OUTERMARGIN) * $TEXTCELLWIDTH ))
+  TEXTAREAHEIGHT=$(( $PRINTABLEHEIGHT - ($TOPMARGIN + $BOTTOMMARGIN) * $TEXTCELLHEIGHT ))
+fi
+
 # Compute number of printable cells according to page width and height
-TEXTWIDTH=$(( ($PRINTABLEWIDTH + $TEXTCELLDISTANCE) / ($TEXTDOTDISTANCE + $TEXTCELLDISTANCE) ))
-TEXTHEIGHT=$(( ($PRINTABLEHEIGHT + $LINESPACING) / ($TEXTDOTDISTANCE * ($TEXTDOTS / 2 - 1) + $LINESPACING) ))
+TEXTWIDTH=$(( ($TEXTAREAWIDTH + $TEXTCELLDISTANCE) / $TEXTCELLWIDTH  ))
+TEXTHEIGHT=$(( ($TEXTAREAHEIGHT + $LINESPACING) / $TEXTCELLHEIGHT ))
 
 #
 # Graphic spacing