DolDurma
DolDurma

Reputation: 17301

Using SVG as converted to vector into imageview

After design this below text in Inkscape application I would like to use it in Android into special ImageView

enter image description here

I am a beginner to use this feature in Android IFAIG I convert that on this link as:

http://a-student.github.io/SvgToVectorDrawableConverter.Web/

Now, after converting that I copy that into drawable folder and I assign that into ImageView I don't have this font structure in ImageView and that like with this image:

enter image description here

How can I resolve this problem?

Upvotes: 1

Views: 75

Answers (2)

Codo
Codo

Reputation: 78845

The main problem is that your SVG file depends on a particular font being installed. Whether you convert the SVG using the online tool or whether you use it directly as proposed by GianhTran, it's better to remove this dependency.

So in Inkscape:

  • Select the text
  • Apply Path > Object to Path from the menu

Your text has now been converted into a path. It no longer depends on the font being present.

Upvotes: 1

GianhTran
GianhTran

Reputation: 3711

If you have svg resource file, you can be using for ImageView,

Add below config into your gradle

defaultConfig {
       ....
       vectorDrawables.useSupportLibrary = true
       ...
    } 

And use srcCompat in ImageView

app:srcCompat="your_svg"

Upvotes: 0

Related Questions