本文整理汇总了C#中Font.SetStyle方法的典型用法代码示例。如果您正苦于以下问题:C# Font.SetStyle方法的具体用法?C# Font.SetStyle怎么用?C# Font.SetStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Font
的用法示例。
在下文中一共展示了Font.SetStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddSpacing
/**
* Adds extra space.
* This method should probably be rewritten.
*/
protected internal void AddSpacing(float extraspace, float oldleading, Font f) {
if (extraspace == 0) return;
if (pageEmpty) return;
if (currentHeight + line.Height + leading > IndentTop - IndentBottom) return;
leading = extraspace;
CarriageReturn();
if (f.IsUnderlined() || f.IsStrikethru()) {
f = new Font(f);
int style = f.Style;
style &= ~Font.UNDERLINE;
style &= ~Font.STRIKETHRU;
f.SetStyle(style);
}
Chunk space = new Chunk(" ", f);
space.Process(this);
CarriageReturn();
leading = oldleading;
}
示例2: AddSpacing
/**
* Adds extra space.
*/
// this method should probably be rewritten
virtual protected internal void AddSpacing(float extraspace, float oldleading, Font f, bool spacingAfter) {
if (extraspace == 0)
return;
if (pageEmpty)
return;
if (spacingAfter && !pageEmpty) {
if (lines.Count == 0 && line.Size == 0) {
return;
}
}
float height = spacingAfter ? extraspace : CalculateLineHeight();
if (currentHeight + height > IndentTop - IndentBottom) {
NewPage();
return;
}
leading = extraspace;
CarriageReturn();
if (f.IsUnderlined() || f.IsStrikethru()) {
f = new Font(f);
int style = f.Style;
style &= ~Font.UNDERLINE;
style &= ~Font.STRIKETHRU;
f.SetStyle(style);
}
Chunk space = new Chunk(" ", f);
if (spacingAfter && pageEmpty) {
space = new Chunk("", f);
}
space.Process(this);
CarriageReturn();
leading = oldleading;
}