feathersui / feathersui-starling

User interface components for Starling Framework and Adobe AIR
https://feathersui.com/learn/as3-starling/
Other
914 stars 386 forks source link

New Component: Text renderer based on Flash Text Engine (FTE) #660

Closed joshtynjala closed 10 years ago

ejazasghar commented 10 years ago

Hi josh, what are the benefits/disadvantages of using this and old feather text renderers?

joshtynjala commented 10 years ago

flash.text.TextField is buggy and the old text renderer for it had some ugly workarounds and odd behaviors. For example, it requires waiting a frame before it can accurately draw to BitmapData. This meant that flattening usually wouldn't work because the texture wasn't ready yet. It also put extra pressure on GPU and runtime the frame after components are created instead of finishing it all up at once, possibly hurting animation performance. Similarly, the width and height aren't correctly reported sometimes, so there's a weird workaround.

FTE has extra nice features. For instance, it offers better support for non-English text. This is going to be a good one for people developing content for right-to-left languages or asian languages. I haven't played around with it much yet, but I think it's possible to put more complex content into the FTE text renderer, such as inline images. That's a frequent requirement for things like chat clients.

So far, my experience has been that FTE seems more stable with fewer odd workarounds required to make it work, and we get some nice new features too. It's a brand new component in Feathers, so it's going to be a little buggy while people start using it, but the example themes are now using it, and I expect this to be the recommended text renderer for device/embedded fonts in Feathers 1.3.

ejazasghar commented 10 years ago

Sounds Good, Will check it out once pushed. Great Work Josh :D

joshtynjala commented 10 years ago

It's already pushed to Github on the master branch. The class is TextBlockTextRenderer.

ejazasghar commented 10 years ago

Awesome, Thanks for the update :)

alyf commented 10 years ago

Hello,

I've been playing around a bit with this new control and I think I found a bug. Specifically, in refreshSnapshots(), at the end of the outer tiling loop (around line 1360) after resetting yPosition you should also reset clipHeight. The current code computes a bogus clipping rectangle (which results in nothing being drawn) for all textures in columns other than the first...

ManuJack commented 10 years ago

Do I have to do something to support linebreak ? ( \n ) I use the List component with the default ListItemRenderer with metalworks theme ( feather from github ). The linebreak doesnt work anymore.

ManuJack commented 10 years ago

Now you have to set wordWrap = true for linebreak to work.

joshtynjala commented 10 years ago

Both of these issues have been fixed. Thank you both.

ManuJack commented 10 years ago

It's working as expected now, thank you !