Setting default font for all View sessions
[1/4] from: brian:wisti:g:mail at: 27-Dec-2006 12:58
Hi,
I'm suffering through REBOL/View 1.3.2.4.2 on CentOS 4 (a clone of
Redhat enterprise with all the non-free bits taken out), and trying to
figure out a workaround with the known font issues. Unfortunately,
this is a work machine, so switching to a better distribution is not
an option.
View can apparently find 'font-fixed on this machine. Explicitly
setting font to [ name: font-fixed ] works on a widget-by-widget
basis. It's not ideal, but at least I get _something_ when I run a
View script.
Still, I would like to avoid that approach if possible. Scripts like
this get a little cumbersome:
rebol []
view layout [
vh1 "Yo!" with [ font: [ name: font-fixed ] ]
text "Enter your name: " with [ font: [ name: font-fixed ] ]
field with [ font: [ name: font-fixed ] ]
button "Hi!" with [ font: [ name: font-fixed ] ]
]
Is there a way I can make view always go for font-fixed, either in my
script or user.r? Alternately, has anybody else stuck on Redhat-style
Linux distros figured out a good workaround for the font issue?
Apologies if this has already been hashed out. I couldn't find
anything with a casual search through Google, Rambo, or the mailing
list archive.
Kind Regards,
Brian Wisti
http://coolnamehere.com/
[2/4] from: brian:wisti:gma:il at: 27-Dec-2006 13:33
On 12/27/06, Brian Wisti <brian.wisti-gmail.com> wrote:
> Hi,
>
> I'm suffering through REBOL/View 1.3.2.4.2 on CentOS 4 (a clone of
> Redhat enterprise with all the non-free bits taken out), and trying to
> figure out a workaround with the known font issues. Unfortunately,
> this is a work machine, so switching to a better distribution is not
> an option.
>
Following up to myself here for a second. The only default fonts it
can't find are "Helvetica" and "Times". So maybe I just need to know
how I can set font-sans-serif to "Verdana" and font-serif to
Georgia
.
Here's my test code, using the list at the mailing list post
http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-message.r?m=rmlNKCJ
as a guide:
view layout [
text "Courier" font-name "Courier"
text "Times" font-name "Times"
text "Helvetica" font-name "Helvetica"
text "Arial" font-name "Arial"
text "Verdana" font-name "Verdana"
text "Georgia" font-name "Georgia"
]
Times
and "Helvetica" are the only lines that come up blank.
Kind Regards,
Brian Wisti
http://coolnamehere.com/
[3/4] from: anton::wilddsl::net::au at: 29-Dec-2006 3:16
Hi Brian,
>> ? "font-"
Found these words:
font-fixed string! "courier new"
font-sans-serif string! "arial"
font-serif string! "times"
layout [
vh1 "Yo!" font-name font-fixed
style text text font-name font-fixed
text "Enter your name: "
]
OR
foreach [style obj] svv/vid-styles [
if all [
obj/font
obj/font/name <> font-fixed
][
print [style obj/font/name]
obj/font/name: font-fixed
]
]
face/font/name: font-fixed
As I recall, Cyphre made a function which does similar to the above.
Regards,
Anton.
[4/4] from: brian:wisti::gmail at: 28-Dec-2006 10:06
Hi Anton,
On 12/28/06, Anton Rolls <anton-wilddsl.net.au> wrote:
> Hi Brian,
> >> ? "font-"
<<quoted lines omitted: 18>>
> ]
> face/font/name: font-fixed
That's just what I needed, thanks. I expanded a little, since I now
know that I have more fonts than just font-fixed to work with. It even
works when I just put it in my user.r file. So for future Redhat
sufferers, here's the relevant portion of my user.r:
if (not none? system/view) [
; ...
;; Fix fonts on Redhat/CentOS Linux
; Replace with whatever serif and sans-serif fonts View can find.
font-serif: "Georgia"
font-sans-serif: "Arial"
foreach [style obj] svv/vid-styles [
if obj/font [
print obj/font/name
switch obj/font/name [
"helvetica" [ obj/font/name: font-sans-serif ]
"times" [ obj/font/name: font-serif ]
]
]
]
]
And here's an expanded version of my font demo layout
view layout [
text "Courier" font-name "Courier"
text "Times" font-name "Times"
text "Helvetica" font-name "Helvetica"
text "Arial" font-name "Arial"
text "Verdana" font-name "Verdana"
text "Georgia" font-name "Georgia"
text "font-fixed" font-name font-fixed
text "font-serif" font-name font-serif
text "font-sans-serif" font-name font-sans-serif
text "Default"
button "Quit" [ quit ]
]
I'm content now. Everything would be perfect if I could get
anti-aliased fonts in View, though.
Thanks for the assist!
Kind Regards,
Brian Wisti
http://coolnamehere.com/
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted