Class new title: Paragraph subclassof: Array fields: 'text runs alignment' declare: ''  t1 [text  t1] alignment [alignment] alignment_ t1 [alignment _ t1] allBold [self maskrunsunder: 1 to: 1] allFont: t1 [[t1 is: String  [t1 _ (self textStyle fontnames find: t1) - 1]]. self maskrunsunder: 240 to: t1 * 16] allItalic [self maskrunsunder: 2 to: 2] asParagraph asStream [text asStream] asVector [text asVector] bravoRuns: t1 | t2 t3 t4 t5 t6 t7 t8 [t1 append: [alignment = 1  ['j\g'] alignment = 2  ['c\g'] '\g']. [runs  nil  [] t4 _ 0. t3 _ 256. t8 _ (1 2 4 ). for t2 to: runs length by: 2 do [t6 _ runs  (t2 + 1). t5 _ t3 lxor: t6. (t5 land: 247) = 0  [t4 _ t4 + (runs  t2)] [t2 = 1  [] t4 printon: t1]. for t7 to: 3 do [(t5 land: t8  t7) = 0  [] t1 next_ [(t6 land: t8  t7)  0  ['biu'] 'BIU']  t7]. [(t5 land: 240)  0  [t1 append: 'f'. t1 print: (t6 lshift: 4). t1 space]]. t3 _ t6. t4 _ runs  t2]]. t1 cr] center [alignment _ 2] copy [self class new text: text runs: runs alignment: alignment] copy: t1 to: t2 [self class new text: (text copy: t1 to: t2) runs: (self run: t1 to: t2) alignment: alignment] findString: t1 startingAt: t2 [text findString: t1 startingAt: t2] flushleft [alignment _ 0] flushright [alignment _ 4] hideData: t1 | t2 [t2 _ Stream new of: (String new: 150). t2 next_ t1. [t1 = 0  [t2 nextword_ text length] t2 nextString_ text]. t2 nextString_ [runs  nil  [nullString] runs]. t2 next_ alignment. t2 contents] justify [alignment _ 1] length [text length] makeBoldPattern | t1 t2 t3 [t1 _ text asStream. t2 _ 0. while [t3 _ t1 next. [t3  [t3 = 91 or (t3 = 124 or (t3 = 34 or (t3 = 25 or false)))] true]  false] do [t2 _ t2 + 1]. self maskrun: 1 to: t2 under: 1 to: 1] makerun: t1 val: t2 | t3 t4 [t1 = 0  [nullString] t3 _ String new: t1 - 1 / 255 + 1 * 2. for t4 to: t3 length by: 2 do [t3  t4 _ [t1 > 255  [255] t1]. t3  t4 + 1 _ t2. t1 _ t1 - 255]. t3] maskrun: t1 to: t2 under: t3 to: t4 | t5 t6 [t5 _ self run: t1 to: t2. for t6 from: 2 to: t5 length by: 2 do [t5  t6 _ (t5  t6 land: 255 - t3) + t4]. runs _ self runcat: (self run: 1 to: t1 - 1) and: t5 and: (self run: t2 + 1 to: text length)] maskrunsunder: t1 to: t2 [self maskrun: 1 to: text length under: t1 to: t2] pressCode [99] readFrom: t1 [text _ t1 nextString. runs _ t1 nextString. alignment _ t1 next. runs empty  [runs _ nil]] replace: t1 to: t2 by: t3 [[runs  nil  [] runs _ self runcat: (self run: 1 to: t1 - 1) and: [t3 is: self class  [t3 runs] self makerun: t3 length val: [runs empty  [0] runs  ((self runfind: t2)  1 + 1)]] and: (self run: t2 + 1 to: text length)]. text _ text replace: t1 to: t2 by: [t3 is: self class  [t3 text] t3]] run: t1 to: t2 | t3 [t1 > t2  [nullString] runs  nil  [self makerun: 1 + t2 - t1 val: 0] t1 _ self runfind: t1. t2 _ self runfind: t2. t3 _ runs copy: t1  1 to: t2  1 + 1. [t1  1 = (t2  1)  [t3  1 _ 1 + (t2  2) - (t1  2)] t3  1 _ 1 + (runs  (t1  1)) - (t1  2). t3  t3 length - 1 _ t2  2]. t3] runAndVal: t1 | t2 t3 [runs  nil  [text length - t1 + 1 , 0] t2 _ 1. while [t3 _ t1 - (runs  t2). t3 > 0] do [t1 _ t3. t2 _ t2 + 2]. runs  t2 - t1 + 1 , (runs  (t2 + 1))] runcat: t1 and: t2 and: t3 | t4 t5 t6 t7 t8 t9 t10 [t10 _ Stream new of: (String new: 30). t8 _ false. for t4 to: 3 do [t5 _ [t4 = 1  [t1] t4 = 2  [t2] t3]. t5 length = 0  [] t5 _ t5 asStream. while [t7 _ t5 next. t7] do [t9 _ t5 next. t7 = 0  [] t8 = t9  [t6 _ t6 + t7. t6  255  [] t10 next_ 255. t10 next_ t8. t6 _ t6 - 255] [t8  [t10 next_ t6. t10 next_ t8]]. t6 _ t7. t8 _ t9]]. [t8  [t10 next_ t6. t10 next_ t8]]. t10 contents] runcat: t1 to: t2 [self runcat: t1 and: t2 and: ''] runfind: t1 | t2 t3 [t2 _ 1. while [t3 _ t1 - (runs  t2). t3 > 0] do [t1 _ t3. t2 _ t2 + 2]. t2 , t1] runs [runs  nil  [self makerun: text length val: 0] runs] storeOn: t1 [t1 nextString_ text. [runs  nil  [t1 next_ 0] t1 nextString_ runs]. t1 next_ alignment] subst: t1 for: t2 [text subst: t1 for: t2] text [text] text: t1 [text _ t1. alignment _ 0] text: t1 alignment: t2 [text _ t1. alignment _ t2] text: t1 runs: t2 alignment: t3 [text _ t1. runs _ t2. alignment _ t3] textStyle [DefaultTextStyle]