当前位置: 首页>>代码示例>>C++>>正文


C++ FontInfo::uuline方法代码示例

本文整理汇总了C++中FontInfo::uuline方法的典型用法代码示例。如果您正苦于以下问题:C++ FontInfo::uuline方法的具体用法?C++ FontInfo::uuline怎么用?C++ FontInfo::uuline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FontInfo的用法示例。


在下文中一共展示了FontInfo::uuline方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getBar

static FontState getBar(FontInfo const & fi)
{
	if (fi.emph() == FONT_TOGGLE)
		return EMPH_TOGGLE;

	if (fi.underbar() == FONT_TOGGLE)
		return UNDERBAR_TOGGLE;

	if (fi.strikeout() == FONT_TOGGLE)
		return STRIKEOUT_TOGGLE;

	if (fi.uuline() == FONT_TOGGLE)
		return UULINE_TOGGLE;

	if (fi.uwave() == FONT_TOGGLE)
		return UWAVE_TOGGLE;

	if (fi.noun() == FONT_TOGGLE)
		return NOUN_TOGGLE;

	if (fi.emph() == FONT_IGNORE
	    && fi.underbar() == FONT_IGNORE
	    && fi.noun() == FONT_IGNORE)
		return IGNORE;

	return INHERIT;
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:27,代码来源:GuiCharacter.cpp

示例2: stateText

docstring const stateText(FontInfo const & f)
{
	odocstringstream os;
	if (f.family() != INHERIT_FAMILY)
		os << _(GUIFamilyNames[f.family()]) << ", ";
	if (f.series() != INHERIT_SERIES)
		os << _(GUISeriesNames[f.series()]) << ", ";
	if (f.shape() != INHERIT_SHAPE)
		os << _(GUIShapeNames[f.shape()]) << ", ";
	if (f.size() != FONT_SIZE_INHERIT)
		os << _(GUISizeNames[f.size()]) << ", ";
	if (f.color() != Color_inherit)
		os << lcolor.getGUIName(f.color()) << ", ";
	// FIXME: uncomment this when we support background.
	//if (f.background() != Color_inherit)
	//	os << lcolor.getGUIName(f.background()) << ", ";
	if (f.emph() != FONT_INHERIT)
		os << bformat(_("Emphasis %1$s, "),
			      _(GUIMiscNames[f.emph()]));
	if (f.underbar() != FONT_INHERIT)
		os << bformat(_("Underline %1$s, "),
			      _(GUIMiscNames[f.underbar()]));
	if (f.strikeout() != FONT_INHERIT)
		os << bformat(_("Strikeout %1$s, "),
			      _(GUIMiscNames[f.strikeout()]));
	if (f.uuline() != FONT_INHERIT)
		os << bformat(_("Double underline %1$s, "),
			      _(GUIMiscNames[f.uuline()]));
	if (f.uwave() != FONT_INHERIT)
		os << bformat(_("Wavy underline %1$s, "),
			      _(GUIMiscNames[f.uwave()]));
	if (f.noun() != FONT_INHERIT)
		os << bformat(_("Noun %1$s, "),
			      _(GUIMiscNames[f.noun()]));
	if (f == inherit_font)
		os << _("Default") << ", ";

	return os.str();
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:39,代码来源:Font.cpp

示例3: latexWriteEndChanges

/// Writes ending block of LaTeX needed to close use of this font
// Returns number of chars written
// This one corresponds to latexWriteStartChanges(). (Asger)
int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
				  OutputParams const & runparams,
				  Font const & base,
				  Font const & next,
				  bool const & closeLanguage) const
{
	int count = 0;
	bool env = false;

	// reduce the current font to changes against the base
	// font (of the layout). We use a temporary for this to
	// avoid changing this font instance, as that would break
	FontInfo f = bits_;
	f.reduce(base.bits_);

	if (f.family() != INHERIT_FAMILY) {
		os << '}';
		++count;
		env = true; // Size change need not bother about closing env.
	}
	if (f.series() != INHERIT_SERIES) {
		os << '}';
		++count;
		env = true; // Size change need not bother about closing env.
	}
	if (f.shape() != INHERIT_SHAPE) {
		os << '}';
		++count;
		env = true; // Size change need not bother about closing env.
	}
	if (f.color() != Color_inherit && f.color() != Color_ignore) {
		os << '}';
		++count;
		env = true; // Size change need not bother about closing env.
	}
	if (f.emph() == FONT_ON) {
		os << '}';
		++count;
		env = true; // Size change need not bother about closing env.
	}
	if (f.noun() == FONT_ON) {
		os << '}';
		++count;
		env = true; // Size change need not bother about closing env.
	}
	if (f.size() != FONT_SIZE_INHERIT) {
		// We only have to close if only size changed
		if (!env) {
			os << '}';
			++count;
		}
	}
	if (f.underbar() == FONT_ON) {
		os << '}';
		++count;
		runparams.inulemcmd = false;
	}
	if (f.strikeout() == FONT_ON) {
		os << '}';
		++count;
		runparams.inulemcmd = false;
	}
	if (f.uuline() == FONT_ON) {
		os << '}';
		++count;
		runparams.inulemcmd = false;
	}
	if (f.uwave() == FONT_ON) {
		os << '}';
		++count;
		runparams.inulemcmd = false;
	}

	// If the current language is Hebrew, Arabic, or Farsi
	// the numbers are written Left-to-Right. ArabTeX package
	// reorders the number automatically but the packages used
	// for Hebrew and Farsi (Arabi) do not.
	if (bits_.number() == FONT_ON && next.fontInfo().number() != FONT_ON
		&& (language()->lang() == "hebrew"
			|| language()->lang() == "farsi"
			|| language()->lang() == "arabic_arabi")) {
		os << "\\endL}";
		count += 6;
	}

	if (open_encoding_) {
		// We need to close the encoding even if it does not change
		// to do correct environment nesting
		Encoding const * const ascii = encodings.fromLyXName("ascii");
		pair<bool, int> const c = switchEncoding(os.os(), bparams,
				runparams, *ascii);
		LATTEST(c.first);
		count += c.second;
		runparams.encoding = ascii;
		open_encoding_ = false;
	}

//.........这里部分代码省略.........
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:101,代码来源:Font.cpp

示例4: latexWriteStartChanges


//.........这里部分代码省略.........
	// If the current language is Hebrew, Arabic, or Farsi
	// the numbers are written Left-to-Right. ArabTeX package
	// reorders the number automatically but the packages used
	// for Hebrew and Farsi (Arabi) do not.
	if (bits_.number() == FONT_ON && prev.fontInfo().number() != FONT_ON
		&& (language()->lang() == "hebrew"
			|| language()->lang() == "farsi" 
			|| language()->lang() == "arabic_arabi")) {
		os << "{\\beginL ";
		count += 9;
	}

	FontInfo f = bits_;
	f.reduce(base.bits_);

	if (f.family() != INHERIT_FAMILY) {
		os << '\\'
		   << LaTeXFamilyNames[f.family()]
		   << '{';
		count += strlen(LaTeXFamilyNames[f.family()]) + 2;
		env = true; //We have opened a new environment
	}
	if (f.series() != INHERIT_SERIES) {
		os << '\\'
		   << LaTeXSeriesNames[f.series()]
		   << '{';
		count += strlen(LaTeXSeriesNames[f.series()]) + 2;
		env = true; //We have opened a new environment
	}
	if (f.shape() != INHERIT_SHAPE) {
		os << '\\'
		   << LaTeXShapeNames[f.shape()]
		   << '{';
		count += strlen(LaTeXShapeNames[f.shape()]) + 2;
		env = true; //We have opened a new environment
	}
	if (f.color() != Color_inherit && f.color() != Color_ignore) {
		os << "\\textcolor{"
		   << from_ascii(lcolor.getLaTeXName(f.color()))
		   << "}{";
		count += lcolor.getLaTeXName(f.color()).length() + 13;
		env = true; //We have opened a new environment
	}
	// FIXME: uncomment this when we support background.
	/*
	if (f.background() != Color_inherit && f.background() != Color_ignore) {
		os << "\\textcolor{"
		   << from_ascii(lcolor.getLaTeXName(f.background()))
		   << "}{";
		count += lcolor.getLaTeXName(f.background()).length() + 13;
		env = true; //We have opened a new environment
	}
	*/
	if (f.emph() == FONT_ON) {
		os << "\\emph{";
		count += 6;
		env = true; //We have opened a new environment
	}
	// \noun{} is a LyX special macro
	if (f.noun() == FONT_ON) {
		os << "\\noun{";
		count += 6;
		env = true; //We have opened a new environment
	}
	if (f.size() != FONT_SIZE_INHERIT) {
		// If we didn't open an environment above, we open one here
		if (!env) {
			os << '{';
			++count;
		}
		os << '\\'
		   << LaTeXSizeNames[f.size()]
		   << "{}";
		count += strlen(LaTeXSizeNames[f.size()]) + 3;
	}
	// The ulem commands need to be on the deepest nesting level
	// because ulem puts every nested group or macro in a box,
	// which prevents linebreaks (#8424, #8733)
	if (f.underbar() == FONT_ON) {
		os << "\\uline{";
		count += 10;
		runparams.inulemcmd = true;
	}
	if (f.strikeout() == FONT_ON) {
		os << "\\sout{";
		count += 9;
		runparams.inulemcmd = true;
	}
	if (f.uuline() == FONT_ON) {
		os << "\\uuline{";
		count += 11;
		runparams.inulemcmd = true;
	}
	if (f.uwave() == FONT_ON) {
		os << "\\uwave{";
		count += 10;
		runparams.inulemcmd = true;
	}
	return count;
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:101,代码来源:Font.cpp


注:本文中的FontInfo::uuline方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。