本文整理汇总了C#中iTextSharp.text.Chunk.GetHyphenation方法的典型用法代码示例。如果您正苦于以下问题:C# Chunk.GetHyphenation方法的具体用法?C# Chunk.GetHyphenation怎么用?C# Chunk.GetHyphenation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.text.Chunk
的用法示例。
在下文中一共展示了Chunk.GetHyphenation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Phrase
/// <summary>
/// Constructs a Phrase with a certain Chunk and a certain leading.
/// </summary>
/// <param name="leading">the leading</param>
/// <param name="chunk">a Chunk</param>
public Phrase(float leading, Chunk chunk) {
this.leading = leading;
base.Add(chunk);
font = chunk.Font;
hyphenation = chunk.GetHyphenation();
}
示例2: AddChunk
/// <summary>
/// Adds a Chunk.
/// </summary>
/// <remarks>
/// This method is a hack to solve a problem I had with phrases that were split between chunks
/// in the wrong place.
/// </remarks>
/// <param name="chunk">a Chunk</param>
/// <returns>a bool</returns>
protected bool AddChunk(Chunk chunk) {
Font f = chunk.Font;
String c = chunk.Content;
if (font != null && !font.IsStandardFont()) {
f = font.Difference(chunk.Font);
}
if (Count > 0 && !chunk.HasAttributes()) {
try {
Chunk previous = (Chunk) this[Count - 1];
if (!previous.HasAttributes()
&& (f == null
|| f.CompareTo(previous.Font) == 0)
&& previous.Font.CompareTo(f) == 0
&& !"".Equals(previous.Content.Trim())
&& !"".Equals(c.Trim())) {
previous.Append(c);
return true;
}
}
catch {
}
}
Chunk newChunk = new Chunk(c, f);
newChunk.Attributes = chunk.Attributes;
if (hyphenation != null && newChunk.GetHyphenation() == null && !newChunk.IsEmpty()) {
newChunk.SetHyphenation(hyphenation);
}
base.Add(newChunk);
return true;
}