text.py 22 KB

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