Pelles C_Parser and RTF

Started by TimoVJL, June 29, 2017, 06:53:25 PM

Previous topic - Next topic

TimoVJL

This example use Pelle's C_Parser to insert highlighted RTF code to richedit control.
Only for ANSI because usage of RTF.
It was made for a richedit callback routine usage.

Normal coloursetstatic char *szRTFDef = "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}"
"{\\colortbl;\\red0\\green0\\blue255;\\red0\\green128\\blue0;" // KEYWORD COMMENT
"\\red255\\green0\\blue0;\\red255\\green0\\blue255;" // NUMBER  STRING
"\\red128\\green0\\blue0;\\red0\\green0\\blue255;}" // PREPROCESSOR OPERATOR
"\\fs18"; // font size

EDIT 2017-07-02 some experiments for CR LF problem, like line continuation '\' in #define
let we know about other problems too.

May the source be with you

jj2007

A syntax highlighter? How does it work?

Grincheux

Very Very interesting.
I try it.

Thanks :) :) :) :) :)