liblouis/liblouis-java

Support for liblouis translation modes

Closed this issue · 5 comments

Liblouis distinguishes different translation modes. Translator.java currently does not support these translation modes. It uses a default mode of 0.
It would be very useful to be able to set the translation mode so that for example Unicode braille characters can be generated (this requires setting the mode to 132 (=dotsIO | ucBrl).

I currently do this by prepending the table with "unicode.dis,". Would that be a solution for you or are there other use cases for supporting mode?

That sounds great and should fit my use case for creating 8-dot computer braille output.
I tried setting the tables to "unicode.dis,en-us-g2.ctb", but then I am getting strange unicode characters, not braille characters. I am working with the most recent liblouis tables and with a liblouis dll copied from the BrailleBuster distribution (which uses UTF-32LE and is version 2.6.2) on windows. Maybe there is something wrong with the liblouis.dll and I have to build it myself (but the default translation mode does work perfectly).

So you're not getting characters in the range 2800-28FF? This sound like an encoding problem. But the bindings should work with DLL's compiled with UTF32 or UTF16. I've never had any problems with the DLL that I built. You shouldn't have to build the DLL yourself. But could you perhaps try it with the one in this file? (it's a ZIP)

Thank you for the reference to the dll. Prefixing with "unicode.dis" works well and there is indeed no need to assign translation modes. My problems resulted from issues with the dll (I used a 64 bit version of the JRE) and not realizing that Java text controls (JTextField, JTextArea) do not automatically display unicode characters. I needed to assign a compatible font. For me the following code worked:
myTextField.setFont(new Font("Segoe UI Symbol", Font.PLAIN, 12));

Good! Let me know if you need a newer version of the DLL.