I am currently working on an info terminal with text screens and i use a TextField and TextFormat like that …
bodyTxt = new TextField();
bodyTxt.antiAliasType = AntiAliasType.ADVANCED;
bodyTxt.selectable = false;
bodyTxt.embedFonts = true;
bodyTxt.text = ‘example’;
var tf:TextFormat = new TextFormat(Assets.getFont(“fonts/AJensonPro-Regular.otf”).fontName, 24, 0xe5f2d4, null, null, null, null, null, TextFormatAlign.LEFT, null, null, null, 4);
bodyTxt.multiline = true; bodyTxt.wordWrap = true;
bodyTxt.x = 50;
bodyTxt.y = 100;
bodyTxt.width = 400; bodyTxt.height = 650;
Now I have the problem that each paragraph has some space to the next paragraph. Theat is usually no problem. But in one case I want to build a bullet list without space between the lines. Is there a way to set a value? In CSS this would be margin-bottom or padding-bottom applied to a paragraph element.
I have not found any way to do this in Flash/Animate neither as in OpenFL. But in Flash/Animate there is no space between the paragraphs at all.
I would be grateful for a solution.
I seem to remember in the Flash days that Adobe developed a more advanced text renderer for Flash. I don’t remember its name but I also would find that to be useful. I’ll see if I can dig up some more information on that.
Ah yes it was the Text Layout Framework (TLF). There’s even source code. Want to port that code? I would give it a shot sometime in the distant future if you don’t.
TLF needs the advanced flash.text.engine
package, which OpenFL doesn’t implement yet.
Thanks Josh, I posted that link (duh) thinking it was actually the source code for TLF. Turns out it actually is over at the Apache Flex site, found in the Flex SDK source. Lots of stuff in there—I can see why it hasn’t been ported yet!
I had a bit of trouble finding the AS3 source for flash.text.engine – where would I find that?
There is no AS3 source for FTE. I assume that it was written in C++, since it is a Flash Player API. As I recall, it was ported over from InDesign or another Adobe product with better typography capabilities than Flash, so Adobe would probably never open source that.
Thanks for the replies. It would be great to have more advanced text features in the future, but I think developing or implementing them is beyond my abilities. The most I could do is to participate in a bounty for that.
Is there another idea getting rid of the extra space between the paragraphs?
Splitting your initial one textfield in various and successive textfields, and playing with their position…?
Thanks, but I already thought about that. Also about embedding a designed swf. But that are workarounds. It would be better if there was a way of getting rid of the spaces (no space after a paragraph as it is in Adobe Animate). If I would actually need them I could add an empty line.