romannurik / AndroidAssetStudio

A set of web-based tools for generating graphics and other assets that would eventually be in an Android application's res/ directory.
Apache License 2.0
6.48k stars 1.35k forks source link

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

Open AndroidDeveloperLB opened 8 years ago

AndroidDeveloperLB commented 8 years ago

because now it's supported on various Android versions.

romannurik commented 8 years ago

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

AndroidDeveloperLB commented 8 years ago

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

romannurik commented 7 years ago

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

AndroidDeveloperLB commented 7 years ago

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?

romannurik commented 7 years ago

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

AndroidDeveloperLB commented 7 years ago

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.

romannurik commented 7 years ago

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).

AndroidDeveloperLB commented 7 years ago

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?

romannurik commented 7 years ago

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)

AndroidDeveloperLB commented 7 years ago

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?

romannurik commented 7 years ago

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

AndroidDeveloperLB commented 7 years ago

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 ?