I want to render LaTeX inside Roblox, a 3D game engine, to create educational math games. There are 3 problems with this plan:
- You can only run Lua code in Roblox, so natively compiling LaTeX is not possible.
- 2D user interfaces can only render text and pre-uploaded images, so displaying a PDF is not possible.
- Decompiling an image file is against the terms of service because it avoids image moderation.
Current solutions solve problem 1 by piping their TeX files to an external server to be compiled, and they solve problem 2 by returning a PNG that gets decompiled and rendered as individual pixels with text boxes. Unfortunately, problem 3 makes the PNG solution unsafe, and rendering PNGs as individual pixels is slow.
Instead, I want a solution that does not break the terms of service and renders TeX natively using images for characters and symbols. Given my constraints, what is a viable way to do this?
What I have researched
It appears that what I am wanting to achieve is a DVI driver. As PDF is a significantly more complicated format, I see this as the most practical option. My working plan is to send the TeX code to a server, return the outputted DVI, and parse the DVI inside Roblox to be rendered as images.
I am unsure of where to go from here. I found this DVI spec, but I read that XeTeX does not use the original DVI spec (not sure about pdfTeX and LuaTeX). I do not know where to find updated specs.