[Mammoth/Teton] Add an OpenFile interface and use it to load a font.

This commit is contained in:
Drew Galbraith 2023-11-22 16:42:42 -08:00
parent 4fd17a59ea
commit 86ce0a68a3
6 changed files with 84 additions and 21 deletions

View file

@ -25,19 +25,7 @@ uint64_t main(uint64_t init_port) {
// 2. Parse a font file.
GetEndpointRequest req;
req.set_endpoint_name("victoriafalls");
Endpoint resp;
check(client.GetEndpoint(req, resp));
VFSClient vfs(resp.endpoint());
OpenFileRequest freq;
freq.set_path("/default8x16.psfu");
OpenFileResponse fresp;
check(vfs.OpenFile(freq, fresp));
Psf psf(mmth::OwnedMemoryRegion::FromCapability(fresp.memory()));
Psf psf("/default8x16.psfu");
psf.DumpHeader();
Console console(fbuf, psf);