@@ 110,12 110,15 @@ lowerVars "-rhapsode" = CSSCond.B True
lowerVars _ = CSSCond.B False
lowerToks _ = CSSCond.B False
-renderLayout drawText (LayoutSpan ((x, y), _) font self) = do
- drawText' <- drawText $ fragmentGlyphs self
- -- FIXME Allow CSS to set the colour.
- liftIO $ arDraw drawText' [TextTransformMultiply $ V4 0 0 0 1]
- (V2 (fromEnum x) (fromEnum y))
-renderLayout drawText node = layoutGetChilds node `forM` renderLayout drawText
+renderLayout atlases drawText (LayoutSpan ((x, y), _) font self)
+ | Just atlas <- M.lookup (pattern font, fontSize font) atlases = do
+ drawText' <- drawText $ fragmentGlyphs self
+ -- FIXME Allow CSS to set the colour.
+ liftIO $ arDraw drawText' [TextTransformMultiply $ V4 0 0 0 1]
+ (V2 (fromEnum x) (fromEnum y))
+renderLayout atlases drawText node = do
+ layoutGetChilds node `forM` renderLayout atlases drawText
+ return ()
main :: IO ()
main = do
@@ 189,7 192,7 @@ main = do
let outerbox = zeroBox { B.min = size, B.size = size, B.max = size }
let layout = boxLayout outerbox (finalizeCSS' sysfont style) False
- renderLayout drawText layout
+ renderLayout atlases drawText layout
liftIO $ glSwapWindow w
unless (QuitEvent `elem` events) loop