Format to set active font - quill

I can use format to set the current font size and color
quill.format('size', '18px');
quill.format('color', 'red');
but when I try to set the font name eg.
quill.format('font', 'Cursive');
it has no effect. The font, in this case 'cursive', exists in the font dropdown in the tool bar (and if you select it, it does become the current font).
How can I use format to set the active font?

I found that it's case sensitive. This
quill.format('font', 'Cursive');
doesn't work but this does
quill.format('font', 'cursive');

Related

Change span label font size in codenameone

I want to show a multiline text so I use a span label. I am trying to set the font size from the gui but it does not change.
I also trying to set the color dynamicaly using the next code:
this.gui_Span_Info.getAllStyles().setFgColor(HTMLElement.COLOR_RED);
but nothing happens.
What should I do?
SpanLabel is a composite component which means it's built from 2 or more separate components one of which is a Container.
You can determine the UIID of the text using setTextUIID it defaults to the Label UIID.

Image or font awesome as option in select - Reactjs

I would like to have an input select with a choice of image as an option (would define a custom icon). I can put an image or an icon with Font awesome.
I tried putting
<select>
<option><i class='fas fa-shopping-bag'/></option>
<select>
or replace with an image but nothing work.
Font Awesome font is well imported, I tried with unicode it does not work either
Do you know how to do it ?
Thanks
if you are using reactjs you need to use className instead of class https://reactjs.org/docs/faq-styling.html

Style issue in the picker

I've set the uiid of a picker in the theme. The font is set in millimeter (2.5) for all unselected, selected and pressed.It works fine. But when I use setEnabled(false), the font style changes and is bigger. P.S I've set same font and same font size for unselected, selected and pressed in the theme. How can I make it work?
Picker stationPicker = new Picker();
stationPicker.setEnabled(false); //without this line, it works fine
stationPicker.setType(Display.PICKER_TYPE_STRINGS);
stationPicker.setSelectedString("Select the service center");
stationPicker.setUIID("small");
stationPicker.getAllStyles().setMarginLeft(1);
stationPicker.getAllStyles().setBgColor(0xcccccc);
when setEnabled isnot used
Img when setEnabled is used
There is another UIID: Disabled.
When you set enabled to false the disabled UIID takes over.

set gap between text and icon of command

I am using command with text and icon and want to set gap between them
I try to setGap but the method is not available
command.setGap();
so how can set the gap?
Use:
command.putClientProperty("iconGap", new Integer(gap));

How do I specify the default font sizer in CK Editor v3

How do I specify the default font size for CKEditor. I tried changing contents.css (body -> font-size) and I tried changing config.js (config.fontSize_defaultLabel) without any success. Does anyone know where i should be looking?
You seem to be on the right track with the contents.css file.
Is your problem that the font size while working in the editor is not correct or is it that the font size isn't being carried over to the page where you actually display the content?
As you know, ckeditor/contents.css is the default style sheet that is loaded while working in the editor, but if you use "config.contentsCss" to call another style sheet, contents.css won't be loaded.
You can call multiple style sheets like this:
config.contentsCss = ['/contents.css', '/css/anotherstylesheet.css'];
If the font size isn't being carried over to the actual page display, you'll need to set the font size in the style sheet used for the actual pages, the default font size used in the editor isn't inserted into the content output by the editor.
"config.fontSize_defaultLabel" is a label only, it doesn't have any effect on the content. Normally, when you load the editor, the font size selector will display "Size". If you set "fontSize_defaultLabel", the font size selector will display whatever value you entered.
If you can provide more details about the problem, I'll try to post a more accurate answer.
Be Well,
Joe

Resources