6.4. qpretty.text.cc


6.4.1

A pretty printer for plain text, which acts as the fall back for QWeave when it can't find anything more specific.

#include <iostream>
#include <string>
#include <cstring>
#include "qweave.hh"

6.4.2
static string s;

6.4.3
const string &
pretty_print_text (const string &source)
{
   string se;
   s = "";

   for (unsigned int i = 0; i < source.size(); ++i)
   {
      char c = source[i];

      if (c == '\n')
         s += use_html ? "\n" : "\n\\par\\tt{}";
      else
      {
         format_text (c, se, true);
         s += se;
      }
   }

   return s;
}