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


C# Chunk.GetHyphenation方法代码示例

本文整理汇总了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();
 }
开发者ID:pusp,项目名称:o2platform,代码行数:11,代码来源:Phrase.cs

示例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;
     }
开发者ID:pusp,项目名称:o2platform,代码行数:39,代码来源:Phrase.cs


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