How to use @ckeditor/ckeditor5-font - 1 common examples

To help you get started, we’ve selected a few @ckeditor/ckeditor5-font examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ckeditor / ckeditor5-core / tests / manual / converters.js View on Github external
_handleAllFontFamilyValues( conversion ) {
		const fontFamilyOptions = normalizeOptions( this.editor.config.get( 'fontFamily.options' ) );

		// Add special catch-all converter for font-family feature.
		// The font-family feature expects that multi-word font family names are defined in CSS as: 'Font Family Name'.
		// Also the number of font names and their order is important, so below are different font-names:
		//
		// 1. 'Lucida Sans Unicode', Lucida Grande, sans-serif       // This CSS is generated by the editor.
		// 2. 'Lucida Sans Unicode', sans-serif                      // fewer font names.
		// 3. "Lucida Sans Unicode", Lucida Grande, sans-serif       // Different quotes.
		// 4. 'Lucida Sans Unicode', sans-serif, Lucida Grande       // Different order.
		//
		// This is due to the fact that by default CKEditor 5 expects font names to be defined the editor.
		// The below converter extends this behavior and tries to match font name from input HTML to
		// the font family names defined in the configuration.
		conversion.for( 'upcast' ).elementToAttribute( {
			view: {
				name: 'span',

@ckeditor/ckeditor5-font

Font feature for CKEditor 5.

GPL-2.0-or-later
Latest version published 12 days ago

Package Health Score

89 / 100
Full package analysis

Popular @ckeditor/ckeditor5-font functions