Pelles C forum

C language => Tips & tricks => Topic started by: TimoVJL on June 29, 2017, 06:53:25 pm

Title: Pelles C_Parser and RTF
Post by: TimoVJL on June 29, 2017, 06:53:25 pm
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 colourset
Code: [Select]
static 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.

Title: Re: Pelles C_Parser and RTF
Post by: jj2007 on June 29, 2017, 10:41:46 pm
A syntax highlighter? How does it work?
Title: Re: Pelles C_Parser and RTF
Post by: Grincheux on July 05, 2017, 08:11:29 am
Very Very interesting.
I try it.

Thanks :) :) :) :) :)