Opened 7 years ago

Closed 7 years ago

#5040 closed Bug (fixed)

Font dropdown not working after font change on a selected text

Reported by: dcaravana Owned by:
Priority: Normal Milestone: CKEditor 3.2
Component: Core : Styles Version: 3.1
Keywords: Confirmed Review+ Cc: diego@…


Apparently a Firefox-only problem.

Changing the font on a selected text causes the font dropdown to not to show the font itself, even if it was correctly applied to the text. To make it work again, change the size of the same text.

As you can see in the following example, the HTML of the content is very simple; it seems that if the span with the font-family spec comes before the font-size one the font dropdown doesn't recognize the font (selecting the size swaps the two spans so it works again):

<p><span style="font-size: 12px;"><span style="font-family: Arial,Helvetica,sans-serif;">Example...</span></span></p>

Attachments (1)

5040.patch (918 bytes) - added by fredck 7 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by fredck

  • Component changed from General to Core : Styles
  • Keywords WorksForMe added

I'm loading the following in FF3.5:

	<span style="font-size: 12px;"><span style="font-family: Arial,Helvetica,sans-serif;">Example...</span></span></p>
	<span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: 12px;">Example...</span></span></p>

In both paragraphs the font face and size are properly recognized and displayed in the toolbar combos. To test it, I'm simply clicking inside the text in the paragraphs.

Am I missing something?

comment:2 Changed 7 years ago by dcaravana

I copied and pasted your HTML code as is and I have the problem; at this point I don't know why we have different behaviors. I'll check the editor instance configuration and report to you ASAP.

comment:3 Changed 7 years ago by dcaravana

Ok, verified and the problem lies in the definition of the font list which, in my case, is:

CKEDITOR.config.font_names = 'Arial/Arial, Helvetica, sans-serif;Courier New/Courier New, Courier, monospace;Futura;Optima;';

Look at the last semicolon in the string: if you remove it, as I did, the problem goes away. Now I don't know if it's an editor bug, all I know is that this problem exists in a browser and not in another one (i.e. different behavior).

Changed 7 years ago by fredck

comment:4 Changed 7 years ago by fredck

  • Keywords Confirmed Review? added; WorksForMe removed
  • Milestone set to CKEditor 3.2

@dcaravana, thanks for the details. In fact you're using the font_names settings improperly, as the semi-colon here is a separator, not a CSS rule marker.

In any case, we may change our code to avoid issues with such minor user mistakes. i'm proposing a patch for it.

comment:5 Changed 7 years ago by alfonsoml

  • Keywords Review+ added; Review? removed

comment:6 Changed 7 years ago by fredck

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with [4972].

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy