Open LOG-TAG opened 9 years ago
Keyboard app. Text app. Cammands and code.:-) Hole lot of hours.
Hey @LOG-TAG were u able to achieve that superscript (th) above 15 using this library...Please do let me know if its possible...Thnks
@hardikamal That is Designed by graphics Designers :) But you can look at this http://stackoverflow.com/questions/3543454/subscript-and-superscript-a-string-in-android http://stackoverflow.com/questions/20597223/android-textview-superscript (look at the ans by @amulyakhare )
@LOG-TAG i did this but it not working on textdrawable
Hi guys, i trying to make it:
@Override
public void draw(Canvas canvas) {
// this is already on the lib
int width = this.width < 0 ? r.width() : this.width;
int height = this.height < 0 ? r.height() : this.height;
int fontSize = this.fontSize < 0 ? (Math.min(width, height) / 2) : this.fontSize;
textPaint.setTextSize(fontSize);
//this draw one line below another
int yHeight = 10;
canvas.drawText(text, width / 2, yHeight, textPaint);
yHeight += textPaint.descent() - textPaint.ascent();
canvas.drawText(text2, width / 2, yHeight, textPaint);
}
If you wish to draw with 2 diferents fontsizes, just create another textPaint and set another TextSize.
The problem there is that i dont know how to calculate the text size to draw it on the center of the circle. Can anyone help? Thanks in advance.
Same issue, this ignores \n or line separators
Yes, you have to use split in yours " " and use a for loop to draw each line. I got a new idea, you can create a canvas copy, draw everything and get its size to draw centered on the real one.
I'm looking for easy solution for the above multi-line requirement !!