AndroidAssetStudio icon indicating copy to clipboard operation
AndroidAssetStudio copied to clipboard

Export to vector drawable when possible (primarily action bar/tab, and generic icons)

Open AndroidDeveloperLB opened this issue 7 years ago • 12 comments

because now it's supported on various Android versions.

AndroidDeveloperLB avatar Aug 25 '16 23:08 AndroidDeveloperLB

that's a good idea, but will take a bunch of new code... i hope to revamp the asset studio at some point, this would be a great feature request for that time

romannurik avatar Sep 05 '16 16:09 romannurik

You could export to SVG, so that designers could also modify the files easier.

AndroidDeveloperLB avatar Sep 05 '16 16:09 AndroidDeveloperLB

Explored this; it's basically not feasible to export vectors for any foreground images except clipart. I think it's probably better to use the Android Icon Animator tool.

See also #121 and #123

romannurik avatar Jan 17 '17 15:01 romannurik

Why not ? You can already convert SVG files to VectorDrawables, like on Android Studio. When you create the image files from the selection (not from image files of the user), it uses SVG files too, no?

AndroidDeveloperLB avatar Jan 17 '17 15:01 AndroidDeveloperLB

Yes it would be possible for clipart, but not custom uploaded images, or text. I'll actually re-open and re-frame the request.

romannurik avatar Jan 17 '17 15:01 romannurik

Text is not possible only because VectorDrawable doesn't support it (sadly), right? Just like it doesn't support many other SVG features, like gradients... But I think you can export to SVG and to VectorDrawable , by converting to paths.

AndroidDeveloperLB avatar Jan 17 '17 15:01 AndroidDeveloperLB

text isn't possible because we'd need to convert the text to paths, and this isn't possible in the browser AFAIK (you can't extract shapes from a web font).

romannurik avatar Jan 17 '17 15:01 romannurik

But fonts are by definition vectorized, no? So that no matter how you resize them, they will keep being sharp and nice... There are even tutorials for this. Here's an example: http://www.graphic-design-employment.com/adobe-illustrator-how-to-convert.html Are web fonts different?

AndroidDeveloperLB avatar Jan 17 '17 15:01 AndroidDeveloperLB

I'm not sure I follow. For a web-based tool to generator vector icons from text that uses a web font, the web-based tool needs to somehow have access to the font's path data. This isn't feasible right now. If you really want a vector drawable where the shape is a letterform from a web font, the best option is to download the font, use it in something like Illustrator or Sketch, convert the type layer to outlines ('expand' in Illustrator), export to SVG, and convert to vector drawables using any one of the popular SVG-to-VD converters (e.g. the Vector Asset Studio in Android Studio, or the Android Icon Animator tool, or something else)

romannurik avatar Jan 17 '17 16:01 romannurik

It's not possible to get the font's paths? So how does it get drawn? Only by black-box commands of the web browser's engine?

AndroidDeveloperLB avatar Jan 17 '17 22:01 AndroidDeveloperLB

Yes take a look at imagefield.js if you're interested.

romannurik avatar Jan 17 '17 23:01 romannurik

OK sorry. Just not my field, so I sometimes don't know what is possible and what's not on a web browser. It's too bad though. Isn't it even possible to handle fonts that are inside the website? Like Roboto ?

AndroidDeveloperLB avatar Jan 17 '17 23:01 AndroidDeveloperLB