diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/App.java b/src/main/java/de/tudresden/inf/mci/brailleplot/App.java index 279e78a74bf377fa25f3eaa7938cbca924f1d215..278878678e8e88268d4821d1da54a8bd748d93ec 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/App.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/App.java @@ -6,6 +6,7 @@ import de.tudresden.inf.mci.brailleplot.configparser.Printer; import de.tudresden.inf.mci.brailleplot.layout.PlotCanvas; import de.tudresden.inf.mci.brailleplot.layout.RasterCanvas; +import de.tudresden.inf.mci.brailleplot.layout.Rectangle; import de.tudresden.inf.mci.brailleplot.point.Point2DValued; import de.tudresden.inf.mci.brailleplot.printabledata.FloatingPointData; import de.tudresden.inf.mci.brailleplot.printerbackend.PrintDirector; @@ -24,6 +25,9 @@ import de.tudresden.inf.mci.brailleplot.csvparser.CsvType; import de.tudresden.inf.mci.brailleplot.datacontainers.CategoricalPointListContainer; import de.tudresden.inf.mci.brailleplot.datacontainers.PointList; import de.tudresden.inf.mci.brailleplot.diagrams.BarChart; +import de.tudresden.inf.mci.brailleplot.rendering.BrailleText; +import de.tudresden.inf.mci.brailleplot.rendering.FunctionalRasterizer; +import de.tudresden.inf.mci.brailleplot.rendering.LiblouisBrailleTextRasterizer; import de.tudresden.inf.mci.brailleplot.rendering.MasterRenderer; import de.tudresden.inf.mci.brailleplot.svgexporter.BoolFloatingPointDataSvgExporter; import de.tudresden.inf.mci.brailleplot.svgexporter.BoolMatrixDataSvgExporter; @@ -206,6 +210,19 @@ public final class App { SvgExporter<PlotCanvas> floatSvgExporter = new BoolFloatingPointDataSvgExporter(floatCanvas); floatSvgExporter.render(); floatSvgExporter.dump("floatingPointData"); + LiblouisBrailleTextRasterizer textRasterizer = new LiblouisBrailleTextRasterizer(indexV4Printer); + renderer.getRenderingBase().registerRasterizer(new FunctionalRasterizer<BrailleText>(BrailleText.class, textRasterizer)); + RasterCanvas refCanvas = renderer.rasterize(new BrailleText(" ", new Rectangle(0, 0, 0, 0))); + + String text = "()[]üÄß@`"; + int xpos = 0; + int ypos = 0; + int maxWidth = 20 * 2; + int height = textRasterizer.calculateRequiredHeight(text, xpos, ypos, maxWidth, refCanvas); + Rectangle textArea = new Rectangle(xpos, ypos, maxWidth, height); + RasterCanvas mcanvas = renderer.rasterize(new BrailleText(text, textArea)); + + // Check if some SpoolerService/Printservice exists if (!PrintDirector.isPrintServiceOn()) { diff --git a/src/main/resources/mapping/kurzschrift_DE.properties b/src/main/resources/mapping/kurzschrift_DE.properties index e27224818ee4323cc94f2c4ab9845d4c821785f3..c7345e74ab0191915d6df5128f9abccfcf6172b6 100644 --- a/src/main/resources/mapping/kurzschrift_DE.properties +++ b/src/main/resources/mapping/kurzschrift_DE.properties @@ -7,7 +7,7 @@ # This table contains a mapping from letters to a 6*n-bit-string, representing the braillecell. # It's used by the BrailleTextRasterizer. # All the chars which need more than one braillecell are already taken into consideration in the -# kurzschrift table. +# kurzschrift table. Mostly taken form the de-chardefs6.cti. # ============================================================================= #Special characters @@ -24,6 +24,7 @@ '=000001 # = character )=011011 +(=011011 \u0023=001111 +=011010 @@ -36,6 +37,12 @@ <=000011 _=000111 ^=110111 +\==011110 +$=000101 +|=001100 +{=111011 +}=011111 +`=001110 # Numbers