5

As you might know, you can use your own font in your specific android UI like following:

    myNewFace = Typeface.createFromAsset(getAssets(), "fonts/myown.ttf");
    TextView label = (TextView) row.findViewById(R.id.tvTitleFunc);
    label.setTypeface(myNewFace);

Now, I need to apply this font to AChartEngine but can't figure out how.

I can see DefaultRenderer has a method

 setTextTypeface(java.lang.String typefaceName, int style) 

But this method can't be used with custom font. Does anybody have an idea how to do this?

UPDATE

To answer my own question, there is simply no way to set custom font in achartengine without changing source code. So I added simple methods setTypeface and getTypeface to DefaultRenderer and changed a couple of lines of code in XYChart accordingly. Voila, it's now working.

Tae-Sung Shin
  • 20,215
  • 33
  • 138
  • 240

1 Answers1

1

Maybe you can contribute the code to the AChartEngine community by creating a patch and adding it as an issue?

Update: There is a setTextTypeface() method that was recently added to DefaultRenderer that you can use for this.

Dan D.
  • 32,246
  • 5
  • 63
  • 79