513 and return string or text object containing those characters. |
513 and return string or text object containing those characters. |
514 If either the receiver or the argument contains emphasis information, |
514 If either the receiver or the argument contains emphasis information, |
515 a text object will be returned. Otherwise, a string (i.e. without emphasis) |
515 a text object will be returned. Otherwise, a string (i.e. without emphasis) |
516 is returned." |
516 is returned." |
517 |
517 |
518 (aStringOrText hasChangeOfEmphasis |
518 aStringOrText hasChangeOfEmphasis ifTrue:[ |
519 or:[self hasChangeOfEmphasis]) ifTrue:[ |
|
520 ^ self species new |
519 ^ self species new |
521 string:(string , aStringOrText) |
520 string:(string , aStringOrText) |
522 emphasisCollection:(runs , aStringOrText emphasisCollection) |
521 emphasisCollection:(runs , aStringOrText emphasisCollection) |
|
522 ]. |
|
523 runs notNil "self hasChangeOfEmphasis" ifTrue:[ |
|
524 ^ self species new |
|
525 string:(string , aStringOrText) |
|
526 emphasisCollection:(runs copy add:nil withOccurrences:(aStringOrText size); yourself) |
523 ]. |
527 ]. |
524 ^ string , aStringOrText string |
528 ^ string , aStringOrText string |
525 |
529 |
526 " |
530 " |
527 ('hello' asText allBold) , ' world' |
531 ('hello' asText allBold) , ' world' |
528 'hello' , (' world' asText allBold) |
532 'hello' , (' world' asText allBold) |
529 'hello' , ' world' |
533 'hello' , ' world' |
530 ('hello' asText allBold) , (' world' asText allBold) |
534 ('hello' asText allBold) , (' world' asText allBold) |
531 " |
535 " |
532 |
536 |
533 "Modified: 16.5.1996 / 11:17:40 / cg" |
537 "Modified: 11.7.1996 / 13:22:39 / cg" |
534 ! |
538 ! |
535 |
539 |
536 concatenateFromString:aString |
540 concatenateFromString:aString |
537 "return the concatenation of aString and myself. |
541 "return the concatenation of aString and myself. |
538 This may be a Text (if I have emphasis) or a string (if not)." |
542 This may be a Text (if I have emphasis) or a string (if not)." |