diff options
| author | Akshay Nair <phenax5@gmail.com> | 2024-12-25 14:25:09 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2024-12-25 14:25:09 +0530 |
| commit | 4e74eeebbaa441cda3a6846c47d82516878f8f05 (patch) | |
| tree | 7a67bfd8cfbef2092931fd4d12a8ce69b3b3d2d4 /src/Chelleport/Context.hs | |
| parent | 82d612b7c37b432bc4abd8e158d6fe076d391ddc (diff) | |
| download | chelleport-4e74eeebbaa441cda3a6846c47d82516878f8f05.tar.gz chelleport-4e74eeebbaa441cda3a6846c47d82516878f8f05.zip | |
Add searching indication text for search mode + a lot of refactoring
Diffstat (limited to '')
| -rw-r--r-- | src/Chelleport/Context.hs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/Chelleport/Context.hs b/src/Chelleport/Context.hs index 30d8516..3109e05 100644 --- a/src/Chelleport/Context.hs +++ b/src/Chelleport/Context.hs @@ -19,7 +19,7 @@ initializeContext = do window <- initializeWindow renderer <- initializeRenderer window - font <- loadFont + (fontSm, fontLg) <- loadFonts display <- X11.openDisplay "" @@ -27,18 +27,21 @@ initializeContext = do DrawContext { ctxWindow = window, ctxRenderer = renderer, - ctxFont = font, + ctxFontLarge = fontLg, + ctxFontSmall = fontSm, ctxX11Display = display } rawFontData :: ByteString rawFontData = $(embedFileRelative "./static/font.ttf") -loadFont :: IO TTF.Font -loadFont = do - font <- TTF.decode rawFontData fontSize - TTF.setStyle font [TTF.Bold] - pure font +loadFonts :: IO (TTF.Font, TTF.Font) +loadFonts = do + fontSm <- TTF.decode rawFontData 14 + TTF.setStyle fontSm [TTF.Bold] + fontLg <- TTF.decode rawFontData 24 + TTF.setStyle fontLg [TTF.Bold] + pure (fontSm, fontLg) initializeRenderer :: SDL.Window -> IO SDL.Renderer initializeRenderer window = do |
