# nano-ui-rgfw
Lightweight desktop backend for [nano-ui](https://github.com/goolord/nano-ui) built on [RGFW](https://github.com/ColleagueRiley/RGFW) and OpenGL 3.2. RGFW's C source compiles with the package and text renders with the bundled [Cozette](https://github.com/slavfox/Cozette) bitmap font, so there are no dependencies beyond native OS windowing and OpenGL.
```haskell
{-# LANGUAGE OverloadedStrings #-}
import NanoUI
import NanoUI.Backend.Rgfw (RgfwOptions (..), defaultRgfwOptions, runRgfwApp)
main :: IO ()
main = runRgfwApp defaultRgfwOptions {optScale = 2} (label "Hello")
```
`runRgfwAppReduce` pairs a `model -> NanoUIE msg ()` view with `msg -> model -> model` (via `nano-ui-emit`), and `runRgfwAppWith` runs custom initialization after window creation and before frame 1. Configure window geometry (`optWindow`, using core `WindowSettings`), theme, UI scale (`optScale = 0` follows the monitor scale), and animation refresh rate through `RgfwOptions`.
Core themes work here via `applyRgfwTheme`, which adapts surfaces to square corners and 1 px borders. Cozette renders at 7x13 px at 1x scale (EPX-upscaled at 2x and 4x) as a single fixed-size bitmap font, so `fontSize` and `fontMono` do not change glyph size, and all RGFW windows are opaque. Use [nano-ui-sdl](https://hackage.haskell.org/package/nano-ui-sdl) when you need TrueType typography, IME pre-edit, OS file drops, or translucent windows.
## System requirements
- **Linux:** X11, Xcursor, Xrandr, and Xi development headers, plus OpenGL 3.2
- **macOS:** Cocoa and OpenGL 3.2
- **Windows:** `gdi32`, `user32`, `shell32`, and OpenGL 3.2
Link executables with `-threaded` so background tasks keep running while the event loop sleeps.
## Documentation
- [The nano-ui Book](https://goolord.github.io/nano-ui/book/): Tutorials, widget gallery, and backend overview.
## License
MIT. The bundled Cozette bitmap font is MIT-licensed by its author (`LICENSE-Cozette`); include that notice alongside distributed applications.