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

help needed from graphics GURUS ?

 [1/14] from: jjmmes:yah:oo:es at: 30-Aug-2002 20:33


How can I build a tool to design cool text-based logos ? I've used GIMP and it does the job but wouldn't rebol excel at this, even more than GIMP ? What font types are available to load and manipulate ? Can anybody point to some examples ? Thanks

 [2/14] from: carl:cybercraft at: 31-Aug-2002 13:14


On 31-Aug-02, jose wrote:
> How can I build a tool to design cool text-based logos > ? > I've used GIMP and it does the job but wouldn't rebol > excel at this, even more than GIMP ? > What font types are available to load and manipulate ?
The default fonts, 'font-fixed, 'font-serif and 'font-sans-serif are just words referencing a string containing the font name and you can change them to any suitable font you like that's on your system (AFAIK). To use another font in a style, just give the style's font/name the title of the font you want to use. ie... view layout [t: text "hello" font [name: "Times"]] Look at a style's font object to see what you can change with regard to fonts. For the above we get...
>> probe t/font
make object! [ name: "Times" style: none size: 12 color: 0.0.0 offset: 2x2 space: 0x0 align: 'left valign: 'top shadow: none colors: [0.0.0 255.180.55] ] The problem though is REBOL doesn't come with a font-requester, so making a cross-platform app that gives access to all of a user's fonts would be tricky... So, a question for the others here testing the beta View: Does it come with a font-requester? If not, let's make a cross-platform one. Afterall, it seems all we need is a block of strings containing the names of all the fonts on a user's system. If we've got that, we can make a font-requester, right? So, let's say at startup View looks for a file called %font-names, which contains such a block. If it doesn't find it, it runs an os-specific script to grab the names of the fonts on the system and saves them as a block to %font-names. So, next time the font-names would be there and you wouldn't have to go through the permission-to-access-directory requests. Couple that with an "update-fonts" button on the font-requester (which could be cross-platform, it using the os-specific name-grabing script for the updating), and you should have an adequate means of accessing fonts. Anyone see any problems with this? For instance, is there any OS where the font-names couldn't be accessed with a REBOL script? Just a thought, and not worth pursuing if a font-requester will be in the next View...
> Can anybody point to some examples ? > Thanks
-- Carl Read

 [3/14] from: gscottjones:mchsi at: 31-Aug-2002 7:43


From: "Carl Read"
<snip> > The problem though is REBOL doesn't come
<<quoted lines omitted: 3>>
> So, a question for the others here testing the beta > View: Does it come with a font-requester?
Hi, Carl, Just downloaded the /View beta, and I can't find one. Maybe I don't know exactly what to look for. I typed in "? fon" to see what words had "fon" in them, and got the same list as current /View. I *assume* that a font requester would have this fragment in it somewhere (call me silly).
> If not, let's make a cross-platform one. Afterall, it > seems all we need is a block of strings containing the > names of all the fonts on a user's system. If we've got > that, we can make a font-requester, right?
I may not be properly understanding what you have written here, so I apologize in advance if I have misunderstood, or if I end up showing my ignorance yet again! Getting the names of the font families on the system requires access to a system resource, right? Of course, /Pro or /Command would allow one to set up such a call, but I assume you mean truly cross platform, including the regular /View (aka /View/Too-Broke-Or-Cheap-To-Pay-For-Pro-Or Possibly-Have-A-Philosophical-Beef-Against-Paying-Or-Dont-Need-Pro-Features- But-Gee-It-Would-Be-Nice-On-Occasion). Here is where I am unsure what you mean. (Or maybe I am just "hamstrung" from being a predominantly Windows user!?) I could envision a "master list" of font names, and that /View could in theory cull through the list to find what is available. However, (and again ignorance warning in effect,) it appears as though /View "gracefully" falls back to a default font, if a font is not actually available. So a system would on first bluch appear to "support" all the fonts, but in fact would just be using default fall-backs if the actual font is not available. Maybe there is a way to detect this event. Maybe you or another /View guru would know this. Outside of calling on a system resource, the only other way I can think of to find what fonts are available on a specific machine is to use a (gulp) non-REBOL utility to create the list for REBOL. Am I way off base on this? Please someone save me from myself.
> So, let's say at startup View looks for a file called > %font-names, which contains such a block. If it > doesn't find it, it runs an os-specific script to grab > the names of the fonts on the system and saves them > as a block to %font-names.
So, (somewhat redundantly) is this "os-specific" script a REBOL script or more of a non-REBOL utility? I really like your idea. I was toying with "how-to" get at this info a few weeks ago, and it wasn't obvious. I am more than willing to be further educated about this topic. Rest of Carl's message: http://www.escribe.com/internet/rebol/m25079.html Thanks for the great suggestion, Carl. I think this project would further enhance REBOL's appeal. --Scott Jones

 [4/14] from: carl:cybercraft at: 1-Sep-2002 3:18


