text.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. from __future__ import absolute_import
  2. # Copyright (c) 2010-2019 openpyxl
  3. from openpyxl.compat import unicode
  4. from openpyxl.descriptors.serialisable import Serialisable
  5. from openpyxl.descriptors import (
  6. Alias,
  7. Typed,
  8. Set,
  9. NoneSet,
  10. Sequence,
  11. String,
  12. Bool,
  13. MinMax,
  14. Integer
  15. )
  16. from openpyxl.descriptors.excel import (
  17. HexBinary,
  18. TextPoint,
  19. Coordinate,
  20. ExtensionList,
  21. Relation,
  22. )
  23. from openpyxl.descriptors.nested import (
  24. NestedInteger,
  25. NestedString,
  26. NestedText,
  27. NestedValue,
  28. EmptyTag
  29. )
  30. from openpyxl.xml.constants import DRAWING_NS
  31. from .colors import ColorChoiceDescriptor
  32. from .effect import *
  33. from .fill import *
  34. from .geometry import (
  35. LineProperties,
  36. Color,
  37. Scene3D
  38. )
  39. from openpyxl.descriptors.excel import ExtensionList as OfficeArtExtensionList
  40. from openpyxl.descriptors.nested import NestedBool
  41. class EmbeddedWAVAudioFile(Serialisable):
  42. name = String(allow_none=True)
  43. def __init__(self,
  44. name=None,
  45. ):
  46. self.name = name
  47. class Hyperlink(Serialisable):
  48. tagname = "hlinkClick"
  49. namespace = DRAWING_NS
  50. invalidUrl = String(allow_none=True)
  51. action = String(allow_none=True)
  52. tgtFrame = String(allow_none=True)
  53. tooltip = String(allow_none=True)
  54. history = Bool(allow_none=True)
  55. highlightClick = Bool(allow_none=True)
  56. endSnd = Bool(allow_none=True)
  57. snd = Typed(expected_type=EmbeddedWAVAudioFile, allow_none=True)
  58. extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
  59. id = Relation(allow_none=True)
  60. __elements__ = ('snd',)
  61. def __init__(self,
  62. invalidUrl=None,
  63. action=None,
  64. tgtFrame=None,
  65. tooltip=None,
  66. history=None,
  67. highlightClick=None,
  68. endSnd=None,
  69. snd=None,
  70. extLst=None,
  71. id=None,
  72. ):
  73. self.invalidUrl = invalidUrl
  74. self.action = action
  75. self.tgtFrame = tgtFrame
  76. self.tooltip = tooltip
  77. self.history = history
  78. self.highlightClick = highlightClick
  79. self.endSnd = endSnd
  80. self.snd = snd
  81. self.id = id
  82. class Font(Serialisable):
  83. tagname = "latin"
  84. namespace = DRAWING_NS
  85. typeface = String()
  86. panose = HexBinary(allow_none=True)
  87. pitchFamily = MinMax(min=0, max=52, allow_none=True)
  88. charset = Integer(allow_none=True)
  89. def __init__(self,
  90. typeface=None,
  91. panose=None,
  92. pitchFamily=None,
  93. charset=None,
  94. ):
  95. self.typeface = typeface
  96. self.panose = panose
  97. self.pitchFamily = pitchFamily
  98. self.charset = charset
  99. class CharacterProperties(Serialisable):
  100. tagname = "defRPr"
  101. namespace = DRAWING_NS
  102. kumimoji = Bool(allow_none=True)
  103. lang = String(allow_none=True)
  104. altLang = String(allow_none=True)
  105. sz = MinMax(allow_none=True, min=100, max=400000) # 100ths of a point
  106. b = Bool(allow_none=True)
  107. i = Bool(allow_none=True)
  108. u = NoneSet(values=(['words', 'sng', 'dbl', 'heavy', 'dotted',
  109. 'dottedHeavy', 'dash', 'dashHeavy', 'dashLong', 'dashLongHeavy',
  110. 'dotDash', 'dotDashHeavy', 'dotDotDash', 'dotDotDashHeavy', 'wavy',
  111. 'wavyHeavy', 'wavyDbl']))
  112. strike = NoneSet(values=(['noStrike', 'sngStrike', 'dblStrike']))
  113. kern = Integer(allow_none=True)
  114. cap = NoneSet(values=(['small', 'all']))
  115. spc = Integer(allow_none=True)
  116. normalizeH = Bool(allow_none=True)
  117. baseline = Integer(allow_none=True)
  118. noProof = Bool(allow_none=True)
  119. dirty = Bool(allow_none=True)
  120. err = Bool(allow_none=True)
  121. smtClean = Bool(allow_none=True)
  122. smtId = Integer(allow_none=True)
  123. bmk = String(allow_none=True)
  124. ln = Typed(expected_type=LineProperties, allow_none=True)
  125. highlight = Typed(expected_type=Color, allow_none=True)
  126. latin = Typed(expected_type=Font, allow_none=True)
  127. ea = Typed(expected_type=Font, allow_none=True)
  128. cs = Typed(expected_type=Font, allow_none=True)
  129. sym = Typed(expected_type=Font, allow_none=True)
  130. hlinkClick = Typed(expected_type=Hyperlink, allow_none=True)
  131. hlinkMouseOver = Typed(expected_type=Hyperlink, allow_none=True)
  132. rtl = NestedBool(allow_none=True)
  133. extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
  134. # uses element group EG_FillProperties
  135. noFill = EmptyTag(namespace=DRAWING_NS)
  136. solidFill = ColorChoiceDescriptor()
  137. gradFill = Typed(expected_type=GradientFillProperties, allow_none=True)
  138. blipFill = Typed(expected_type=BlipFillProperties, allow_none=True)
  139. pattFill = Typed(expected_type=PatternFillProperties, allow_none=True)
  140. grpFill = EmptyTag(namespace=DRAWING_NS)
  141. # uses element group EG_EffectProperties
  142. effectLst = Typed(expected_type=EffectList, allow_none=True)
  143. effectDag = Typed(expected_type=EffectContainer, allow_none=True)
  144. # uses element group EG_TextUnderlineLine
  145. uLnTx = EmptyTag()
  146. uLn = Typed(expected_type=LineProperties, allow_none=True)
  147. # uses element group EG_TextUnderlineFill
  148. uFillTx = EmptyTag()
  149. uFill = EmptyTag()
  150. __elements__ = ('ln', 'noFill', 'solidFill', 'gradFill', 'blipFill',
  151. 'pattFill', 'grpFill', 'effectLst', 'effectDag', 'highlight','uLnTx',
  152. 'uLn', 'uFillTx', 'uFill', 'latin', 'ea', 'cs', 'sym', 'hlinkClick',
  153. 'hlinkMouseOver', 'rtl', )
  154. def __init__(self,
  155. kumimoji=None,
  156. lang=None,
  157. altLang=None,
  158. sz=None,
  159. b=None,
  160. i=None,
  161. u=None,
  162. strike=None,
  163. kern=None,
  164. cap=None,
  165. spc=None,
  166. normalizeH=None,
  167. baseline=None,
  168. noProof=None,
  169. dirty=None,
  170. err=None,
  171. smtClean=None,
  172. smtId=None,
  173. bmk=None,
  174. ln=None,
  175. highlight=None,
  176. latin=None,
  177. ea=None,
  178. cs=None,
  179. sym=None,
  180. hlinkClick=None,
  181. hlinkMouseOver=None,
  182. rtl=None,
  183. extLst=None,
  184. noFill=None,
  185. solidFill=None,
  186. gradFill=None,
  187. blipFill=None,
  188. pattFill=None,
  189. grpFill=None,
  190. effectLst=None,
  191. effectDag=None,
  192. uLnTx=None,
  193. uLn=None,
  194. uFillTx=None,
  195. uFill=None,
  196. ):
  197. self.kumimoji = kumimoji
  198. self.lang = lang
  199. self.altLang = altLang
  200. self.sz = sz
  201. self.b = b
  202. self.i = i
  203. self.u = u
  204. self.strike = strike
  205. self.kern = kern
  206. self.cap = cap
  207. self.spc = spc
  208. self.normalizeH = normalizeH
  209. self.baseline = baseline
  210. self.noProof = noProof
  211. self.dirty = dirty
  212. self.err = err
  213. self.smtClean = smtClean
  214. self.smtId = smtId
  215. self.bmk = bmk
  216. self.ln = ln
  217. self.highlight = highlight
  218. self.latin = latin
  219. self.ea = ea
  220. self.cs = cs
  221. self.sym = sym
  222. self.hlinkClick = hlinkClick
  223. self.hlinkMouseOver = hlinkMouseOver
  224. self.rtl = rtl
  225. self.noFill = noFill
  226. self.solidFill = solidFill
  227. self.gradFill = gradFill
  228. self.blipFill = blipFill
  229. self.pattFill = pattFill
  230. self.grpFill = grpFill
  231. self.effectLst = effectLst
  232. self.effectDag = effectDag
  233. self.uLnTx = uLnTx
  234. self.uLn = uLn
  235. self.uFillTx = uFillTx
  236. self.uFill = uFill
  237. class TabStop(Serialisable):
  238. pos = Typed(expected_type=Coordinate, allow_none=True)
  239. algn = Typed(expected_type=Set(values=(['l', 'ctr', 'r', 'dec'])))
  240. def __init__(self,
  241. pos=None,
  242. algn=None,
  243. ):
  244. self.pos = pos
  245. self.algn = algn
  246. class TabStopList(Serialisable):
  247. tab = Typed(expected_type=TabStop, allow_none=True)
  248. def __init__(self,
  249. tab=None,
  250. ):
  251. self.tab = tab
  252. class Spacing(Serialisable):
  253. spcPct = NestedInteger(allow_none=True)
  254. spcPts = NestedInteger(allow_none=True)
  255. __elements__ = ('spcPct', 'spcPts')
  256. def __init__(self,
  257. spcPct=None,
  258. spcPts=None,
  259. ):
  260. self.spcPct = spcPct
  261. self.spcPts = spcPts
  262. class AutonumberBullet(Serialisable):
  263. type = Set(values=(['alphaLcParenBoth', 'alphaUcParenBoth',
  264. 'alphaLcParenR', 'alphaUcParenR', 'alphaLcPeriod', 'alphaUcPeriod',
  265. 'arabicParenBoth', 'arabicParenR', 'arabicPeriod', 'arabicPlain',
  266. 'romanLcParenBoth', 'romanUcParenBoth', 'romanLcParenR', 'romanUcParenR',
  267. 'romanLcPeriod', 'romanUcPeriod', 'circleNumDbPlain',
  268. 'circleNumWdBlackPlain', 'circleNumWdWhitePlain', 'arabicDbPeriod',
  269. 'arabicDbPlain', 'ea1ChsPeriod', 'ea1ChsPlain', 'ea1ChtPeriod',
  270. 'ea1ChtPlain', 'ea1JpnChsDbPeriod', 'ea1JpnKorPlain', 'ea1JpnKorPeriod',
  271. 'arabic1Minus', 'arabic2Minus', 'hebrew2Minus', 'thaiAlphaPeriod',
  272. 'thaiAlphaParenR', 'thaiAlphaParenBoth', 'thaiNumPeriod',
  273. 'thaiNumParenR', 'thaiNumParenBoth', 'hindiAlphaPeriod',
  274. 'hindiNumPeriod', 'hindiNumParenR', 'hindiAlpha1Period']))
  275. startAt = Integer()
  276. def __init__(self,
  277. type=None,
  278. startAt=None,
  279. ):
  280. self.type = type
  281. self.startAt = startAt
  282. class ParagraphProperties(Serialisable):
  283. tagname = "pPr"
  284. namespace = DRAWING_NS
  285. marL = Integer(allow_none=True)
  286. marR = Integer(allow_none=True)
  287. lvl = Integer(allow_none=True)
  288. indent = Integer(allow_none=True)
  289. algn = NoneSet(values=(['l', 'ctr', 'r', 'just', 'justLow', 'dist', 'thaiDist']))
  290. defTabSz = Integer(allow_none=True)
  291. rtl = Bool(allow_none=True)
  292. eaLnBrk = Bool(allow_none=True)
  293. fontAlgn = NoneSet(values=(['auto', 't', 'ctr', 'base', 'b']))
  294. latinLnBrk = Bool(allow_none=True)
  295. hangingPunct = Bool(allow_none=True)
  296. # uses element group EG_TextBulletColor
  297. # uses element group EG_TextBulletSize
  298. # uses element group EG_TextBulletTypeface
  299. # uses element group EG_TextBullet
  300. lnSpc = Typed(expected_type=Spacing, allow_none=True)
  301. spcBef = Typed(expected_type=Spacing, allow_none=True)
  302. spcAft = Typed(expected_type=Spacing, allow_none=True)
  303. tabLst = Typed(expected_type=TabStopList, allow_none=True)
  304. defRPr = Typed(expected_type=CharacterProperties, allow_none=True)
  305. extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
  306. buClrTx = EmptyTag()
  307. buClr = Typed(expected_type=Color, allow_none=True)
  308. buSzTx = EmptyTag()
  309. buSzPct = NestedInteger(allow_none=True)
  310. buSzPts = NestedInteger(allow_none=True)
  311. buFontTx = EmptyTag()
  312. buFont = Typed(expected_type=Font, allow_none=True)
  313. buNone = EmptyTag()
  314. buAutoNum = EmptyTag()
  315. buChar = NestedValue(expected_type=unicode, attribute="char", allow_none=True)
  316. buBlip = NestedValue(expected_type=Blip, attribute="blip", allow_none=True)
  317. __elements__ = ('lnSpc', 'spcBef', 'spcAft', 'tabLst', 'defRPr',
  318. 'buClrTx', 'buClr', 'buSzTx', 'buSzPct', 'buSzPts', 'buFontTx', 'buFont',
  319. 'buNone', 'buAutoNum', 'buChar', 'buBlip')
  320. def __init__(self,
  321. marL=None,
  322. marR=None,
  323. lvl=None,
  324. indent=None,
  325. algn=None,
  326. defTabSz=None,
  327. rtl=None,
  328. eaLnBrk=None,
  329. fontAlgn=None,
  330. latinLnBrk=None,
  331. hangingPunct=None,
  332. lnSpc=None,
  333. spcBef=None,
  334. spcAft=None,
  335. tabLst=None,
  336. defRPr=None,
  337. extLst=None,
  338. buClrTx=None,
  339. buClr=None,
  340. buSzTx=None,
  341. buSzPct=None,
  342. buSzPts=None,
  343. buFontTx=None,
  344. buFont=None,
  345. buNone=None,
  346. buAutoNum=None,
  347. buChar=None,
  348. buBlip=None,
  349. ):
  350. self.marL = marL
  351. self.marR = marR
  352. self.lvl = lvl
  353. self.indent = indent
  354. self.algn = algn
  355. self.defTabSz = defTabSz
  356. self.rtl = rtl
  357. self.eaLnBrk = eaLnBrk
  358. self.fontAlgn = fontAlgn
  359. self.latinLnBrk = latinLnBrk
  360. self.hangingPunct = hangingPunct
  361. self.lnSpc = lnSpc
  362. self.spcBef = spcBef
  363. self.spcAft = spcAft
  364. self.tabLst = tabLst
  365. self.defRPr = defRPr
  366. self.buClrTx = buClrTx
  367. self.buClr = buClr
  368. self.buSzTx = buSzTx
  369. self.buSzPct = buSzPct
  370. self.buSzPts = buSzPts
  371. self.buFontTx = buFontTx
  372. self.buFont = buFont
  373. self.buNone = buNone
  374. self.buAutoNum = buAutoNum
  375. self.buChar = buChar
  376. self.buBlip = buBlip
  377. self.defRPr = defRPr
  378. class ListStyle(Serialisable):
  379. tagname = "lstStyle"
  380. namespace = DRAWING_NS
  381. defPPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  382. lvl1pPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  383. lvl2pPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  384. lvl3pPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  385. lvl4pPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  386. lvl5pPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  387. lvl6pPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  388. lvl7pPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  389. lvl8pPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  390. lvl9pPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  391. extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
  392. __elements__ = ("defPPr", "lvl1pPr", "lvl2pPr", "lvl3pPr", "lvl4pPr",
  393. "lvl5pPr", "lvl6pPr", "lvl7pPr", "lvl8pPr", "lvl9pPr")
  394. def __init__(self,
  395. defPPr=None,
  396. lvl1pPr=None,
  397. lvl2pPr=None,
  398. lvl3pPr=None,
  399. lvl4pPr=None,
  400. lvl5pPr=None,
  401. lvl6pPr=None,
  402. lvl7pPr=None,
  403. lvl8pPr=None,
  404. lvl9pPr=None,
  405. extLst=None,
  406. ):
  407. self.defPPr = defPPr
  408. self.lvl1pPr = lvl1pPr
  409. self.lvl2pPr = lvl2pPr
  410. self.lvl3pPr = lvl3pPr
  411. self.lvl4pPr = lvl4pPr
  412. self.lvl5pPr = lvl5pPr
  413. self.lvl6pPr = lvl6pPr
  414. self.lvl7pPr = lvl7pPr
  415. self.lvl8pPr = lvl8pPr
  416. self.lvl9pPr = lvl9pPr
  417. class RegularTextRun(Serialisable):
  418. tagname = "r"
  419. namespace = DRAWING_NS
  420. rPr = Typed(expected_type=CharacterProperties, allow_none=True)
  421. properties = Alias("rPr")
  422. t = NestedText(expected_type=unicode)
  423. value = Alias("t")
  424. __elements__ = ('rPr', 't')
  425. def __init__(self,
  426. rPr=None,
  427. t="",
  428. ):
  429. self.rPr = rPr
  430. self.t = t
  431. class LineBreak(Serialisable):
  432. tagname = "br"
  433. namespace = DRAWING_NS
  434. rPr = Typed(expected_type=CharacterProperties, allow_none=True)
  435. __elements__ = ('rPr',)
  436. def __init__(self,
  437. rPr=None,
  438. ):
  439. self.rPr = rPr
  440. class TextField(Serialisable):
  441. id = String()
  442. type = String(allow_none=True)
  443. rPr = Typed(expected_type=CharacterProperties, allow_none=True)
  444. pPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  445. t = String(allow_none=True)
  446. __elements__ = ('rPr', 'pPr')
  447. def __init__(self,
  448. id=None,
  449. type=None,
  450. rPr=None,
  451. pPr=None,
  452. t=None,
  453. ):
  454. self.id = id
  455. self.type = type
  456. self.rPr = rPr
  457. self.pPr = pPr
  458. self.t = t
  459. class Paragraph(Serialisable):
  460. tagname = "p"
  461. namespace = DRAWING_NS
  462. # uses element group EG_TextRun
  463. pPr = Typed(expected_type=ParagraphProperties, allow_none=True)
  464. properties = Alias("pPr")
  465. endParaRPr = Typed(expected_type=CharacterProperties, allow_none=True)
  466. r = Sequence(expected_type=RegularTextRun)
  467. text = Alias('r')
  468. br = Typed(expected_type=LineBreak, allow_none=True)
  469. fld = Typed(expected_type=TextField, allow_none=True)
  470. __elements__ = ('pPr', 'r', 'br', 'fld', 'endParaRPr')
  471. def __init__(self,
  472. pPr=None,
  473. endParaRPr=None,
  474. r=None,
  475. br=None,
  476. fld=None,
  477. ):
  478. self.pPr = pPr
  479. self.endParaRPr = endParaRPr
  480. if r is None:
  481. r = [RegularTextRun()]
  482. self.r = r
  483. self.br = br
  484. self.fld = fld
  485. class GeomGuide(Serialisable):
  486. name = String(())
  487. fmla = String(())
  488. def __init__(self,
  489. name=None,
  490. fmla=None,
  491. ):
  492. self.name = name
  493. self.fmla = fmla
  494. class GeomGuideList(Serialisable):
  495. gd = Sequence(expected_type=GeomGuide, allow_none=True)
  496. def __init__(self,
  497. gd=None,
  498. ):
  499. self.gd = gd
  500. class PresetTextShape(Serialisable):
  501. prst = Typed(expected_type=Set(values=(
  502. ['textNoShape', 'textPlain','textStop', 'textTriangle', 'textTriangleInverted', 'textChevron',
  503. 'textChevronInverted', 'textRingInside', 'textRingOutside', 'textArchUp',
  504. 'textArchDown', 'textCircle', 'textButton', 'textArchUpPour',
  505. 'textArchDownPour', 'textCirclePour', 'textButtonPour', 'textCurveUp',
  506. 'textCurveDown', 'textCanUp', 'textCanDown', 'textWave1', 'textWave2',
  507. 'textDoubleWave1', 'textWave4', 'textInflate', 'textDeflate',
  508. 'textInflateBottom', 'textDeflateBottom', 'textInflateTop',
  509. 'textDeflateTop', 'textDeflateInflate', 'textDeflateInflateDeflate',
  510. 'textFadeRight', 'textFadeLeft', 'textFadeUp', 'textFadeDown',
  511. 'textSlantUp', 'textSlantDown', 'textCascadeUp', 'textCascadeDown'
  512. ]
  513. )))
  514. avLst = Typed(expected_type=GeomGuideList, allow_none=True)
  515. def __init__(self,
  516. prst=None,
  517. avLst=None,
  518. ):
  519. self.prst = prst
  520. self.avLst = avLst
  521. class TextNormalAutofit(Serialisable):
  522. fontScale = Integer()
  523. lnSpcReduction = Integer()
  524. def __init__(self,
  525. fontScale=None,
  526. lnSpcReduction=None,
  527. ):
  528. self.fontScale = fontScale
  529. self.lnSpcReduction = lnSpcReduction
  530. class RichTextProperties(Serialisable):
  531. tagname = "bodyPr"
  532. namespace = DRAWING_NS
  533. rot = Integer(allow_none=True)
  534. spcFirstLastPara = Bool(allow_none=True)
  535. vertOverflow = NoneSet(values=(['overflow', 'ellipsis', 'clip']))
  536. horzOverflow = NoneSet(values=(['overflow', 'clip']))
  537. vert = NoneSet(values=(['horz', 'vert', 'vert270', 'wordArtVert',
  538. 'eaVert', 'mongolianVert', 'wordArtVertRtl']))
  539. wrap = NoneSet(values=(['none', 'square']))
  540. lIns = Integer(allow_none=True)
  541. tIns = Integer(allow_none=True)
  542. rIns = Integer(allow_none=True)
  543. bIns = Integer(allow_none=True)
  544. numCol = Integer(allow_none=True)
  545. spcCol = Integer(allow_none=True)
  546. rtlCol = Bool(allow_none=True)
  547. fromWordArt = Bool(allow_none=True)
  548. anchor = NoneSet(values=(['t', 'ctr', 'b', 'just', 'dist']))
  549. anchorCtr = Bool(allow_none=True)
  550. forceAA = Bool(allow_none=True)
  551. upright = Bool(allow_none=True)
  552. compatLnSpc = Bool(allow_none=True)
  553. prstTxWarp = Typed(expected_type=PresetTextShape, allow_none=True)
  554. scene3d = Typed(expected_type=Scene3D, allow_none=True)
  555. extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
  556. noAutofit = EmptyTag()
  557. normAutofit = EmptyTag()
  558. spAutoFit = EmptyTag()
  559. flatTx = NestedInteger(attribute="z", allow_none=True)
  560. __elements__ = ('prstTxWarp', 'scene3d', 'noAutofit', 'normAutofit', 'spAutoFit')
  561. def __init__(self,
  562. rot=None,
  563. spcFirstLastPara=None,
  564. vertOverflow=None,
  565. horzOverflow=None,
  566. vert=None,
  567. wrap=None,
  568. lIns=None,
  569. tIns=None,
  570. rIns=None,
  571. bIns=None,
  572. numCol=None,
  573. spcCol=None,
  574. rtlCol=None,
  575. fromWordArt=None,
  576. anchor=None,
  577. anchorCtr=None,
  578. forceAA=None,
  579. upright=None,
  580. compatLnSpc=None,
  581. prstTxWarp=None,
  582. scene3d=None,
  583. extLst=None,
  584. noAutofit=None,
  585. normAutofit=None,
  586. spAutoFit=None,
  587. flatTx=None,
  588. ):
  589. self.rot = rot
  590. self.spcFirstLastPara = spcFirstLastPara
  591. self.vertOverflow = vertOverflow
  592. self.horzOverflow = horzOverflow
  593. self.vert = vert
  594. self.wrap = wrap
  595. self.lIns = lIns
  596. self.tIns = tIns
  597. self.rIns = rIns
  598. self.bIns = bIns
  599. self.numCol = numCol
  600. self.spcCol = spcCol
  601. self.rtlCol = rtlCol
  602. self.fromWordArt = fromWordArt
  603. self.anchor = anchor
  604. self.anchorCtr = anchorCtr
  605. self.forceAA = forceAA
  606. self.upright = upright
  607. self.compatLnSpc = compatLnSpc
  608. self.prstTxWarp = prstTxWarp
  609. self.scene3d = scene3d
  610. self.noAutofit = noAutofit
  611. self.normAutofit = normAutofit
  612. self.spAutoFit = spAutoFit
  613. self.flatTx = flatTx