Esempio n. 1
0
string LatexGenerator::getAttributes(const string & elemName,
                                             const ElementStyle &elem)
{
  ostringstream s;
  s  << "\\newcommand{\\hl"
     << elemName
     << "}[1]{\\textcolor[rgb]{"
     << elem.getColour().getRed(LATEX) << ","
     << elem.getColour().getGreen(LATEX) << ","
     << elem.getColour().getBlue(LATEX)
     << "}{";

  if (elem.isBold())
    s << "\\bf{";
  if (elem.isItalic())
    s << "\\it{";

  s  <<"#1";

  if (elem.isBold())
    s << "}";
  if (elem.isItalic())
    s << "}";

  s  <<"}}\n";
  return s.str();
}
Esempio n. 2
0
string RtfGenerator::getAttributes ( const ElementStyle & col )
{
    stringstream s;
    s  << "\\red"<< col.getColour().getRed ( RTF )
       << "\\green"<<col.getColour().getGreen ( RTF )
       << "\\blue"<<col.getColour().getBlue ( RTF )
       << ";";
    return s.str();
}
Esempio n. 3
0
string PangoGenerator::getAttributes ( const ElementStyle & elem )
{
    ostringstream s;
    s << "foreground=\"#"
      << ( elem.getColour().getRed ( HTML ) )
      << ( elem.getColour().getGreen ( HTML ) )
      << ( elem.getColour().getBlue ( HTML ) )
      << "\""
      << ( elem.isBold() ?     " weight=\"bold\"" :"" )
      << ( elem.isItalic() ?   " style=\"italic\"" :"" )
      << ( elem.isUnderline() ? " underline=\"single\"" :"" );
    return s.str();
}
Esempio n. 4
0
string ODTGenerator::getAttributes ( const string & elemName,
                                     const ElementStyle & elem )
{
    ostringstream s;
    s << "<style:style style:name=\""<<elemName<<"\" style:family=\"text\">\n"
      << "<style:text-properties fo:color=\"#"
      << ( elem.getColour().getRed ( HTML ) )
      << ( elem.getColour().getGreen ( HTML ) )
      << ( elem.getColour().getBlue ( HTML ) )
      << "\""
      << ( elem.isBold() ?     " fo:font-weight=\"bold\"" :"" )
      << ( elem.isItalic() ?   " fo:font-style=\"italic\"" :"" )
      << ( elem.isUnderline() ? " style:text-underline-style=\"solid\" style:text-underline-width=\"auto\" style:text-underline-color=\"font-color\"" :"" )
      <<"/>\n</style:style>\n" ;

    return s.str();
}
Esempio n. 5
0
string  HtmlGenerator::getAttributes(const string & elemName, const ElementStyle & elem)
{
  ostringstream s;
  if (!elemName.empty()) {
     s << "."<<cssClassName<<"."<<elemName<<" { ";
  }
  s << "color:#"
    << (elem.getColour().getRed(HTML))
    << (elem.getColour().getGreen(HTML))
    << (elem.getColour().getBlue(HTML))
    << ( elem.isBold() ?     "; font-weight:bold" :"" )
    << ( elem.isItalic() ?   "; font-style:italic" :"" )
    << ( elem.isUnderline()? "; text-decoration:underline" :"" );
  if (!elemName.empty()) {
     s << "; }\n" ;
  }
  return s.str();
}
Esempio n. 6
0
	string XmlGenerator::getAttributes ( const string & elemName,
	                                     const ElementStyle & elem )
	{
		ostringstream s;
		s  << "\t<class name=\""
		<< elemName
		<<"\" color=\""
		<< ( elem.getColour().getRed ( XML ) )
		<< ( elem.getColour().getGreen ( XML ) )
		<< ( elem.getColour().getBlue ( XML ) )
		<< "\" bold=\""
		<< ( elem.isBold() ? "true" :"false" )
		<< "\" italic=\""
		<< ( elem.isItalic() ? "true" :"false" )
		<< "\" underline=\""
		<< ( elem.isUnderline() ? "true" :"false" )
		<< "\" />\n" ;
		return  s.str();
	}