Opened 14 years ago

Closed 14 years ago

#5292 closed Bug (fixed)

Preview in font-size and font-family doesn't work with custom styles

Reported by: Alfonso Martínez de Lizarrondo Owned by: Alfonso Martínez de Lizarrondo
Priority: Normal Milestone: CKEditor 3.3
Component: General Version: 3.2
Keywords: Review+ Cc:

Description

Using the XHTML sample in #5024, the previews of font-size and font-family doesn't reflect the current values.

Attachments (2)

5292.patch (1.2 KB) - added by Alfonso Martínez de Lizarrondo 14 years ago.
Proposed patch
5292_2.patch (3.5 KB) - added by Alfonso Martínez de Lizarrondo 14 years ago.
Revised patch

Download all attachments as: .zip

Change History (8)

Changed 14 years ago by Alfonso Martínez de Lizarrondo

Attachment: 5292.patch added

Proposed patch

comment:1 Changed 14 years ago by Garry Yao

Keywords: Review- added; Review? removed

The problem is we've already had such implementation. It would be better to introduce a 'buildlPreviewHtml' method on CKEDITOR.style that encapsulate those logics to be used by all places, including fonts, format and styles.

comment:2 Changed 14 years ago by Alfonso Martínez de Lizarrondo

I thought about it but there's a problem with CKEDITOR.style::getStyleText because it will try to normalize the css style and it chokes when it finds a value like font-family:#(family)

The option that I see would be to put pass to that CKEDITOR.style.buildPreviewHtml the styleDefinition as well as the cssStyle to use, and in the font plugin specify a placeholder like #(name) for the styleDefinition name and replace it in the loop.

Now that I think about it my original patch used a regExp for the value, but a simple string replacement would have been enough.

So: Do I create such CKEDITOR.style.buildPreviewHtml( styleDefinition, cssStyle ) function?

comment:3 Changed 14 years ago by Garry Yao

it chokes when it finds a value like font-family:#(family).

True, the original implementation doesn't consider variables in style (it operate on style definition), while if an method is introduced, it operates naturally on compiled style object so such problem will vanish.

Changed 14 years ago by Alfonso Martínez de Lizarrondo

Attachment: 5292_2.patch added

Revised patch

comment:4 Changed 14 years ago by Alfonso Martínez de Lizarrondo

Keywords: Review? added; Review- removed

This was much easier that I thought.

comment:5 Changed 14 years ago by Garry Yao

Keywords: Review+ added; Review? removed

comment:6 Changed 14 years ago by Alfonso Martínez de Lizarrondo

Resolution: fixed
Status: newclosed

Fixed with [5312]

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