Hello,

qooxdoo v1.1 introduced two new properties to the HtmlArea widget:
defaultFontFamily and defaultFontSize. Up to v1.0.1 these properties could
be passed in the "styleInformation" parameter of the widget's constructor,
e.g. ({"body": "font-family: ..."}). Apparently, this feature is not
supported anymore, one has to use defaultFontFamily and/or defaultFontSize
instead. Unfortunately, this does not quite work as one would expect. Open
the  http://tinyurl.com/36bj4rq playground example  in FF 3.6 and try the
following:

1. Select any sequence of characters in the demo text and press the
[insertHtml] button. The selected characters will be set to bold, the
default font family and size are preserved ==> everything is ok. Selecting
the [HTML source] button reveals that the complete HTML source text is
enclosed by a "span" and a "font" tag containing the chosen font settings
while the bold selection is enclosed by a "span" with the corresponding CSS
style information ("font-weight: bold").

2. Press the [resetHtml] Button and type some text. You will notice that the
default font family and size are reset to some "default" which is definitely
not the default having been set on instatiation of the widget ==> maybe ok,
maybe not (I'm not quite sure how the "resetHtml" method is supposed to
behave). Hitting [HTML source] shows that the enclosing "span" and "font"
tags containing the default font settings have disappeared.

3. a) Pressing the [setValue] button results in some different demo content
which will be displayed in the originally defined default font family and
size ==> looks ok, so far. [HTML source] shows that the enclosing "span" and
"font" tags are back again.

3. b) Now select any sequence of characters (as in 1. above) and again press
[insertHtml]. While the unselected parts of the text are still displayed in
the original default font, the selected sequence turns into the same
"pre-default" as above ==> not ok. Press [HTML source] and you will find
that the "span" and "font" tags are present, however, they don't enclose the
entire HTML source but only those text sequences which had NOT been
selected. It looks as if the insertHtml method "breaks" the default font
settings.

4. You might also select the complete text content of the editor and hit the
[DEL] key. This results in an empty editor window just as if you had used
[resetHtml]. However, if you now type in some text it's still displayed with
the chosen default font settings, just like in step 3. a). Selecting an
arbitrary sequence of characters and hitting [insertHtml] again shows the
same behaviour as in 3. b).

I'm quite aware of the fact that I could use HtmlArea's setBold method
(which seems to work properly), but in my current application I'm relying on
the insertHtml method quite heavily in order to insert "span" tags with
specific text formatting information.

BTW: I've done some testing with IE 8 too which appears to handle this
problem much better.

Regards,

  Norbert


-- 
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Problem-with-default-font-in-HtmlArea-v1-1-tp4993306p4993306.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to