spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
814 stars 257 forks source link

How do I declare font family in the tinymce.yaml file? #131

Closed kaizenx closed 10 years ago

kaizenx commented 10 years ago

I tried font_formats

The drop down will show the fonts, but when I select and use them on my content

the resulting span is

Lorem ipsum which breaks the font tag and makes the font default to serif.

Is there a workaround? Or I am declaring this wrongly?

spohlenz commented 10 years ago

I will look further into this, but for now you might need to declare the font formats on one line. e.g.

font_formats: "Andale Mono=andale mono,times;Comic Sans MS=comic sans ms,sans-serif"
spohlenz commented 10 years ago

This should now be fixed in the master branch (which now tracks TinyMCE 4.x).

You should be able to define the following in your tinymce.yml (note no semicolons necessary):

font_formats:
  - Andale Mono=andale mono,times
  - Comic Sans MS=comic sans ms,sans-serif