Global Font settings
[1/11] from: ptretter:charter at: 20-Feb-2004 20:15
I was looking thru anamonitor trying to find where to change the font globally. I would assume this is something trivial. I tried setting the font on vid-face but no luck. Any ideas? I know I can use 'with to set the font but want the same font by default on all rendered faces. Paul Tretter
[2/11] from: ammon:addept:ws at: 20-Feb-2004 19:41
Try something like... Stylize/master [ text: text with [ font: make font [;desired settings go here ] ] ] before you LAYOUT the faces... HTH ~~Ammon ;~> ----- Original Message ----- From: "Paul Tretter" <[ptretter--charter--net]> To: <[rebol-list--rebol--com]> Sent: Friday, February 20, 2004 7:15 PM Subject: [REBOL] Global Font settings
> I was looking thru anamonitor trying to find where to change the font
globally. I would assume this is something trivial. I tried setting the font on vid-face but no luck. Any ideas? I know I can use 'with to set the font but want the same font by default on all rendered faces.
[3/11] from: ptretter:charter at: 20-Feb-2004 21:08
That doesn't seem to work globally. I tried the following:
>> Stylize/master [
[ text: text with [ [ font: make font [name: "Verdana"] [ [ ] [ ] == [face make object! [ type: 'face offset: 0x0 size: none span: none pane: none ...
>> view layout [backdrop forest a: banner "Superfonttest"] >> a/font/name
Maybe, I'm assuming to much to think there is something more global in this case. Paul
[4/11] from: ammon:addept:ws at: 20-Feb-2004 20:50
Ah, you want to the font that is used... Well, I don't believe that there is a built in way to do that, but this should do what you are looking for... foreach [style face] rebol/view/vid/vid-styles [ face/font: make face/font [name: "Verdana"] ] note though that it isn't going to change the font used in any faces that have already been passed through LAYOUT... HTH ~~Ammon ;~>
[5/11] from: ptretter:charter at: 20-Feb-2004 22:10
Thats interesting - since the 1.3 project is underway, do you think we need a global settings type of system for /view? Where we can change the default font, spacing, origin, etc...? Paul Tretter
[6/11] from: ammon:addept:ws at: 20-Feb-2004 21:53
The question is how do you decide what is default and what is not? Almost every face that is intended to display text has a different font object! And the problem with the code I gave you is that it is going to change the font object for every style. Just which facets of the font object would you say need to be changed across all styles and would everyone agree with you? Just a few thoughts I had on it... Enjoy!! ~~Ammon ;~> ps. You could change the code there a bit... foreach [style face] rebol/view/vid/vid-styles [ face/font/name: "Verdana" ] and get the same result...
[7/11] from: ptretter:charter at: 20-Feb-2004 23:21
Actually great comments. I just think that we need to start with a certain canvas and need to be able to define what the canvas should look like and make our rebellious brushstrokes later as we want to. So wouldn't it be nice to have an addition to system/standard/face that defines some of these settings? Seems it could help alot to set the global effects of face rendering in /view. I'm not sure what cause system/standard/face actually has at this time. Does anyone know why its in system standard? I'm not saying we decide what is default for everyone - what I'm saying is that we are able to change what is decided as default for everyone. These global adustments could be very beneficial and I think they should be included into some version of /view or at least an easy way of setting their values. Paul Tretter
[8/11] from: ammon:addept:ws at: 21-Feb-2004 0:25
I think that the best way to do something like this may be to set it in the user prefs file that would enable you to define the basic settings that the styleset is built on. Another option would be to be able to regenerate the styleset on the fly which would mean having the styleset in its native, un-STYLIZEd form. If you just want to apply global settings to ALL styles then the code I already gave you is really simple to understand and easy to use... The colors (on some styles) are controlled by statements within the INIT Block which grabs the colors from rebol/view/vid/vid-colors. Perhaps font should have a similar feature? In fact, I am sure that it should and really this is something that anyone could create. I think I will mention it on the View world... Enjoy!! ~~Ammon ;~>
[9/11] from: ptretter:charter at: 21-Feb-2004 9:29
How do I get on the View world? I didn't actually know there was a /View world. lol. Paul Tretter
[10/11] from: carl::cybercraft::co::nz at: 21-Feb-2004 22:00
On 21-Feb-04, Paul Tretter wrote:
> I was looking thru anamonitor trying to find where to change the > font globally. I would assume this is something trivial. I tried > setting the font on vid-face but no luck. Any ideas? I know I can > use 'with to set the font but want the same font by default on all > rendered faces.
I've only skimmed the thread on this so I'm not sure what your problem is, but there are some global font settings, plus a set-font function...
>> ? font
Found these words: font-fixed (string) font-sans-serif (string) font-serif (string) set-font (function)
>> >> ? set-font
USAGE: SET-FONT aface 'word val DESCRIPTION: (undocumented) ARGUMENTS: aface -- (Type: any) word -- (Type: any) val -- (Type: any) Maybe the source of set-font would give you some pointers...
>> ?? set-font
set-font: func [aface 'word val][ if none? aface/font [aface/font: vid-face/font] if not flag-face? aface font [aface/font: make aface/font  flag-face aface font] either word = 'style [ if none? aface/font/style [aface/font/style: copy ] if word? aface/font/style [aface/font/style: reduce [aface/font/style]] aface/font/style: union aface/font/style reduce [val] ] [set in aface/font word val] ] -- Carl Read
[11/11] from: ptretter:charter at: 21-Feb-2004 15:42
Yeah I was looking for a way to set the font default for all faces. Ammon came up with a solution. But we were discussing it further even on the REBOL-VIEW world as to if it would be a good idea or not to include default settings that could cover a default font and more... Paul Tretter