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


C# Chunk.SetTextRise方法代码示例

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


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

示例1: GetChunk

        public static Chunk GetChunk(Properties attributes)
        {
            Chunk chunk = new Chunk();

            chunk.Font = FontFactory.GetFont(attributes);
            String value;

            value = attributes[ElementTags.ITEXT];
            if (value != null) {
                chunk.Append(value);
            }
            value = attributes[ElementTags.LOCALGOTO];
            if (value != null) {
                chunk.SetLocalGoto(value);
            }
            value = attributes[ElementTags.REMOTEGOTO];
            if (value != null) {
                String page = attributes[ElementTags.PAGE];
                if (page != null) {
                    chunk.SetRemoteGoto(value, int.Parse(page));
                }
                else {
                    String destination = attributes[ElementTags.DESTINATION];
                    if (destination != null) {
                        chunk.SetRemoteGoto(value, destination);
                    }
                }
            }
            value = attributes[ElementTags.LOCALDESTINATION];
            if (value != null) {
                chunk.SetLocalDestination(value);
            }
            value = attributes[ElementTags.SUBSUPSCRIPT];
            if (value != null) {
                chunk.SetTextRise(float.Parse(value, NumberFormatInfo.InvariantInfo));
            }
            value = attributes[Markup.CSS_KEY_VERTICALALIGN];
            if (value != null && value.EndsWith("%")) {
                float p = float.Parse(value.Substring(0, value.Length - 1), NumberFormatInfo.InvariantInfo) / 100f;
                chunk.SetTextRise(p * chunk.Font.Size);
            }
            value = attributes[ElementTags.GENERICTAG];
            if (value != null) {
                chunk.SetGenericTag(value);
            }
            value = attributes[ElementTags.BACKGROUNDCOLOR];
            if (value != null) {
                chunk.SetBackground(Markup.DecodeColor(value));
            }
            return chunk;
        }
开发者ID:pixelia-es,项目名称:RazorPDF2,代码行数:51,代码来源:ElementFactory.cs

示例2: CreateChunk

 public Chunk CreateChunk(String text, ChainedProperties props)
 {
     Font font = GetFont(props);
     float size = font.Size;
     size /= 2;
     Chunk ck = new Chunk(text, font);
     if (props.HasProperty("sub"))
         ck.SetTextRise(-size);
     else if (props.HasProperty("sup"))
         ck.SetTextRise(size);
     ck.SetHyphenation(GetHyphenation(props));
     return ck;
 }
开发者ID:pixelia-es,项目名称:RazorPDF2,代码行数:13,代码来源:FactoryProperties.cs


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