Monday, May 10, 2010

Shaping up the REBOL fonts

As mentioned before, the default font in the REBOL gui didn't make wanna cheer out loud. Lucky me, there was an answer to that problem also.
Find the file "user.r" - this file contain all your user defined settings and will survive upgrades. (rebol.r won't - don't use it for your homebrewed stuff )
In windows7 I managed to find it in "C:\Users\elwis\AppData\Roaming\rebol", open it up and add these lines at the end of it:

set-default-font: func [
"sets default font for /View"
font-blk [block! word!] "block of font attributes"
][
system/standard/face/font: make system/standard/face/font font-blk
system/view/vid/vid-face/font: make system/view/vid/vid-face/font font-blk
foreach [w s] system/view/vid/vid-styles [s/font: make s/font font-blk]
]

Watch that linebreaks will you.
Now you can add the following to all your REBOL scripts and watch the joy of nice looking fonts.
set-default-font
[
name: "tahoma"
style: none
size: 12
color: 0.0.0
offset: 2x2
space: 0x0
align: 'center
valign: 'center
shadow: none
]
For example, this simple little script will now create a much nicer gui.
Rebol [
Title: "Set variable"
]
set-default-font
[
name: "tahoma"
style: none
size: 12
color: 0.0.0
offset: 2x2
space: 0x0
align: 'center
valign: 'center
shadow: none
]
view layout [
f1: field
btn 100x25 "Display Variable" [

t: f1/text

f2/text: t
show f2
]
f2: field
]

Over and out fellow developers


No comments:

Post a Comment