[REBOL] Re: Multiline text in face?
From: gscottjones:mchsi at: 18-Sep-2002 9:30
> > On Behalf Of Petr Krenzelok
> > view layout [text as-is "this is a^/multiline^/text"]
From: "Robert M. Muench"
> Hi, well OK. How do I specify this for my face:
>
> test-face: make face [
> size: 200x20
> ]
>
> mytext: "Hi^/Rebol"
>
> make test-face compose [
> text: as-is (mytext)
> ]
Hi, Robert,
As was mentioned after this post of yours, 'as-is is a VID word.
Although it does not really make a difference in what you are trying to
achieve, there were two other errors in your code. The first is that the
code is putting mytext as the title line for the main window, not as a text
face *within* the window. The second was more than likely a typo in your
final make in that text was used as a set-word instead of a VID word.
My guess is that you are looking to make custom faces, instead of just VID,
and are trying to figure out how to get the 'as-is effect of multi-line
printing. I suspect that there is a way to do this purely in View (without
VID), but I suspect that you will be re-inventing the wheel to some extent.
A quick way to get the effect and still use largely custom faces can be done
as follows:
;give a little more room in main window
test-face: make face [
size: 200x200
]
mytext: "Hi^/Rebol"
;do a throw away 'layout inorder to get a
;default text face using 'as-is
layout [
t: text as-is mytext
]
;paste only the default text face to the main window pane
test-face/pane: copy to-block t
;check the result
view/offset test-face 100x100
Assuming I have correctly guessed your intention, I hope that this helps.
--Scott Jones