more lántas script (finish drawing glyphs)
This commit is contained in:
parent
0dea4d358f
commit
13836bac8b
6 changed files with 490 additions and 296 deletions
33
laantas-script/Main.hs
Normal file
33
laantas-script/Main.hs
Normal file
|
@ -0,0 +1,33 @@
|
|||
{-# OPTIONS_GHC -fdefer-typed-holes #-}
|
||||
|
||||
import Prelude hiding (Word)
|
||||
import Svg
|
||||
import qualified Glyphs as G
|
||||
import Options.Applicative
|
||||
import Data.Functor
|
||||
|
||||
|
||||
data Options =
|
||||
Opts { width, size, stroke :: {-# UNPACK #-} !Double }
|
||||
deriving Show
|
||||
|
||||
options :: IO Options
|
||||
options = execParser desc where
|
||||
desc = info (opts <**> helper) $
|
||||
fullDesc <> header "render lántas text as svg"
|
||||
opts =
|
||||
Opts <$> dimOpt 'W' "width" Nothing
|
||||
<*> (dimOpt' 'S' "size" "text size" (Just 10)
|
||||
<&> (/ G.lineHeight'))
|
||||
<*> dimOpt' 'K' "stroke" "line thickness" (Just 2)
|
||||
dimOpt s l d = dimOpt' s l l d
|
||||
dimOpt' s l n d = option auto $ mconcat $
|
||||
[short s, long l, help $ n <> " in pixels", metavar "SIZE"] <>
|
||||
maybe [] (\x -> [value x]) d
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
Opts {..} <- options
|
||||
let lántas = _
|
||||
let res = G.doGlyphs [lántas, lántas] (E {..})
|
||||
writeFile "/home/niss/e.svg" $ show res
|
Loading…
Add table
Add a link
Reference in a new issue