本文整理汇总了C++中CellParser::IsUnderlined方法的典型用法代码示例。如果您正苦于以下问题:C++ CellParser::IsUnderlined方法的具体用法?C++ CellParser::IsUnderlined怎么用?C++ CellParser::IsUnderlined使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CellParser
的用法示例。
在下文中一共展示了CellParser::IsUnderlined方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RecalculateWidths
void ParenCell::RecalculateWidths(CellParser& parser, int fontsize)
{
double scale = parser.GetScale();
if (m_innerCell == NULL)
m_innerCell = new TextCell;
m_innerCell->RecalculateWidthsList(parser, fontsize);
if (parser.CheckTeXFonts())
{
wxDC& dc = parser.GetDC();
m_innerCell->RecalculateSizeList(parser, fontsize);
int size = m_innerCell->GetMaxHeight();
int fontsize1 = (int) ((fontsize * scale + 0.5));
if (size < 2*fontsize1)
m_bigParenType = 0;
else if (size < 4*fontsize1)
m_bigParenType = 1;
else
m_bigParenType = 2;
if (m_bigParenType < 2)
{
m_parenFontSize = fontsize;
fontsize1 = (int) ((m_parenFontSize * scale + 0.5));
dc.SetFont( wxFont(fontsize1, wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false,
m_bigParenType == 0 ?
parser.GetTeXCMRI() :
parser.GetTeXCMEX()));
dc.GetTextExtent(m_bigParenType == 0 ? wxT("(") :
m_bigParenType == 1 ? wxT(PAREN_OPEN) :
wxT(PAREN_OPEN_TOP),
&m_signWidth, &m_signSize);
/// BUG 2897415: Exporting equations to HTML locks up on Mac
/// there is something wrong with what dc.GetTextExtent returns,
/// make sure there is no infinite loop!
int i=0;
// Avoid a possible infinite loop.
if(size < 2) size = 2;
while (m_signSize < TRANSFORM_SIZE(m_bigParenType, size) && i<20)
{
int fontsize1 = (int) ((m_parenFontSize++ * scale + 0.5));
dc.SetFont(wxFont(fontsize1, wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false,
m_bigParenType == 0 ?
parser.GetTeXCMRI() :
parser.GetTeXCMEX()));
dc.GetTextExtent(m_bigParenType == 0 ? wxT("(") :
m_bigParenType == 1 ? wxT(PAREN_OPEN) :
wxT(PAREN_OPEN_TOP),
&m_signWidth, &m_signSize);
// Avoid an infinite loop.
if(m_signSize < 2) m_signSize = 2;
i++;
}
}
else
{
m_parenFontSize = fontsize;
fontsize1 = (int) ((m_parenFontSize * scale + 0.5));
dc.SetFont(wxFont(fontsize1, wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false,
m_bigParenType < 1 ?
parser.GetTeXCMRI() :
parser.GetTeXCMEX()));
dc.GetTextExtent(wxT(PAREN_OPEN), &m_signWidth, &m_signSize);
}
m_signTop = m_signSize / 5;
m_width = m_innerCell->GetFullWidth(scale) + 2*m_signWidth;
}
else
{
#if defined __WXMSW__
wxDC& dc = parser.GetDC();
int fontsize1 = (int) ((PAREN_FONT_SIZE * scale + 0.5));
dc.SetFont(wxFont(fontsize1, wxFONTFAMILY_MODERN,
parser.IsItalic(TS_DEFAULT),
parser.IsBold(TS_DEFAULT),
parser.IsUnderlined(TS_DEFAULT),
parser.GetSymbolFontName()));
dc.GetTextExtent(PAREN_LEFT_TOP, &m_charWidth, &m_charHeight);
if(m_charHeight < 2)
m_charHeight = 2;
m_width = m_innerCell->GetFullWidth(scale) + 2*m_charWidth;
#else
m_width = m_innerCell->GetFullWidth(scale) + SCALE_PX(12, parser.GetScale());
#endif
}
m_open->RecalculateWidthsList(parser, fontsize);
m_close->RecalculateWidthsList(parser, fontsize);
ResetData();
}