M Graphics/Layout/CSS/Internal.hs => Graphics/Layout/CSS/Internal.hs +3 -0
@@ 89,6 89,9 @@ hbScale f = fontSize f*hbUnit
hbUnit = 64 :: Double
pattern2hbfont :: Pattern -> Int -> [Variation] -> Font
+pattern2hbfont pat scale variations | Nothing <- lookup "file" pat =
+ let pat' = setValue "file" "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" pat
+ in pattern2hbfont pat' scale variations
pattern2hbfont pat scale variations = createFontWithOptions options face
where
bytes = unsafePerformIO $ B.readFile $ getValue0 "file" pat
M Graphics/Layout/Inline.hs => Graphics/Layout/Inline.hs +2 -2
@@ 28,8 28,8 @@ inlineSize :: (CastDouble x, CastDouble y) => Font' -> Paragraph -> Size x y
inlineSize font self = Size (c font $ width r) (c font $ height r)
where r = paragraphRect $ layoutPlain self
inlineChildren :: [x] -> Paragraph -> [(x, Fragment)]
-inlineChildren vals self = concat $ map inner $ zip vals $ spanLayouts $ layoutPlain self
- where inner (x, SpanLayout y) = map (x,) y
+inlineChildren vals self = zip vals $ concat $ map inner $ spanLayouts $ layoutPlain self
+ where inner (SpanLayout y) = y
layoutPlain' :: Paragraph -> Int32 -> Rect Int32
layoutPlain' (Paragraph a b c d) width =