123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- using HTEXLib.Models.Inner;
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace HTEXLib.Models.HTEX
- {
- public class HtexText : HtexElement
- {
- public string id { get; set; }
- public string Text { get; set; }
- public bool PictureBullet { get; set; }
- public bool isBullet { get; set; }
- public int DefaultBulletSize { get; set; } = 12;
- public double bulletSize { get; set; }
- public bool bold { get; set; }
- public bool italic { get; set; }
- public string underline { get; set; }
- public int slideIndex { get; set; }
- public double width { get; set; }
- public double Rotate { get; set; }
- public void setLeft(double newLeft)
- {
- left = newLeft;
- }
- /// <summary>
- /// 处理字体
- /// </summary>
- /// <param name="left"></param>
- /// <param name="top"></param>
- /// <param name="fontFamily"></param>
- /// <param name="fontColor"></param>
- /// <param name="fontSize"></param>
- /// <param name="isBullet"></param>
- /// <param name="bold"></param>
- /// <param name="italic"></param>
- /// <param name="underline"></param>
- /// <param name="id"></param>
- /// <param name="slideIndex"></param>
- public HtexText(double left, double top, string fontFamily, string fontColor, double fontSize, bool isBullet,
- bool bold, bool italic, string underline, string id, int slideIndex)
- {
- base.fontSize = fontSize;
- base.left = left;
- base.top = top;
- base.fontFamily = fontFamily;
- // this.isBullet = isBullet;
- base.fontColor = fontColor;
- this.bold = bold;
- this.italic = italic;
- this.id = id;
- this.slideIndex = slideIndex;
- base.partForm = partForm;
- ///TODO 字体贯穿线
- ///var FontStrik = node.GetTextByPath("a:rPr/@strike");
- ///var strikethrough = FontStrik != null ? FontStrik.Value : "noStrike";
- if (underline != null)
- {
- // if (underline.Equals("None"))
- //{
- // this.underline = "none";
- //}
- //else {
- //}
- this.underline = underline;
- }
- else this.underline = "none";
- }
- public override List<Item> DrawElement()
- {
- if (id != null)
- {
- id = id.Substring(3);
- int tryParse = 0;
- if (int.TryParse(id, out tryParse))
- {
- if (PPTShape.effectShapes.Contains(slideIndex + "_" + tryParse))
- {
- return null;
- }
- }
- }
- return null;
- // return new List<Item>() { new Text() };
-
- }
- public bool sameProps(HtexText other)
- {
- if (other == null)
- {
- return false;
- }
- return this.top == other.top
- && this.fontSize == other.fontSize
- && this.fontColor == other.fontColor
- && this.italic == other.italic
- && this.bold == other.bold
- && this.underline == other.underline
- && this.fontFamily == other.fontFamily;
- }
- }
- }
|