Opened 14 years ago

Closed 14 years ago

#5040 closed Bug (fixed)

Font dropdown not working after font change on a selected text

Reported by: Diego Caravana 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 Frederico Caldeira Knabben 14 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 14 years ago by Frederico Caldeira Knabben

Component: GeneralCore : 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 14 years ago by Diego Caravana

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 14 years ago by Diego Caravana

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 14 years ago by Frederico Caldeira Knabben

Attachment: 5040.patch added

comment:4 Changed 14 years ago by Frederico Caldeira Knabben

Keywords: Confirmed Review? added; WorksForMe removed
Milestone: 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 14 years ago by Alfonso Martínez de Lizarrondo

Keywords: Review+ added; Review? removed

comment:6 Changed 14 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: newclosed

Fixed with [4972].

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy