Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Squeak 5.3 proposal for morphs in text
Last updated at 7:15 pm UTC on 24 June 2019
http://forum.world.st/Proposal-Morphs-in-Text-td5099760.html

patrick.rein
Selected post May 28, 2019; 6:18pm
Proposal: Morphs in Text
patrick.rein

Please find attached a change set which includes:
1.) Some fixes to the Scanner infrastructure to support Morphs in Text better
2.) Improvements to describe how a Morph should be aligned with regard to the text. Relevant methods on Morph are:
 #textAnchorVerticalAlignment:
 #textAnchorPadding:
 #textAnchorConsumesHorizontalSpace: 

More discussion
http://forum.world.st/Proposal-Morphs-in-Text-tp5099760p5099761.html


I did not think about the concept of a morph having a baseline too but it sounds like a good idea. I'll try to accomodate it in the new alignment logic.

Given that we interpret the textAnchorType as the floating behavior, we would end up with:
  1. inline: Inline the text flow
  2. paragraph: The morph is displayed on its own line (_Not_ the semantic of having a morph within a chain of TextMorphs)
  3. document: The morph can be placed freely within the document and is neither influenenced by the text flow, nor does it influence the text flow

If that sounds about right I would go on to implement the behavior like that, as it currently does not really work like that. In the course of that it might make sense to rename textAnchorType so something else.

Based on Subbus comment I will also move the new properties and methods on morphs into a class TextAnchorProperties which will then be referenced by a morph. This should actually make the morph interface smaller than it is right now.

Bests
Patrick

Latest proposal http://forum.world.st/Proposal-Morphs-in-Text-tp5099760p5100562.html