How to apply different font size for the Code Mirror text


#1

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?


#2

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).


#3

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?


#4

I found it, thanks. For example -
editor.markText({line:0,ch:1},{line:3,ch:1}, {css: ‘font-size:20pt’});