Skip to content

Commit

Permalink
Remove references to TextFontFamilyAndSize
Browse files Browse the repository at this point in the history
  • Loading branch information
bpieber committed Sep 13, 2023
1 parent cd12c69 commit c1d67b5
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 93 deletions.
40 changes: 20 additions & 20 deletions RTFImporting.pck.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'From Cuis 5.0 [latest update: #4219] on 12 June 2020 at 11:48:38 am'!
'From Cuis 6.0 [latest update: #6025] on 12 September 2023 at 5:08:08 pm'!
'Description Please enter a description for this package.'!
!provides: 'RTFImporting' 1 6!
!provides: 'RTFImporting' 1 7!
!requires: 'ExtendedClipboard' 1 nil nil!
!requires: 'Graphics-Files-Additional' 1 nil nil!
SystemOrganization addCategory: #RTFimporting!
Expand Down Expand Up @@ -285,14 +285,6 @@ newline is a Mac-hack. No newlines are expected in a RTF, but Mac makes escaped
Not a real Unicode implementation. Just compatibility for Sophie-RTF. Answers instances of Character (i.e. ISO-8859-15).
Based on http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-15.TXT!

!RTFFontInfo methodsFor: 'accessing' stamp: 'tat 5/3/2006 02:21'!
name
^name! !

!RTFStylesheet methodsFor: 'accessing' stamp: 'tat 5/5/2006 14:49'!
name
^name! !

!RTFChunkScanner methodsFor: 'private' stamp: 'mir 8/14/2006 16:25'!
addScannedString
| scannedString |
Expand Down Expand Up @@ -472,6 +464,10 @@ family
family: f
family := f! !

!RTFFontInfo methodsFor: 'accessing' stamp: 'tat 5/3/2006 02:21'!
name
^name! !

!RTFFontInfo methodsFor: 'accessing' stamp: 'tat 5/3/2006 02:21'!
name: fn
name := fn! !
Expand Down Expand Up @@ -1514,6 +1510,10 @@ basedon
basedon: bo
basedon := bo! !

!RTFStylesheet methodsFor: 'accessing' stamp: 'tat 5/5/2006 14:49'!
name
^name! !

!RTFStylesheet methodsFor: 'accessing' stamp: 'tat 5/5/2006 14:49'!
name: n
name := n! !
Expand Down Expand Up @@ -1570,20 +1570,20 @@ resetStyle: builder
addToText: aString
self addToText: aString specialAttributes: nil! !

!RTFTextBuilder methodsFor: 'private' stamp: 'jmv 4/11/2011 21:58'!
!RTFTextBuilder methodsFor: 'private' stamp: 'bp 9/12/2023 17:06:45'!
addToText: aString specialAttributes: nonFormattingAttributesOrNil
"nonFormattingAttributesOrNil should only contains attributes that answer false to #isForFormatting"
| attributes emphasis |

