Close

Back to word document

A project log for BrailleRAP DIY Braille embosser

An Open source Braille embosser in the spirit of RepRap

stephaneStephane 06/22/2023 at 15:290 Comments

About a week ago, we made some tests integrating pandoc in our Braille translation software AccessBrailleRAP

Once you get a good translation algorithm, the major issue about translating document in Braille, is that Braille characters are fixed size characters. Basically, Braille is a tactile alphabet where letter are composed of a 6 dots matrix (or 8 dots matrix), each combination in the matrix corresponding to a letter. 

When you read Braille letter, all the 6 dots of the matrix must be under the same finger, this is why Braille is fixed size and normalized.

Therefore, you can't represent big Braille character nor little. As you can represent capital letters and number, there is an 'emphasis' encoding available but no way to print Italic, underline, bold or all our favorite typographic effect. So, to translate a word or openoffice even a markdown or an html document in Braille, you need a tool to extract plain text, trying to preserve the text presentation with space characters. This is where pandoc is useful, pandoc is an open source tools to convert document in different format, you can convert an open office .odt to pdf or a Markdown document to .odt, and you can convert all this beautiful file format to plain text.

As we have a python backend in AccesBrailleRAP, integrating pandoc is not an issue. Just adding an import button on the GUI write the 10 lines of code to get a filename, give it to pandoc and get plain text back. But you need to install pandoc and have it available in the path for AccessBrailleRAP software. As the operation is a little tricky for most of our BrailleRAP users, we decide to go a step further and build an installation script to install everything you need to use a BrailleRAP.

At this time, if you want to use AccessBrailleRAP, you need to install :

- The virtual com port drivers to communicate with the BrailleRAP MKS Board

- pandoc

- Chrome

As and installation tools, we choose NSIS, an open source tools to build installation software. NSIS allow you to build an installation script just by providing a little script defining which file you want to include and where you want to put it on the PC.

 ; Set output path to the installation directory.
    SetOutPath $INSTDIR
    
    ; AccessBrailleRAP
    File "AccessBrailleRAP.exe"
    File "parameters.json"
    ; pandoc
    File "pandoc.exe"
    ; drivers
    File "CDM212364_Setup.exe"
    File "CH341SER.EXE"
  

run the drivers installation.

  ExecWait '"$INSTDIR\CDM212364_Setup.exe"'
  ExecWait '"$INSTDIR\CH341SER.exe"'

defining some registry keys to make the "uninstall" option available

; Write the installation path into the registry
  WriteRegStr HKLM SOFTWARE\AccessBrailleRAP "Install_Dir" "$INSTDIR"
  
  ; Write the uninstall keys for Windows
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AccessBrailleRAP" "DisplayName" "AccessBrailleRAP"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AccessBrailleRAP" "UninstallString" '"$INSTDIR\uninstall.exe"'
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AccessBrailleRAP" "NoModify" 1
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AccessBrailleRAP" "NoRepair" 1
  WriteUninstaller "$INSTDIR\uninstall.exe"

and defining the uninstall procedure, deleting all installed files, and created registry key.

  ; Remove registry keys
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AccessBrailleRAP"
  DeleteRegKey HKLM SOFTWARE\AccessBrailleRAP

  ; Remove files and uninstaller
  Delete $INSTDIR\AccessBrailleRAP.exe
  Delete $INSTDIR\parameters.json
  Delete $INSTDIR\uninstall.exe
  Delete $INSTDIR\CDM212364_Setup.exe
  Delete $INSTDIR\CH341SER.EXE

  ; Remove shortcuts, if any
  Delete "$SMPROGRAMS\AccessBrailleRAP\*.lnk"

  ; Remove directories
  RMDir "$SMPROGRAMS\AccessBrailleRAP"
  RMDir "$INSTDIR"

Once your installation script defined (we intensively use the tutorials provide by NSIS), you just have to use the NSIS compiler and you get an installation script : AccessBrailleRAPSetup.exe


you can select if you want the drivers or not

And now, you have everything installed in order to use a BrailleRAP, plus the AccessBrailleRAP in the windows start menu.

Discussions