tags:

views:

81

answers:

5

I'm looking for a very lightweight document description language, which can be easyly parsed in C. The purpose is printing of small documents or labels similar to cash register receipts. I need only basic formatting features for font settings, alignment and insertion of predefined variables.

Any ideas? Would using of some subset of rtf be a good choice?

A: 

I'd say go for something XML-based (plenty of good fast premade parsers, including for plain C), and probably a tiny subset of XHTML Transitional so as not to reinvent the wheel - <font name="..." color="..."> and such. RTF is not really much easier to parse, but is very human unfriendly.

Pavel Minaev
Well, using XML means inventing my own description language on the basis of XML. That's what i wanted to avoid!
dickens
As pointed out, you can just reuse parts of XHTML that you want. I don't think you would find a turnkey solution for this, considering your (rather specific) requirements.
Pavel Minaev
A: 

I suggest to have a look at the gd library. Just create a simple script language yourself with one GD command per line.

Aaron Digulla
A: 

Would also vote for XML and maybe XPS, if your needs are more advanced

noesgard
A: 

Why not Markdown, the markup language of Stackoverflow?

Norman Ramsey
+1  A: 

Microsoft has defined a Report Definition Language designed for small reports, receipts, and such. Visual Studio can create RDL files, but it is an open standard and there are open source implementations of RDL report generators.

Dour High Arch