Patrick Rein uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-pre.238.mcz==================== Summary ====================
Name: MorphicExtras-pre.238
Author: pre
Time: 8 June 2018, 4:37:55.016586 pm
UUID: ccc1c75c-1a68-a84c-a44b-2f5f0b6c3dbc
Ancestors: MorphicExtras-kfr.237
Adds convenience methods for exporting a morph as postscript according to the schema used for png export
=============== Diff against MorphicExtras-kfr.237 ===============
Item was changed:
+ ----- Method: EPSCanvasTest>>testSmokeTest (in category 'tests') -----
- ----- Method: EPSCanvasTest>>testSmokeTest (in category 'as yet unclassified') -----
testSmokeTest
+
+ | epsCode |
+ epsCode := (RectangleMorph new asEPS).
- | epsCode |
- epsCode := (RectangleMorph new asEPS).
+ self assert: epsCode lines first = '%!!PS-Adobe-2.0 EPSF-2.0'.
+ self assert: (epsCode lines detect: [:line |
+ line beginsWith: '%start morph: a RectangleMorph'] ifNone: [nil]) notNil.
+ self assert: epsCode lines last = '%%EOF'
- self assert: epsCode lines first = '%!!PS-Adobe-2.0 EPSF-2.0'.
-
- self assert: (epsCode lines detect: [:line | line beginsWith: '%start morph: a RectangleMorph'] ifNone: [nil]) notNil.
-
- self assert: epsCode lines last = '%%EOF'
!
Item was added:
+ ----- Method: Morph>>exportAsEPS (in category '*MorphicExtras-postscript') -----
+ exportAsEPS
+
+ | fName |
+ fName := UIManager default saveFilenameRequest:'Please enter the name' translated initialAnswer: self externalName,'.eps'.
+ fName ifNil:[^self].
+ self exportAsEPSNamed: fName
+ !
Item was added:
+ ----- Method: Morph>>exportAsEPSNamed: (in category '*MorphicExtras-postscript') -----
+ exportAsEPSNamed: aString
+
+ FileStream fileNamed: aString do: [:stream |
+ stream nextPutAll: self asEPS]
+ !