Hi. I am new for the code mirror.
I have some text (words) in the cm editor. I need to use font of different size for different words.
Does anybody knows how to do it?
Either use markText
or, if they are a specific kind of token in your mode, use CSS to style that token (i.e. .cm-keyword { font-size: 130% }
to make keywords bigger).
Thanks marajin.
I successfully marked the text from startPosition to EndPosition with the markText() as per your advice.
Now I want for the marked text to change the font size (only for this characters).
Is it possible? What function should I use?
I found it, thanks. For example -
editor.markText({line:0,ch:1},{line:3,ch:1}, {css: ‘font-size:20pt’});
document.querySelector(.CodeMirror
).style.fontSize = fontSize + ‘px’;
i select class and pass fontSize dynamilcally