开发者

Android: How to fit large fonts into a small button?

开发者 https://www.devze.com 2023-01-28 07:14 出处:网络
Task: fit large characters into a small button. Problem: I noticed what when you create a button using non-alpha characters such as -, +, =.. etc, there is a lot of \"padding\" below and above the te

Task: fit large characters into a small button.

Problem: I noticed what when you create a button using non-alpha characters such as -, +, =.. etc, there is a lot of "padding" below and above the text, especially when you increase the font size. When you use alpha characters, it appears fine. ie. this is what hap开发者_运维百科pens

________

|                |

|                |

|     ___     |

|    |___|    |

|                |

|                |

|________|

when i want this..

________

|     ___     |

|    |___|    |

|________|

where the rectangle in the middle is a big giant dash.

I have tried setting the padding to zero, but that doesn't work. Any ideas?


padding in font not in drawing system in android ! you can :

1- Add Typeface font dealing with such as typing purposess

2- Or try create your Own font for this you can use Private Character Edit in XP for more info take a look on this : http://www.techtipsgeek.com/design-font-characters-own-choice-windows-xp/1621/

3-Better practices, try to use images than typing those patters.

But note that when you make it working, use shipped typeface font with application because you cannot guarantee all devices will use the same font which you use to create patters.

good luck,

Mohammed,

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号