On 01-Sep-02, G. Scott Jones wrote:
> Outside of calling on a system resource, the only other way I can > think of to find what fonts are available on a specific machine is > to use a (gulp) non-REBOL utility to create the list for REBOL. Am I > way off base on this? Please someone save me from myself.
That's why I asked if there was any reason this wouldn't work on specific OSs. On Amiga you'd just have the os-specific REBOL script look in the fonts directory and grab the names from the file-names. Font-files all over the place in Windows by any chance? Anyway, I might have a go at writing this for myself as soon as I've got some other stuff finished. It's a pretty simple concept so shouldn't be too difficult. -- Carl Read

 [5/14] from: gscottjones:mchsi at: 31-Aug-2002 10:47


> On 01-Sep-02, G. Scott Jones wrote: > > Outside of calling on a system resource, the only
<<quoted lines omitted: 3>>
> > Am I way off base on this? Please someone save > > me from myself.
From: "Carl Read"
> That's why I asked if there was any reason this wouldn't work on > specific OSs. On Amiga you'd just have the os-specific REBOL script > look in the fonts directory and grab the names from the file-names. > Font-files all over the place in Windows by any chance?
Doh! Ok. I guess I got overly focused on *one* way to get the font names. *Obviously* I am not a font expert. At least on Win98, many fonts are simply located in C:\WINDOWS\FONTS. Maybe there are other locations for some programs. So two platforms would offer simple solutions. Thanks for saving me from myself. --Scott Jones

 [6/14] from: greggirwin::mindspring::com at: 31-Aug-2002 12:48


Carl, Scott, et al << Font-files all over the place in Windows by any chance? >> Fonts need to be installed under Windows. Not knowing how REBOL uses them, maybe finding the files is enough. If not, you'll need to use EnumFontFamilies and EnumFonts, both of which use callback functions that you can't do with REBOL at the present time (AFAIK). --Gregg

 [7/14] from: carl:cybercraft at: 1-Sep-2002 12:52


On 01-Sep-02, Gregg Irwin wrote:
> Carl, Scott, et al > << Font-files all over the place in Windows by any chance? >> > Fonts need to be installed under Windows. Not knowing how REBOL uses > them, maybe finding the files is enough.
Just suck it and see... view layout [ text "Hello" font [name: "name-of-a-font-on-your-system"] ]
> If not, you'll need to use > EnumFontFamilies and EnumFonts, both of which use callback functions > that you can't do with REBOL at the present time (AFAIK). > --Gregg
-- Carl Read

 [8/14] from: gscottjones:mchsi at: 31-Aug-2002 22:06