attributes _ Array streamContents: [ :strm |
attributes := Array streamContents: [ :strm |
fontFamilyName ifNotNil: [
fontPointSize ifNotNil: [
strm nextPut: (TextFontFamilyAndSize
familyName: fontFamilyName pointSize: fontPointSize) ]].
emphasis _ 0.
bold ifTrue: [ emphasis _ emphasis + 1 ].
italic ifTrue: [ emphasis _ emphasis + 2 ].
underline ifTrue: [ emphasis _ emphasis + 4 ].
strm nextPut: (TextFontFamily familyName: fontFamilyName) ].
fontPointSize ifNotNil: [
strm nextPut: (TextFontSize pointSize: fontPointSize) ].
emphasis := 0.
bold ifTrue: [ emphasis := emphasis + 1 ].
italic ifTrue: [ emphasis := emphasis + 2 ].
underline ifTrue: [ emphasis := emphasis + 4 ].
emphasis > 0 ifTrue: [
strm nextPut: (TextEmphasis new emphasisCode: emphasis) ].
currentFgColor ifNotNil: [
Expand Down Expand Up @@ -1674,7 +1674,7 @@ convertAndSkip: string

!RTFTextBuilder methodsFor: 'building-characters' stamp: 'jmv 9/5/2016 20:30:31'!
buildAddBullet
self addUnicodeContents: (RTFUnicode codePoint: 16r2022 or: $°) asString! !
self addUnicodeContents: (RTFUnicode codePoint: 16r2022 or: $°) asString! !

!RTFTextBuilder methodsFor: 'building-characters' stamp: 'jmv 9/5/2016 20:30:34'!
buildAddDoubleLeftQuote
Expand Down
34 changes: 17 additions & 17 deletions RTFTests.pck.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'From Cuis 5.0 [latest update: #4219] on 12 June 2020 at 11:47:03 am'!
'From Cuis 6.0 [latest update: #6025] on 12 September 2023 at 5:08:13 pm'!
'Description Please enter a description for this package.'!
!provides: 'RTFTests' 1 4!
!provides: 'RTFTests' 1 5!
!requires: 'RTFExporting' 1 nil nil!
!requires: 'RTFImporting' 1 nil nil!
SystemOrganization addCategory: #RTFtests!
Expand Down Expand Up @@ -645,7 +645,7 @@ textSample2
(Text string: 'This text has no tyle set', String newLineString),
(Text string: 'This is right', String newLineString attribute: TextAlignment rightFlush)! !

!RTFConversionTest class methodsFor: 'text samples' stamp: 'jmv 6/11/2020 16:34:31'!
!RTFConversionTest class methodsFor: 'text samples' stamp: 'bp 9/12/2023 17:04:00'!
textSample3
"
| text |
Expand All @@ -654,18 +654,18 @@ textSample3
Clipboard default storeObject: text
"
| familyName |
familyName _ FontFamily defaultFamilyName.
familyName := FontFamily defaultFamilyName.
^ (
(Text string: 'normal '),
(Text string: 'bold ' attributes: {(TextFontFamilyAndSize familyName: familyName pointSize: 17). TextEmphasis bold}),
(Text string: 'italic ' attributes: {(TextFontFamilyAndSize familyName: familyName pointSize: 6). TextEmphasis italic}),
(Text string: 'boldGreen ' attributes: {(TextFontFamilyAndSize familyName: familyName pointSize: 12). TextEmphasis bold. TextColor green}),
(Text string: 'bold ' attributes: {(TextFontFamily familyName: familyName). (TextFontSize pointSize: 17). TextEmphasis bold}),
(Text string: 'italic ' attributes: {(TextFontFamily familyName: familyName). (TextFontSize pointSize: 6). TextEmphasis italic}),
(Text string: 'boldGreen ' attributes: {(TextFontFamily familyName: familyName). (TextFontSize pointSize: 12). TextEmphasis bold. TextColor green}),
(Text string: 'red ' attributes: {TextColor red}),
(Text string: 'underlined ' attribute: (TextEmphasis underlined)),
(Text string: 'normal ' attributes: #())
)! !

!RTFConversionTest class methodsFor: 'text samples' stamp: 'jmv 6/11/2020 16:35:02'!
!RTFConversionTest class methodsFor: 'text samples' stamp: 'bp 9/12/2023 17:05:10'!
textSample4
"
| text |
Expand All @@ -674,14 +674,14 @@ textSample4
Clipboard default storeObject: text
"
| familyName |
familyName _ FontFamily defaultFamilyName.
familyName := FontFamily defaultFamilyName.
^ (
(Text string: 'normal '),
(Text string: 'bold ' attributes: { (TextFontFamilyAndSize familyName: familyName pointSize: 17). TextEmphasis bold }),
(Text string: 'italic ' attributes: { (TextFontFamilyAndSize familyName: familyName pointSize: 6). TextEmphasis italic }),
(Text string: 'boldGreen ' attributes: { (TextFontFamilyAndSize familyName: familyName pointSize: 12). TextEmphasis bold. TextColor green }),
(Text string: 'boldGreen ' attributes: { (TextFontFamilyAndSize familyName: familyName pointSize: 12). TextEmphasis bold. TextColor green }),
(Text string: 'boldGreen ' attributes: { (TextFontFamilyAndSize familyName: familyName pointSize: 12). TextEmphasis bold. TextColor green }),
(Text string: 'bold ' attributes: { (TextFontFamily familyName: familyName). (TextFontSize pointSize: 17). TextEmphasis bold }),
(Text string: 'italic ' attributes: { (TextFontFamily familyName: familyName). (TextFontSize pointSize: 6). TextEmphasis italic }),
(Text string: 'boldGreen ' attributes: { (TextFontFamily familyName: familyName). (TextFontSize pointSize: 12). TextEmphasis bold. TextColor green }),
(Text string: 'boldGreen ' attributes: { (TextFontFamily familyName: familyName). (TextFontSize pointSize: 12). TextEmphasis bold. TextColor green }),
(Text string: 'boldGreen ' attributes: { (TextFontFamily familyName: familyName). (TextFontSize pointSize: 12). TextEmphasis bold. TextColor green }),
(Text string: 'red ' attributes: {TextColor red}),
(Text string: 'underlined ' attribute: (TextEmphasis underlined)),
(Text string: 'struckThrough ' attribute: (TextEmphasis struckThrough)),
Expand All @@ -706,9 +706,9 @@ textSample6
text edit.
Clipboard default storeObject: text
"
^'Tomá agüita, ñandú. Ñandú.
½´®¥¨øå߃©Ý²Þ¬­ç¦µ.
¼´®Á¨ØÅÍÎÏ©ÓÔÞҭǦÐÂ' asText! !
^'Tomá agüita, ñandú. Ñandú.
œŽ®¥šøå߃©ݲެ­禵.
ŒŽ®hØÅÍÎϩÓÔÞҭǦÐÂ' asText! !

!RTFTokenTest methodsFor: 'as yet unclassified' stamp: 'MR 5/24/2006 12:10'!
testCreateBlockClose
Expand Down

0 comments on commit c1d67b5

Please sign in to comment.