lántas script stuff

This commit is contained in:
Rhiannon Morris 2021-04-28 12:29:21 +02:00
parent 13836bac8b
commit 292c5d5920
5 changed files with 217 additions and 114 deletions

View file

@ -1,6 +1,6 @@
module GlyphsBase (module GlyphsBase, module Svg) where
import Svg hiding (shiftX, shiftY, shift, width)
import Svg hiding (shiftX, shiftY, shift, width, size)
import qualified Svg
import Data.List.NonEmpty (NonEmpty (..))
@ -11,6 +11,7 @@ import Prelude hiding (Word)
data Glyph = G {path :: Segs, width :: Double}
-- | base amounts
charHeight', lineHeight', spaceWidth', gap' :: Double
charHeight' = 13
lineHeight' = 15
@ -20,6 +21,10 @@ gap' = 1.5
withSize :: MonadReader Env m => (Double -> a) -> m a
withSize f = asks \E {size} -> f size
size :: MonadReader Env m => m Double
size = withSize id
-- | multiplied by size
charHeight, lineHeight, spaceWidth, margin, gap :: MonadReader Env m => m Double
charHeight = withSize (* charHeight')
lineHeight = withSize (* lineHeight')