Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Multiline text in face?

From: g:santilli:tiscalinet:it at: 19-Sep-2002 11:07

Hi Robert, On Thursday, September 19, 2002, 9:18:08 AM, you wrote:
>> ;do a throw away 'layout inorder to get a >> ;default text face using 'as-is >> layout [ >> t: text as-is mytext >> ]
RMM> :-) That's smart! I'm going to try it, thanks! Robert Actually, you don't need to do that, unless you want to take benefit from what LAYOUT does without having to do it by yourself. Since you are asking to avoid what the TEXT style does (i.e. TRIM/LINES on your text), and you already have your faces built, using layout is just overkill. As I said earlier, you just need to set the TEXT facet to your text, as in: face/text: "Multiline^/text" View does *not* remove that newline by default. Is the TEXT style that does when used in VID without using AS-IS.
>> t: get-style 'text >> print mold t/init
[ if all [not flag-face? self as-is string? text] [trim/lines text] if none? text [text: copy ""] change font/colors font/color if :action [feel: svvf/hot saved-area: true] data: size if any [none? size size/x < 0 size/y < 0] [ state: max 1x1 pane-size * 9 / 10 - offset - para/margin if none? size [size: state] if size/x < 0 [size/x: state/x] if size/y < 0 [size/y: state/y] size: size-text self all [ para para/origin size: size + para/origin para/margin size: size + para/margin ] ] if all [data data/y < 0] [size/x: data/x] data: none ] Notice the first line: if all [not flag-face? self as-is string? text] [trim/lines text] HTH, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: