0

I've developed an interactive audio visualization engine. I need to make its GUI scalable to various screen sizes with various PPIs (this includes both very large screens and mobile devices). Designer simply sent me a PSD with graphical representation of supported widgets. I'm exporting these into PNGs. The problem is that those bitmaps are of course not scalable and looks ugly.

I've thought about several ways how to achieve resolution and PPI independent GUI:

  • Export PNGs with various sizes and select the current set on runtime (waste of space simply for storing bitmaps in various resolutions)
  • Use scale 9 images only (no fancy stuff)
  • Use SVG (not supported by rendering APIs, could use smth like nanovg for OpenGL but what to do with raw framebuffer then?, also performance problems and too much complexity for what I need)

I came to an idea to pregenerate bitmaps at runtime for specific device once and use them afterwards. Are there any specific libraries for that and maybe already available themes which I could employ for now? I imagine tool could work similarly to how cairo graphics library or javascript canvas work by reading command list and outputting a bitmap. Any other ideas?

user206334
  • 850
  • 1
  • 8
  • 18
  • So why not use one of the tools you mentioned and just do it? We certainly can't help you, particularly without even knowing anything about the language or environment you're using. – Dark Falcon Nov 13 '14 at 17:51
  • @DarkFalcon Because those tools have their aforementioned issues. Application is coded in C with Lua scripting interface. – user206334 Nov 13 '14 at 18:18
  • So you're suggesting I should modify Cairo to suit my needs (e.g. to develop custom format to store glyphs as Cairo commands and so on...) One problem is how to express SVG or AI paths in Cairo commands. – user206334 Nov 13 '14 at 18:47
  • 1
    Draw it directly with the API or record it: http://cairographics.org/manual/cairo-Recording-Surfaces.html Or search for "render svg cairo" in Google and pick a lib, such as http://www.t2-project.org/packages/libsvg-cairo.html – Dark Falcon Nov 13 '14 at 19:03
  • @DarkFalcon Thank you. This could be the way. Do you know how much OpenGL backend is completed in Cairo (I could use that) cause documentation seems stale. I also took a look at Skia which it seems can do the same and Android hwui (have no idea what it can do apart from it replacing Skia as 2d rendering backend). – user206334 Nov 14 '14 at 09:16
  • @DarkFalcon libsvg-cairo is abandoned, it seems – user206334 Nov 14 '14 at 12:27

1 Answers1

0

One possible solution is this:

CPlayer is a procedural graphics player with an IMGUI toolkit. It can be used for anything from quick demos, prototyping graphics apps, to full-fledged apps and games.

http://luapower.com/cplayer.html

user206334
  • 850
  • 1
  • 8
  • 18