本文整理汇总了C++中TextStyle::isSansSerif方法的典型用法代码示例。如果您正苦于以下问题:C++ TextStyle::isSansSerif方法的具体用法?C++ TextStyle::isSansSerif怎么用?C++ TextStyle::isSansSerif使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextStyle
的用法示例。
在下文中一共展示了TextStyle::isSansSerif方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: text
void SVGImage::text (const Text& text)
{
using namespace std;
TextStyle ts;
StyleType tts = getCorrectTextStyle(&ts,text);
if( tts == CLEAR )
{
comment("Text with clear font ignored:%s",text.getString().c_str());
return;
}
Color tc = ts.getColor();
int angle = text.getAngle();
ostr << tab;
ostr << "<text x=\"" << text.x << "\" y=\"" << ((ll)?(canvasHeight-text.y):text.y) << "\"";
//For the moment...to correct the transform
if ( ll )
{
ostr << " transform=\"scale(1,-1) translate(0,-" << canvasHeight << ")";
if ( angle )
ostr << " rotate(" << setbase(10) << -angle << "," << text.x << ","
<< ((ll)?(canvasHeight-text.y):text.y) << ")";
ostr << "\"";
}
else if ( angle )
ostr << " transform=\"rotate(" << setbase(10) << -angle << "," << text.x << ","
<< ((ll)?(canvasHeight-text.y):text.y) << ")\"";
stringstream tmp;
if(tc!=Color::BLACK)
{
tmp.fill('0');
tmp << "fill:#" << hex << setw(6) << tc.getRGB() << ";";
}
if(ts.getPointSize()!=12)
tmp << "font-size:" << ts.getPointSize() << "pt;";
if(!ts.isMonospace())
tmp << "font-family:" << (ts.isSerif()?"serif":(ts.isSansSerif()?"sans-serif":"")) << ";";
//<< (ts.isMonospace()?"monospace":(ts.isSerif()?"serif":(ts.isSansSerif()?"sans-serif":""))) << ";"
tmp << (ts.isBold()?"font-weight:bold;":"")
<< (ts.isItalic()?"font-style:italic;":"")
<< (ts.isUnderline()?"text-decoration:underline;":"")
<< (ts.isStrike()?"text-decoration:line-through;":"");
if(!text.isLeft())
tmp << "text-anchor:" << (text.isCenter()?"middle":"end") << ";";
// << (text.isCenter()?"middle":(text.isLeft()?"start":"end")) << ";"
string t = tmp.str();
if(t.size()!=0)
ostr << endl << tab << " style=\"" << t << "\"";
// Close first xml tag
ostr << ">" << endl;
ostr << tab << text.getString() << endl;
ostr << tab <<"</text>" << endl;
}