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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With