string XmlGenerator::getStyleDefinition() { if ( styleDefinitionCache.empty() ) { ostringstream os; os << "\n<style>\n" << "\t<bgcolor value=\"" << ( docStyle.getBgColour().getRed ( XML ) ) << ( docStyle.getBgColour().getGreen ( XML ) ) << ( docStyle.getBgColour().getBlue ( XML ) ) << "\" />\n"; os << "\t<font size=\"" << getBaseFontSize(); os << "\" family=\"" << getBaseFont() << "\" />\n"; os << getAttributes ( STY_NAME_STD, docStyle.getDefaultStyle() ) << getAttributes ( STY_NAME_NUM, docStyle.getNumberStyle() ) << getAttributes ( STY_NAME_ESC, docStyle.getEscapeCharStyle() ) << getAttributes ( STY_NAME_STR, docStyle.getStringStyle() ) << getAttributes ( STY_NAME_DST, docStyle.getDirectiveStringStyle() ) << getAttributes ( STY_NAME_SLC, docStyle.getSingleLineCommentStyle() ) << getAttributes ( STY_NAME_COM, docStyle.getCommentStyle() ) << getAttributes ( STY_NAME_DIR, docStyle.getDirectiveStyle() ) << getAttributes ( STY_NAME_SYM, docStyle.getSymbolStyle() ) << getAttributes ( STY_NAME_LIN, docStyle.getLineStyle() ); KeywordStyles styles = docStyle.getKeywordStyles(); for ( KSIterator it=styles.begin(); it!=styles.end(); it++ ) { os << getAttributes ( it->first, it->second ); } os << "</style>\n"; styleDefinitionCache=os.str(); } return styleDefinitionCache; }
void SVGGenerator::printBody() { *out << "<g>\n<rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\"/>"; // rect: background color int fontSize=0; StringTools::str2num<int> ( fontSize, getBaseFontSize(), std::dec ); *out << "\n<text x=\"10\" y=\""<<fontSize*2<<"\">"; processRootState(); *out << "</text>\n</g>\n"; }
string SVGGenerator::getNewLine() { if ( lineNumber>1 ) { ostringstream os; int fontSize=0; StringTools::str2num<int> ( fontSize, getBaseFontSize(), std::dec ); os<< "</text>\n<text x=\"10\" y=\""<< ( lineNumber*fontSize*2 ) <<"\">"; return os.str(); } else { return ""; } }
string SVGGenerator::getStyleDefinition() { if ( styleDefinitionCache.empty() ) { ostringstream os; if ( includeStyleDef ) { os << "<style type=\"text/css\">\n" << "<![CDATA[\n"; } os << "rect { fill:#" << ( docStyle.getBgColour().getRed ( SVG ) ) << ( docStyle.getBgColour().getGreen ( SVG ) ) << ( docStyle.getBgColour().getBlue ( SVG ) ) << "; } \n"; os << "g { font-size: " << getBaseFontSize(); os << "; font-family: \"" << getBaseFont() << "\"; }\n"; os << getAttributes ( "text", docStyle.getDefaultStyle() ) << getAttributes ( "tspan."+STY_NAME_NUM, docStyle.getNumberStyle() ) << getAttributes ( "tspan."+STY_NAME_ESC, docStyle.getEscapeCharStyle() ) << getAttributes ( "tspan."+STY_NAME_STR, docStyle.getStringStyle() ) << getAttributes ( "tspan."+STY_NAME_DST, docStyle.getPreProcStringStyle() ) << getAttributes ( "tspan."+STY_NAME_SLC, docStyle.getSingleLineCommentStyle() ) << getAttributes ( "tspan."+STY_NAME_COM, docStyle.getCommentStyle() ) << getAttributes ( "tspan."+STY_NAME_DIR, docStyle.getPreProcessorStyle() ) << getAttributes ( "tspan."+STY_NAME_SYM, docStyle.getOperatorStyle() ) << getAttributes ( "tspan."+STY_NAME_IPL, docStyle.getInterpolationStyle() ) << getAttributes ( "tspan."+STY_NAME_LIN, docStyle.getLineStyle() ); KeywordStyles styles = docStyle.getKeywordStyles(); for ( KSIterator it=styles.begin(); it!=styles.end(); it++ ) { os << getAttributes ( "tspan."+it->first, it->second ); } if ( includeStyleDef ) { os << "]]>\n" << "</style>"; } styleDefinitionCache=os.str(); } return styleDefinitionCache; }
string ODTGenerator::getStyleDefinition() { if ( styleDefinitionCache.empty() ) { ostringstream os; os << "<office:styles>\n<style:style style:name=\"Standard\" style:family=\"paragraph\" style:class=\"text\">\n" << " <style:text-properties style:font-name=\""<< getBaseFont()<<"\" fo:font-size=\""<<getBaseFontSize()<<"pt\"/>" << "</style:style>\n</office:styles>" << "<office:automatic-styles>\n"; os << getAttributes ( STY_NAME_STD, docStyle.getDefaultStyle() ) << getAttributes ( STY_NAME_NUM, docStyle.getNumberStyle() ) << getAttributes ( STY_NAME_ESC, docStyle.getEscapeCharStyle() ) << getAttributes ( STY_NAME_STR, docStyle.getStringStyle() ) << getAttributes ( STY_NAME_DST, docStyle.getPreProcStringStyle() ) << getAttributes ( STY_NAME_SLC, docStyle.getSingleLineCommentStyle() ) << getAttributes ( STY_NAME_COM, docStyle.getCommentStyle() ) << getAttributes ( STY_NAME_DIR, docStyle.getPreProcessorStyle() ) << getAttributes ( STY_NAME_SYM, docStyle.getOperatorStyle() ) << getAttributes ( STY_NAME_IPL, docStyle.getInterpolationStyle() ) << getAttributes ( STY_NAME_LIN, docStyle.getLineStyle() ); KeywordStyles styles = docStyle.getKeywordStyles(); for ( KSIterator it=styles.begin(); it!=styles.end(); it++ ) { os << getAttributes (it->first, it->second ); } os << "<style:page-layout style:name=\"pm1\">" << "<style:page-layout-properties fo:page-width=\"21.001cm\" fo:page-height=\"29.7cm\" style:num-format=\"1\"" << " style:print-orientation=\"portrait\" fo:margin=\"2cm\" fo:margin-top=\"2cm\" fo:margin-bottom=\"2cm\" fo:margin-left=\"2cm\" fo:margin-right=\"2cm\" " << "fo:background-color=\"#" << ( docStyle.getBgColour().getRed ( HTML ) ) << ( docStyle.getBgColour().getGreen ( HTML ) ) << ( docStyle.getBgColour().getBlue ( HTML ) ) << "\" style:writing-mode=\"lr-tb\" style:footnote-max-height=\"0cm\">\n" << " <style:background-image/>\n" << " <style:footnote-sep style:width=\"0.018cm\" style:distance-before-sep=\"0.101cm\" style:distance-after-sep=\"0.101cm\" style:line-style=\"solid\"" << " style:adjustment=\"left\" style:rel-width=\"25%\" style:color=\"#000000\"/>" << "</style:page-layout-properties>\n" << "<style:header-style/>\n" << "<style:footer-style/>\n" << "</style:page-layout>\n" << "</office:automatic-styles>\n" << "<office:master-styles>\n" << " <style:master-page style:name=\"Standard\" style:page-layout-name=\"pm1\"/>\n" << "</office:master-styles>\n"; styleDefinitionCache=os.str(); } return styleDefinitionCache; }