Not many people know this.
Ben Rubinstein
benr_mc at cogapp.com
Thu Aug 16 15:49:06 EDT 2018
Sorry, did somebody just give me an excuse to indulge in nostalgia?
On 16/08/2018 18:48, Richard Gaskin via use-livecode wrote:
> AFAIK all xTalks have supported styled text. It may be that HC 1.0 only
> provided that for the whole field (I can't recall),
It was definitely the case that HC 1.0 only supported one style per field; and
I know this is so because when the Design Museum opened in London in 1989, it
featured an interactive guide to its permanent collection on half-a-dozen Mac SEs.
We made the collection guide in HyperCard, and it featured hyperlinks which we
wanted to be in bold:
https://www.dropbox.com/s/rj6zuxo1u5l2bfn/DM01_tudyCollRichSapper.jpg
There was a simple CMS mode for editing the text and defining links; when the
user saved changes, it invoked a layout mode which wrapped the text around an
image (i.e. we had two fields and split the text between them) and also made
the links. But there was no facility for bold text; and none of the functions
which can now be used to figure out where on the card a character in a field
has been drawn existed then.
The solution we adopted, which could _possibly_ be described as overkill, was
to use an XCMD we'd already made which could grab a screenshot and store it in
the stack as an icon resource; and add a new one which could compare two
icons. So when the code wanted to make a word bold, it made its best guess as
to where the word that was to be linked would be on the card; took a
screenshot centered on that position; then created a small field with the word
(that would also act as a button for the link); and placed it at that
location. Then it could take another screenshot and compare it to the base one
without the link field: if the location was just right, the two would be the
same, and it just needed to nudge the field one pixel to the right to make it
a bold hyperlink. If the two were different, it moved the field in a spiral
around the point, one pixel at a time, and taking another screenshot each
step, until it finally found the correct spot. If after moving the field some
hundreds of times it was unable to locate the perfect point, it played a sound
sample "Please help by moving the word" and made the field track the mouse
until the user clicked to indicate it was just right.
It is arguable whether the time spent creating this solution to make the
layout process nearly automatic was actually less than the time saved by not
requiring a more manual process. But I felt it was a triumph all the same!
I'm going to ask Nurse to bring my nightcap now.
Ben
More information about the use-livecode
mailing list