Re: Huge space between list elements in RichText

2019-04-26 Thread Alex Harui
The converter should produce a TextFlow.  I think there is some way to 
pretty-print the TextFlow.  Once we can see the TextFlow, hopefully we can 
identify what styles will control the spacing.

On 4/25/19, 12:44 PM, "chris_flex"  wrote:

It looks even worse with the StyleableTextField... 

Is there any property/style, ... I should look for which could cause the
problem in our App?



--
Sent from: 
https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.246.n4.nabble.com%2Fdata=02%7C01%7Caharui%40adobe.com%7Caca199b46c514a5e997008d6c9b66ae0%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636918182676547010sdata=R9wpHZPV0pTogroPnx6%2F9EVGWERCbmDPHEzERXX9BNs%3Dreserved=0




Re: Huge space between list elements in RichText

2019-04-25 Thread chris_flex
Okay - I found the problem. I get the text from the server and somehow are \n
and \r added which I did not see in Intellij Idea.

var fixedString:String = explanation.getDescription().replace(new
RegExp('\\n', 'g'), '').replace(new RegExp('\\r', 'g'), '');

fixes it



--
Sent from: http://apache-flex-users.246.n4.nabble.com/


Re: Huge space between list elements in RichText

2019-04-25 Thread chris_flex
It looks even worse with the StyleableTextField... 

Is there any property/style, ... I should look for which could cause the
problem in our App?



--
Sent from: http://apache-flex-users.246.n4.nabble.com/


Re: Huge space between list elements in RichText

2019-04-25 Thread Erik Thomas
Another approach you might try is using StyleableTextField, which I use a lot 
in mobile apps for rendering html:

var textField:StyleableTextField = new StyleableTextField();
var styles:String = "p { leading: 2px; }"; // add all the css you need here
var styleSheet:StyleSheet = new StyleSheet();
styleSheet.parseCSS(styles);
textField.styleSheet = styleSheet;
textField.styleName = this; // inherit other styles from parent
textField.lineBreak = LineBreak.TO_FIT; // implicitly sets wordWrap to true
textField.percentWidth = 100;
textField.htmlText = yourHtml;
this.addElement(textField); // assumes this is a container like HGroup

Don't believe some posts that say you can't add StyleableTextField to 
containers, yes you can. And it's lighter weight than RichText which is not 
recommended for mobile apps anyway. Of course the renderer only supports a 
subset of html, but your example seems pretty simple and should work fine.




Re: Huge space between list elements in RichText

2019-04-25 Thread Carlos Rovira
HI Chris,

if nothing is affecting that, it seems we have a problem there.
Hope others with more knowledge of TLF could give a hand here.

If there's a bug, you always can try to fix it and send us a PR to try it
and if valid merge in Flex SDK



El jue., 25 abr. 2019 a las 17:22, chris_flex ()
escribió:

> getDescription() =
>
> Test
> 
> 1
> 2
> 3
> 
> Test2
> 
> *4*
> *5*
> *6*
> 
>
> is displayed:
>
> 
>
>
>
>
>
> --
> Sent from: http://apache-flex-users.246.n4.nabble.com/
>


-- 
Carlos Rovira
http://about.me/carlosrovira


Re: Huge space between list elements in RichText

2019-04-25 Thread chris_flex
getDescription() =

Test

1
2
3

Test2

*4*
*5*
*6*


is displayed:

 





--
Sent from: http://apache-flex-users.246.n4.nabble.com/


Re: Huge space between list elements in RichText

2019-04-25 Thread Carlos Rovira
Hi,

you should send the same structure of HTML (you can change real text for
dummy text) that you are using.
This can be just a problem of the inner HMTL structure you are using and
not something related to the flex code.

just figuring



El jue., 25 abr. 2019 a las 14:15, chris_flex ()
escribió:

> I have imported some HTML:
>
> var tff:TextFlow = TextConverter.importToFlow(getDescription(),
> TextConverter.TEXT_FIELD_HTML_FORMAT);
>
> and show that in a RichText, resulting in:
>
> 
>
> There are huge gaps - hope can they be adjusted?
>
>
>
> --
> Sent from: http://apache-flex-users.246.n4.nabble.com/
>


-- 
Carlos Rovira
http://about.me/carlosrovira


Huge space between list elements in RichText

2019-04-25 Thread chris_flex
I have imported some HTML:

var tff:TextFlow = TextConverter.importToFlow(getDescription(),
TextConverter.TEXT_FIELD_HTML_FORMAT);

and show that in a RichText, resulting in:

 

There are huge gaps - hope can they be adjusted?



--
Sent from: http://apache-flex-users.246.n4.nabble.com/