lántas script stuff
This commit is contained in:
parent
13836bac8b
commit
292c5d5920
5 changed files with 217 additions and 114 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue