1

Is there some kind of icon set that can be used in Android that contains icons similar to the GitHub Icons. For example, the events push, pull, fork, merge, comment ...

Or is this something that is only possible in a browser?

I was looking to use the UTF-8 encoding in a Textview but it did not render properly. From what I read it's a proprietary set of UTF character codes.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Etienne Lawlor
  • 6,817
  • 18
  • 77
  • 89

1 Answers1

1

Just use the GitHub icons. Here's the assets folder for the official GitHub Android app including the TTF font. The license is pretty permissive.

Assuming you have a TextView with the id text and the TTF file in your assets folder, you can do something like this:

    TextView text = (TextView) findViewById(R.id.text);
    text.setText("Clone \uf04c");
    text.setTypeface(Typeface.createFromAsset(getAssets(), "octicons-regular-webfont.ttf"));
kabuko
  • 36,028
  • 10
  • 80
  • 93
  • Thanks @kabuko. This appears to be working for many UTF character code sequences except for `UTF+f009`. For some reason this looks to be rendering an icon similar to `UTF+f00a`. Why do you think that is happening? – Etienne Lawlor Jul 19 '13 at 23:29
  • @toobsco42 Nope, no idea why this is happening for you. I'd double check your work. I looked at the font `UTF+f009` seems to be rendering fine and differently from `UTF+f00a` for me. – kabuko Jul 21 '13 at 00:46
  • Hey @kabuko, so i set my `TextView` like this `text.setText("\uf007-\uf008-\uf009-\uf00A-\uf00B");` and the ouptut looks like this http://i.stack.imgur.com/MLH0I.png – Etienne Lawlor Jul 21 '13 at 20:01
  • Ah, it does look like that font doesn't quite match up with the styleguide. You'll have to browse through the font with some sort of viewer and find the icon you want. – kabuko Jul 22 '13 at 17:17
  • Okay I'm glad that I'm not the only one who could see this. What kind of `viewer` are you referring to? – Etienne Lawlor Jul 22 '13 at 18:20
  • If you're on Windows, you can use Character Map. – kabuko Jul 22 '13 at 20:13
  • I'm using Ubuntu, and I tried using a Character Map application but it didn't quite work. – Etienne Lawlor Jul 26 '13 at 17:36