> On 01-Sep-02, Gregg Irwin wrote: > > Fonts need to be installed under Windows. Not knowing how REBOL uses > > them, maybe finding the files is enough.
From: "Carl Read"
> Just suck it and see... > > view layout [ > text "Hello" font [name: "name-of-a-font-on-your-system"] > ]
Hi, Folks, OK, I sucked, and saw .... disappointment. When I peeked at the \windows\fonts directory earlier, I had forgotten that the folder view was one of Windows fancy folders. Directory reading under DOS looks more traditional, which means font-names for the files are frequently truncated. To verify, I quickly hacked the following. Looking like either need a mapping table or GDI access ... or ... someone needs to save me from myself. Again! :-( --Scott Jones font-files: read %//windows/fonts/. font-blk: copy [] foreach font font-files [append font-blk first parse/all font "."] lo-blk: copy [] foreach font font-blk [ append lo-blk copy [text "hello" font ] append/only lo-blk append copy [name: ] copy font ] while [not tail? lo-blk] [ lo-blk: skip lo-blk 60 insert lo-blk 'return lo-blk: next lo-blk ] lo-blk: head lo-blk lo: layout lo-blk view lo

 [9/14] from: g:santilli:tiscalinet:it at: 1-Sep-2002 12:22


Hi Scott, On Sunday, September 1, 2002, 5:06:36 AM, you wrote: GSJ> mapping table or GDI access ... or ... someone needs to save me from myself. GSJ> Again! Maybe we could just look into the TTF file to extract its real name. (Are TTF specs available?) Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [10/14] from: gscottjones:mchsi at: 1-Sep-2002 5:57


Hi, Gabriele, From: "Gabriele Santilli"
> Maybe we could just look into the TTF file to > extract its real name.
Last night I looked at the raw binary on a couple of fonts. The name is in there, but I wasn't readily able to identify a constant location nor a bracketing pair of words or symbols that would make parsing easy. (It wasn't obvious *to me*, at least.)
>(Are TTF specs available?)
If they are, then perhaps it would be possible to parse out the names. Good idea! Thanks for the feedback. And BTW to Carl and Gregg: I forgot to mention, that it appears as though one can use *any* installed font as long as one uses the "proper" font name. This is ***good news***. (Warning: I only tried a few.) --Scott Jones

 [11/14] from: greggirwin:mindspring at: 1-Sep-2002 9:54


<< OK, I sucked, and saw .... disappointment. When I peeked at the \windows\fonts directory earlier, I had forgotten that the folder view was one of Windows fancy folders. >> I think Explorer, in order to display the font names as if they were the actual file names, parses the files (takes a long time to display that folder for me). The filenames are not standard LFN truncations, but actual short file names that someone limited to 8 chars by design, probably so they're the same on every system, which wouldn't be guaranteed otherwise. So, even if we assume that the font is installed correctly if the file is there, it's not going to be terribly easy. We can't use the API, so it might mean parsing the TTF files for the names. I don't think they're stored in the registry. --Gregg

 [12/14] from: greggirwin:mindspring at: 1-Sep-2002 10:09


<< Last night I looked at the raw binary on a couple of fonts. The name is in there, but I wasn't readily able to identify a constant location nor a bracketing pair of words or symbols that would make parsing easy. (It wasn't obvious *to me*, at least.) >> The format is available (wotsit has a link to it), but I don't think it will be a 5 minute job. There is a table directory you would use to find the name table, then get the name out of that. Also, everything is big-endian. I've done this kind of thing a bit, and since it might actually work cross platform (anywhere TTF fonts are used), I'd be willing to spend a little time on it if people feel there is a lot of vale to be had from it. I.e. I'll tackle the TTF parsing bit if others want to handle the requestor, file finder, list-builder parts. --Gregg

 [13/14] from: g:santilli:tiscalinet:it at: 1-Sep-2002 19:30


Hi Gregg, On Sunday, September 1, 2002, 6:09:39 PM, you wrote: GI> platform (anywhere TTF fonts are used), I'd be willing to spend a little GI> time on it if people feel there is a lot of vale to be had from it. I.e. Well Gregg, if you get to parsing TTFs, there is a little possibility that we might add TTF font support to PDF Maker. (I say little because I don't think I'll have enough free time...) Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [14/14] from: carl:cybercraft at: 2-Sep-2002 20:03


On 02-Sep-02, Gregg Irwin wrote:
> << Last night I looked at the raw binary on a couple of fonts. The > name is in
<<quoted lines omitted: 10>>
> parsing bit if others want to handle the requestor, file finder, > list-builder parts.
I'd have a go at the requester, unless someone beats me to it. (: I doubt I'd get on to it until next weekend though. Anyway, some thoughts on what refinements request-font should have... /title title-line -- change default request title. /font font-name -- default font-name or block of font-names to show as selected. /style font-style -- allow user to select a font-style. /size font-size -- allow user to select a font-size. /color font-color -- allow user to select a font's color. /shadow font-shadow -- allow user to select a shadow-size. /multi -- allow user to select more than one font. /keep -- keep previous settings. /all -- allow user selection of all of the font values - size, color etc. Given a font object can also have offset, space, align, valign and colors values, are there any of those that should also be selectable in the font requester? And should shadow be in there? And would it be possible to restrict selection to only fixed or proportional fonts? That'd require the os-dependant routine to get more than just the name of the font. Short of having REBOL measure the width of every character in every font! (: -- Carl Read

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted