• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (c) 2015-2018 Samuel Thibault <samuel.thibault@ens-lyon.org>
3#
4# Permission is hereby granted, free of charge, to any person obtaining a copy
5# of this software and associated documentation files (the "Software"), to deal
6# in the Software without restriction, including without limitation the rights
7# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8# copies of the Software, and to permit persons to whom the Software is
9# furnished to do so, subject to the following conditions:
10#
11#
12# The above copyright notice and this permission notice shall be included in
13# all copies or substantial portions of the Software.
14#
15#
16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
19# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22# THE SOFTWARE.
23#
24
25. @CUPS_DATADIR@/braille/index.sh
26
27if [ $FIRMWARE -ge 103000 ]
28then
29  # Firmware 10.30 and above support temporary parameters
30  INIT=$'\033'D
31
32  # Margins are implemented in software
33  INIT+=TM0,BI0
34
35  # Common options
36  INIT+="$(commonOptions)"
37  [ $? = 0 ] || exit 1
38
39  # Paper size
40  INIT+=,CH$PRINTABLETEXTWIDTH,LP$PRINTABLETEXTHEIGHT
41
42  case $LINESPACING in
43    500)  INIT+=,LS50 ;;
44    1000) INIT+=,LS100 ;;
45    *)
46      echo "ERROR: unsupported $LINESPACING line spacing" >&2
47      exit 1
48      ;;
49  esac
50
51  if [ $LIBLOUIS1 != None -o \
52       $LIBLOUIS2 != None -o \
53       $LIBLOUIS3 != None -o \
54       $LIBLOUIS4 != None ]
55  then
56    # software-translated, enforce a 6-dot table if needed
57    case $TEXTDOTS in
58      # Firmware 11.02.1 and above allow to make sure to be using a 6-dot table
59      6) INIT+=,BT0 ;;
60      # Firmware 11.02.1 and above allow to make sure to be using a 8-dot table
61      8) INIT+=,BT6 ;;
62      *)   echo "ERROR: unsupported $TEXTDOTS dots" >&2 ; exit 1 ;;
63    esac
64  else
65    # Hoping the user configured a table with appropriate number of dots
66    INIT+=,BT$TABLE
67  fi
68
69  # roger
70  INIT+=";"
71else
72  # No support for temporary parameters.  Hoping that the user configured CUPS
73  # the same way as the embosser.
74  INIT=
75fi
76