Created
December 28, 2017 16:35
-
-
Save leftaroundabout/f09cecbdb39c39fc19fc8f560ad8939d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Graphics.Text.PCF | |
import Data.Foldable (fold) | |
import System.Environment (getArgs) | |
main :: IO () | |
main = do | |
args <- getArgs | |
let style = case ( any (`elem`["-b","--bold"]) args | |
, any (`elem`["-i","--italic"]) args | |
, any (`elem`["-bi","-ib"]) args ) of | |
(_ , _, True) -> "BIS" | |
(False, False, _) -> "RS" | |
(False, True , _) -> "IS" | |
(True , False, _) -> "BS" | |
(True , True , _) -> "BIS" | |
Right font <- loadPCF $ "/usr/share/fonts/X11/100dpi/lu"++style++"12.pcf.gz" | |
interact $ renderBraillePCF font | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A simple script that renders text in Braille-rasterization, à la drawille. Uses the pcf-font library; the fonts should be available on Ubuntu systems.