Why isn't the html editor always WYSIWYG when it comes to font size?

Why isn't the html editor always WYSIWYG when it comes to font size?

by N Hansen -
Number of replies: 6
I can't seem to figure out a method to this madness. But if I have different sections of something I am using different sized fonts according to the drop down list at the top, it actually displays them in the editor as the same size. It may be doing other strange things with sizes of fonts, but as I said, I can't figure out any rhyme or reason for the behavior and sometimes have to try multiple times to get things as I want them. Any ideas on this problem?
Average of ratings: -
In reply to N Hansen

Re: Why isn't the html editor always WYSIWYG when it comes to font size?

by Janne Mikkonen -
You're not alone with this wink

But this is how dropdown menus and "onchange" events acts in javascript sad
When you change the font size to something else, the selected value stays selected in the dropdown menu. Now when you try to change some other peace of text to same size as like previous one, here comes the nice part, javascript assumes that nothing has changed (if the starting value is 14pt and you select size 4 which is 14 pt, javascripts point of view nothing has changed).

Argh! black eye ...
In reply to Janne Mikkonen

Re: Why isn't the html editor always WYSIWYG when it comes to font size?

by Samuli Karevaara -
Janne, the "onchange" and sticky font size option is part of this problem, but it's mostly caused by the fact that the editor doesn't change the drop down selection according to the font size (that the cursor/selection is at) if it has no size set manually.

If you manually set everything to some size, like "3" (default says "1" thought the text itself is often size "3" by default), then the "onchange" works as expected, as when you go to text that is of different font size than the previous, the drop down actually changes.

One nice fix (at least almost a fix) would be to have a default size that the editor sets the drop down option for the size when the cursor is at text with no size setting. This increases the "wysiwygness" and mostly fixes the "onchange" thing. For font family this already works like this.

Did this make any sense? (To anybody?)
In reply to Samuli Karevaara

Re: Why isn't the html editor always WYSIWYG when it comes to font size?

by N Hansen -
Samuli-Actually this is a bug request I made some time ago (bug 2017), to have each font linked to a default size. Janne is willing to implement it, but he doesn't know a solution. If you have a clue how to do it, maybe we can get this incorporated and fix this problem.
In reply to N Hansen

Re: Why isn't the html editor always WYSIWYG when it comes to font size?

by Samuli Karevaara -
Your feature request is slightly different, as it wants a different default size for different font families. To me it would be enough if the drop down box would "know" what the default font size (for all fonts) is, that is, for text with no defined size.
In reply to Samuli Karevaara

Re: Why isn't the html editor always WYSIWYG when it comes to font size?

by Janne Mikkonen -
This is because it has to read the value from somewhere and that is the <font> tags size attribute...

When you open the editor (adding forum post or something) there isn't any content yet so the editor can't read any value that isn't there.

So unfortunately What You See Isn't What You Get sad
In reply to Janne Mikkonen

Re: Why isn't the html editor always WYSIWYG when it comes to font size?

by Samuli Karevaara -
I understand this. Actually, maybe I was seeing ghosts, maybe it was 1.5 dev, but I thought this worked for the font family already (even without a manual setting).

The drop down should change itself to (a/the/some) default value of both font family and font size, if it finds no setting. The wysiwyg can further be made less wysiwyg with CSS settings, but defaulting the drop downs to some values might be a start.