Hi there,

How can I add fontmanagement (font family and size) options to CKeditor5? I find that a painfully lacking feature in comparison to CKeditor 4 where that is available by standard. That's one of the reasons why I still have Drupal 7 running for (much) more comfortable editing!

Comments

slewazimuth’s picture

You mean this one?

dirke’s picture

That's indeed what I mean.

slewazimuth’s picture

composer require 'drupal/ckeditor_font:^2.0@beta'

dirke’s picture

Hi, thanks for your tip. But I don't work with Composer. Any other way, maybe to achieve what I need? TIA.

ridhima gupta’s picture

Integrates the Font plugin directly inside CKEditor 5 for Drupal 9 and 10. Allows to control the text and background color directly inside the CKEditor 5 interface. Allows to customize the color palette. No external dependencies required, the plugin is integrated directly via DLL Builds.

composer require 'drupal/ckeditor5_font:^1.1@beta'

                                OR

composer require 'drupal/ckeditor_font:^2.0@beta'

dirke’s picture

Hi, thanks, but like I already replied to slewazimuth, I don´t use Composer. I found a plugin on the Drupal site here: https://www.drupal.org/project/ckeditor5_font. But when installing it it a test site running the latest Drupal 10, it says it needs CKeditor (Deprecated for Drupal 10) and does not add any extra option in CKeditor 5. Any idea what goes wrong there? Other ideas maybe?

gisle’s picture

It looks like there are currently two extensions available for this use case:

Both have already been mentioned in this topic.

The first one appears to work for your use case (as demonstrated by the screen dump linked by slewazimuth). However, it depends on a third party library, and can only be installed with composer. I understand that you don't want to work with Composer, so that option is off the table.

The second one has no third party dependency, and you should be able to install it old school. However, it seems to need a little TLC to be compatible with Drupal 10 (e.g. #3368736: 'no config schema' Error after update to Drupal 10.1.0), so that probably isn't going to work either.

Other ideas maybe?

Maybe somebody else can come up with something , but IMHO, you're out of options.

Until somebody comes up with a good alternative to using composer (some say Ludwig already is an alternative– but IMHO it is not a good one) the number of extensions you shall be able to install on your website will be small, (and diminishing).

Tough, but that is the current state of affairs.

- gisle

dirke’s picture

Hi,

Thanks for your extensive explanation. Already tried the second option on a test site running the same version of Drupal, but that failed, alas. So that's no real option either. Have been looking into installing Composer on my webhosting package. That should be possible through SSH, using PUTTY. But that is unknown territory for me and needs some more reading up and trying (trial and error on a test website aside my main). I'll be looking into that when I have sufficient time to get familiar with that approach. For now I'll wait for someone that maybe has an easier way ... No real problem, because I have all the editing option I need through Drupal 7, and CKeditor4. Copying and pasting, a bit of a kludge, but workable! ;-)

lionsea’s picture

After I read this thread, I start using this font module, but when I choose basic set, the error below is always shown and I can't add this function to the editor:

drupal The following elements are missing:"<span style>"

when I modify full set, I have no problem, only for basic set.

How can I solve the issue?

slewazimuth’s picture

You can name the text format anything you want

macsim’s picture

Hi @lionsea I am having the exact same issue than the one you reported.

Did you found a way to solve it?

urix’s picture

I found out the problem.

Removing all Font (size, color, family) buttons got rid of the error.

lionsea’s picture

The solution is using full set (or the others) instead of basic set.

So the basic set has bug with this module.

In the customize page of editor's icons, you would add font-size and font family for full set, not basic set. If you activate this module, you shouldn't add icons of this module to the basic set.

That's it!

drupaldope’s picture

the module https://www.drupal.org/project/ckeditor5_font

is a little more useful than nothing at this moment.

in the description of the module you will notice: "Only FontColor and FontBackgroundColor widgets are supported at this time."

frondeau’s picture

Hello,

I've read the previous comments of the current discussion and I would like to know: as this module is named ckeditor5_font, corresponding to the ckeditor_font for the ckeditor 4, and the previous ckeditor_font was proposing font size, font family, text color, background color, why the well named ckeditor5_font proposes only text color and background color ?

I mean, if only colors are set, shouldn't it be named ckeditor5_color ? or ckeditor5_text_color ? As ckeditor5_font would set font family and font size ? 

It's a bit confusing as it is named like the ckeditor4_font but don't provide the same service.

Regards

drupaldope’s picture

yes, currently no module offers the functionality to set font-family in ckeditor5

but: you can use styles to achieve the same result.

and I think this module is still under development and the goal is to ultimately provide also a font selector.

dirke’s picture

Hi,

Being the initiator of this discussion line, after all replies, factually giving no solution, I give up on CKeditor 5 as a useful editor for creating new pages for my site. Until this is complete I'll stick to using Drupal 7 editor for creating new pages and import the html in the CKeditor five of my Drupal 10 install. This import works perfectly fine! A bit of a kludge, but for now it works very well for me.

Thanks for all the answers, but I'll stick with my present approach!

Dirk Engelage

drupaldope’s picture

ah, the 2.0 beta version.

thank you, I will try that one.

turns out the module's description is wrong then.

wait ... that's a different module, lol.

frondeau’s picture

For CKEDITOR 5 Please go to https://www.drupal.org/project/ckeditor5_font/issues/3406699#comment-15424314.

I've proposed a patch to add Font size and family, working on Drupal 9.5.11.

Not tested on Drupal 10.