From: Brian M. <br...@gr...> - 2011-09-22 14:45:13
|
Matt, > I'm attempting to write a custom report and I'd like to mix the font > within a given paragraph style for events, however I just not having > any luck in getting it to work. > > For events I'd like to print the event name in bold and the event > details in normal text all on the same line, yet as far as I can see > you can only set one font to be used in a paragraph. So at the moment > I can really only get all bold or all normal. I tried writing a > paragraphh within a paragraph but that just ends up putting in a line > feed where I don;t want one. You are in luck. The TextDoc interface allows you to specify bold and superscript outside of the paragraph font definition. It works like this: doc.start_bold() doc.write_text("this is bold text") doc.end_bold() doc.write_text("this is not bold text") See the function definitions for the TextDoc interface in src/gen/plug/docgen/textdoc.py: def start_bold(self): raise NotImplementedError def end_bold(self): raise NotImplementedError def start_superscript(self): raise NotImplementedError def end_superscript(self): raise NotImplementedError I'm pretty sure all the document generator plugin implementations support those functions. ~Brian |