[android-developers] How to get the text height
paint.measureText(text) return the width, how can i get the height of the text? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to get the text height
On 30 April 2011 12:49, a a harvey.a...@gmail.com wrote: paint.measureText(text) return the width, how can i get the height of the text? value you used in setTextSize() * screendensity factor shall mostly give what you want. Regards, Marcin Orlowski *Tray Agenda http://bit.ly/trayagenda* - keep you daily schedule handy... *Date In Tray* http://bit.ly/dateintraypro - current date at glance... WebnetMobile on *Facebook http://webnetmobile.com/fb/* and *Twitterhttp://webnetmobile.com/twitter/ * -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to get the text height
wrong answer, sorry... 2011/4/30 Marcin Orlowski webnet.andr...@gmail.com: On 30 April 2011 12:49, a a harvey.a...@gmail.com wrote: paint.measureText(text) return the width, how can i get the height of the text? value you used in setTextSize() * screendensity factor shall mostly give what you want. Regards, Marcin Orlowski Tray Agenda - keep you daily schedule handy... Date In Tray - current date at glance... WebnetMobile on Facebook and Twitter -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to get the text height
get the text rect, then return the rect height, this is text height. 2011/4/30 a a harvey.a...@gmail.com: wrong answer, sorry... 2011/4/30 Marcin Orlowski webnet.andr...@gmail.com: On 30 April 2011 12:49, a a harvey.a...@gmail.com wrote: paint.measureText(text) return the width, how can i get the height of the text? value you used in setTextSize() * screendensity factor shall mostly give what you want. Regards, Marcin Orlowski Tray Agenda - keep you daily schedule handy... Date In Tray - current date at glance... WebnetMobile on Facebook and Twitter -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to get the text height
http://developer.android.com/reference/android/graphics/Paint.html Take a pick: - getTextSize() - getTextBounds() - ascent() / descent() - getFontMetrics() -- Kostya 30.04.2011 17:55, a a пишет: get the text rect, then return the rect height, this is text height. 2011/4/30 a aharvey.a...@gmail.com: wrong answer, sorry... 2011/4/30 Marcin Orlowskiwebnet.andr...@gmail.com: On 30 April 2011 12:49, a aharvey.a...@gmail.com wrote: paint.measureText(text) return the width, how can i get the height of the text? value you used in setTextSize() * screendensity factor shall mostly give what you want. Regards, Marcin Orlowski Tray Agenda - keep you daily schedule handy... Date In Tray - current date at glance... WebnetMobile on Facebook and Twitter -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kostya Vasilyev -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to get the text height
thank you, i have solve it 2011/4/30 Kostya Vasilyev kmans...@gmail.com: http://developer.android.com/reference/android/graphics/Paint.html Take a pick: - getTextSize() - getTextBounds() - ascent() / descent() - getFontMetrics() -- Kostya 30.04.2011 17:55, a a пишет: get the text rect, then return the rect height, this is text height. 2011/4/30 a aharvey.a...@gmail.com: wrong answer, sorry... 2011/4/30 Marcin Orlowskiwebnet.andr...@gmail.com: On 30 April 2011 12:49, a aharvey.a...@gmail.com wrote: paint.measureText(text) return the width, how can i get the height of the text? value you used in setTextSize() * screendensity factor shall mostly give what you want. Regards, Marcin Orlowski Tray Agenda - keep you daily schedule handy... Date In Tray - current date at glance... WebnetMobile on Facebook and Twitter -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kostya Vasilyev -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to get the text height
I want to draw a text and rect like following: 1.a, b, c, d are vertex, actually, there is not exist the four vertex. here is just for mark the rectangle. 2. ac, bd, cd are rectangle's border (noncontinuous line is solid border, like ac and bd and cd is a solid border,) 3. it only know the a,b,c,d's coord, but don't know the e and f a_b | | | | e_f | name | c--d Firstly, i draw a big rectangle var canvas.drawRect() which marked with a-b-c-d vectex. Secondly, i draw the tag name var canvas.drawText() my question is how can i draw a solid border up the name which marked with ef border ? i think i should get the tag name height then calculate with c or d. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to get the text height
You can get various text size values either using Paint#getFontMetrics or Paint#getTextBounds. Pepijn On 24/03/2011 08:55, a a wrote: I want to draw a text and rect like following: 1.a, b, c, d are vertex, actually, there is not exist the four vertex. here is just for mark the rectangle. 2. ac, bd, cd are rectangle's border (noncontinuous line is solid border, like ac and bd and cd is a solid border,) 3. it only know the a,b,c,d's coord, but don't know the e and f a_b | | | | e_f | name | c--d Firstly, i draw a big rectangle var canvas.drawRect() which marked with a-b-c-d vectex. Secondly, i draw the tag name var canvas.drawText() my question is how can i draw a solid border up the name which marked with ef border ? i think i should get the tag name height then calculate with c or d. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en