How to create a text formatter

时间:2017-12-18 07:10:13

标签: formatting

I have this code

.large My First Document .normal .paragraph This is my .italics very first .regular document, and I am very proud that I am getting this on the string. While this paragraph is not filled, the following one has automatic filling set: .paragraph .indent .fill Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." .nofill .outdent Well, that was .bold exciting .regular good luck! and I need to be able to enter this and it executes the above commands (that start with .) and prints out the text then saves it to a PDF.

The commands are: - .paragraph Starts a new paragraph - .fill enables sets indentation to fill for paragrahs, where the last character of a line must end at the end of the margin (except for the last line of a paragarph) - .nofill the default, sets the formatter to regular formatting - .regular resets the font to the normal font - .italic sets the font to italic - .bold sets the font to bold - .indent indents the text by a tab (or equivalent) - .outdent outdents the text by a tab (or equivalent)

Any idea how I'd go about this? Incredibly stuck at the moment.

0 个答案:

没有答案