View Full Version : shift first line of text down within an input field?
creatify
January 29th, 2009, 03:03 PM
Anyone know of a way to shift the first line of a single input line down so that it doesn't crowd the top edge of a text field? I could use a background sprite and have a textField positioned over the background, but I'd like to avoid this if possible. This is for fp9, not 10 so subscript won't help me.
It appears like TextLineMetrics are read only? Leading won't shift the first line and blockIndent only works on left/right margins?
Attached image might explain, thanks for any ideas.
.ral:cr
January 30th, 2009, 09:28 AM
that is the border of the textfield? didn't know you can colorize it inside. anyway, if that's the case, you need another font wich is constructed better. or a better way is creating your own rectangle on the bottom, you can do more creative stuffs this way.
snickelfritz
January 30th, 2009, 12:41 PM
Try using a pixel font or a font designed specifically for the web.
I've found that some center themselves vertically much better than traditional fonts.
creatify
January 30th, 2009, 01:04 PM
that is the border of the textfield? didn't know you can colorize it inside. anyway, if that's the case, you need another font wich is constructed better. or a better way is creating your own rectangle on the bottom, you can do more creative stuffs this way.
Yeah, I was hoping to avoid the extra graphic, but I've already headed down that path. I'm using a TextFieldFactory class to generate all the text, so it would've been simpler and easier to scale the form if I could just use the textField border/background. Oh well.
creatify
January 30th, 2009, 01:05 PM
Try using a pixel font or a font designed specifically for the web.
I've found that some center themselves vertically much better than traditional fonts.
That's a good point, thanks, I may play with some different fonts for this. The client is a bit anti-pixel font, but I may have better success with a system font...
cbeech
January 30th, 2009, 04:29 PM
i was looking around yesterday for some prop you could use and did notice a 'textPadding' prop in the textInput class 'styles' - but I wasn't able to get it hooked up quick to play with it - might help :)
creatify
January 30th, 2009, 04:52 PM
i was looking around yesterday for some prop you could use and did notice a 'textPadding' prop in the textInput class 'styles' - but I wasn't able to get it hooked up quick to play with it - might help :)
Good Find! I dug into the Classes to see how that property works, and though it doesn't solve my original hopes, it does pretty much show me that what I'm asking for isn't possible.
That property appears to position a textField on top of the background graphic, so I'll follow suit. :}
textField.width = width-2*txtPad;
textField.height = height-2*txtPad;
textField.x = textField.y = txtPad;
cbeech
January 30th, 2009, 06:55 PM
bummer :( it sure is odd though that we can't control that - would have though the metrics could do it. hmmm i have a thought - i'll post back.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.