Class EightToSixDotMapper

java.lang.Object
org.daisy.braille.tools.EightToSixDotMapper

public class EightToSixDotMapper extends Object
Provides a utility to map eight dot patterns to six dot patterns. If the resulting patterns are aligned without any row spacing, the patterns will appear the same as the original 8-dot patterns. This can be useful when printing 8-dot files to an embosser using a 6-dot table.
Author:
Joel HÃ¥kansson
  • Constructor Details

    • EightToSixDotMapper

      public EightToSixDotMapper(int width)
      Creates a new SixDotMapper with the specified line length
      Parameters:
      width - the length of the lines, in characters
  • Method Details

    • write

      public void write(String braille)
      Writes a string of braille. Values must be between 0x2800 and 0x28FF.
      Parameters:
      braille - characters in the range 0x2800 to 0x28FF
      Throws:
      IllegalArgumentException - if the number of characters exceeds the line width
    • newLine

      public void newLine(int rowgap)
      Starts a new line
      Parameters:
      rowgap - the row gap following the line currently in the buffer
    • flush

      public void flush()
      Flushes the last line of characters. This will empty the buffer.
    • hasMoreFullLines

      public boolean hasMoreFullLines()
    • hasMoreLines

      public boolean hasMoreLines()
    • readLine

      public String readLine()
      Reads a line from the output buffer. When the last line is read, the grid alignment resets (the characters are padded to their full 6-dot height).
      Returns:
      returns the line or null if the buffer is empty