# multiplatform


07/31/2019, 8:14 PM
I'm nearly done with a full multiplatform UI library that spans Android, Web, iOS, and JavaFX, with the potential for more available. One of the last things left is common icons - for example, having a common back button icon available is really convenient. They need to be vectors images. I'm stuck between the ideas of using FontAwesome on all platforms or supporting SVGs, where I have every platform but iOS doing fairly well already. However, when it comes to implementing SVGs on iOS, just importing a cocoapod isn't easy, and I'm not sure what the interactions of it with pushing the library to Maven are. I'm not insane enough to write my own full-blown SVG renderer in K-N, but I think I could do one that supported only the
element fairly easily. Between path-only SVGs (material icons) and FontAwesome, which would you prefer? Or do you think you can tell me enough to get a cocoapod fully integrated with a K-N library that will be pushed up to and consumed from maven?

Casey Brooks

07/31/2019, 8:25 PM
SVGs are probably the better route to go overall, but you’ll probably want to have some step in your build that transforms the raw SVG files into a format that’s best for each platform. Android needs them converted to
, you might convert to an icon font for web, and then to PNG for iOS. I’m not quite sure about the viability of using FontAwesome on all platforms. I think it can technically be done, but the whole concept of “icon fonts” are really browser-specific.


07/31/2019, 8:30 PM
I've looked around, and FontAwesome seems workable on every platform I've looked into if you use the raw font. I suppose I could write a Gradle plugin that pre-converts SVGs, but one of the cool things I have right now is that you can load an SVG image from a string at runtime. It might be worth the sacrifice though, as making that plugin means I can add the rest of asset-copying right there.


07/31/2019, 10:01 PM
VectorDrawables have been ported to iOS by Uber:


08/01/2019, 12:56 PM
I never found an svg library that I actually liked on iOS. Most of them have some kind of drawback, whether it is incomplete support for the spec or just being clumsy to use. SVGKit was the most complete that I found. It’s not the best developer experience to use and didn’t handle everything that we threw at it without some modifications to the svgs themselves. Adobe products can export some awfully overly complex svgs that a browser could handle but not SVGKit.