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

Multiple Fonts in area

 [1/26] from: blemeri:noos at: 21-Oct-2002 16:25


Hi, I would like to know if it is possible to use different fonts in a single area. Could anyone help me ? Thx. Bruno.

 [2/26] from: greggirwin:mindspring at: 21-Oct-2002 10:27


Hi Bruno, << I would like to know if it is possible to use different fonts in a single area. Could anyone help me ? >> It's not possible. (assuming you mean an AREA style, you can create an "area of display" with multiple faces to do it, but it's not like having an RTF editor or something.) --Gregg

 [3/26] from: blemeri:noos at: 21-Nov-2002 20:24


> << I would like to know if it is possible to use different fonts in > a single area. Could anyone help me ? >> > It's not possible. (assuming you mean an AREA style, you can create an
area
> of display
with multiple faces to do it, but it's not like having an RTF
> editor or something.) > --Gregg
Hi Gregg, Ok. I understand the best solution would be to write a new "rich" text format style improving the basic AREA style: It seems to be a real project... Thx. Bruno.

 [4/26] from: rebol-list2:seznam:cz at: 21-Oct-2002 21:42


Hello Bruno, Thursday, November 21, 2002, 9:24:57 PM, you wrote:
>> << I would like to know if it is possible to use different fonts in >> a single area. Could anyone help me ? >> >> It's not possible. (assuming you mean an AREA style, you can create an
BL> "area
>> of display" with multiple faces to do it, but it's not like having an RTF >> editor or something.) >> --Gregg
BL> Hi Gregg, BL> Ok. I understand the best solution would be to write a new "rich" text BL> format style improving BL> the basic AREA style: It seems to be a real project... BL> Thx. BL> Bruno. Good luck... it would be VERY appriciated, but unfortunately it's more project for RT, because it should be done in native way I think.

 [5/26] from: louisaturk:coxinet at: 23-Oct-2002 5:16


Hi Gregg and everyone, I have a question similar to Bruno's (below). I want to print to screen (and later to paper) a line of Greek text with a line of English text under it, but in the same View area, like this: This is a line of Greek text. This is a line of English text. This is a second line of Greek text. This is a second line of English text. and so on. Gregg seems to say it isn't possible, but in some cases might be. Is this one of the cases where it might be? Louis At 08:24 PM 11/21/2002 +0100, you wrote:

 [6/26] from: greggirwin:mindspring at: 23-Oct-2002 11:51


Hi Louis, << I want to print to screen (and later to paper) a line of Greek text with a line of English text under it, but in the same View area, like this: This is a line of Greek text. This is a line of English text. This is a second line of Greek text. This is a second line of English text.
>>
You can't use a different font, but that doesn't mean you can't use a different language. :) What would limit you, in using a single AREA face, is any special characters you need for Greek that might only be available in a particular font. That said, often what you see in applications is not what it appears. For instance, MS Excel (V3 I think) was a complex spreadsheet with lots of UI widgetry, cells, buttons, and what-not. In actuality, there were only three windows (in the window handle sense) in use. Everything was as illusion, managed by complex code. So, do you really need to use a single AREA face, or can you use multiple FIELD faces, with no borders or space between them, or some other "trick", to simulate it and work around its limitations? --Gregg

 [7/26] from: g:santilli:tiscalinet:it at: 23-Oct-2002 20:48


Hi Gregg, On Wednesday, October 23, 2002, 7:51:41 PM, you wrote: GI> managed by complex code. So, do you really need to use a single AREA face, GI> or can you use multiple FIELD faces, with no borders or space between them, GI> or some other "trick", to simulate it and work around its limitations? Doesn't the draw dialect allow to use any number of fonts? Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [8/26] from: greggirwin:mindspring at: 23-Oct-2002 13:35


Hi Gabriele, GI> managed by complex code. So, do you really need to use a single AREA face, GI> or can you use multiple FIELD faces, with no borders or space between them, GI> or some other "trick", to simulate it and work around its limitations? GS> Doesn't the draw dialect allow to use any number of fonts? Yes, that would fall under the "other trick" category. :) It would also allow you to change fonts within a line, rather than being limited to one font per line. --Gregg

 [9/26] from: louisaturk:coxinet at: 23-Oct-2002 17:32


At 11:51 AM 10/23/2002 -0600, you wrote:
>do you really need to use a single AREA face, >or can you use multiple FIELD faces, with no borders or space between them, >or some other "trick", to simulate it and work around its limitations? > >--Gregg
I thought about this, but that would still leave me with the problem of printing paper, would it not. I'm in a little over my head here, but learning fast. Louis

 [10/26] from: greggirwin:mindspring at: 24-Oct-2002 0:17


GI> do you really need to use a single AREA face, GI> or can you use multiple FIELD faces, with no borders or space between them, GI> or some other "trick", to simulate it and work around its limitations? LT> I thought about this, but that would still leave me with the problem of LT> printing paper, would it not. I'm in a little over my head here, but LT> learning fast. Yes it would. Printing is not REBOL's strong suit; cross platform support being an issue. I think RT will eventually deliver a good solution, but it isn't here yet. --Gregg

 [11/26] from: al:bri:xtra at: 24-Oct-2002 20:04


> LT> I thought about this, but that would still leave me with the problem
of
> LT> printing paper, would it not. I'm in a little over my head here, but > LT> learning fast. > > Yes it would. Printing is not REBOL's strong suit; cross platform support > being an issue. I think RT will eventually deliver a good solution, but it > isn't here yet.
Generating HTML and then browsing it (Rebol/View's 'browse) is one reasonable solution. I agree, a printing solution would be really great for Rebol. It's something that I need as well. Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [12/26] from: atruter:hih:au at: 24-Oct-2002 17:29


> a printing solution would be really great for Rebol. It's something that
I need as well. I'll second that! Even the ability to do something like: write/printer printer-name to-image layout [size system/printer/size ...] Where we had to create images to "fit" the target device would be an improvement. Regards, Ashley

 [13/26] from: rotenca:telvia:it at: 24-Oct-2002 12:49


> GI> managed by complex code. So, do you really need to use a single AREA
face,
> GI> or can you use multiple FIELD faces, with no borders or space between
them,
> GI> or some other "trick", to simulate it and work around its limitations? > > Doesn't the draw dialect allow to use any number of fonts?
But it is almost unuseful because we can't know what is the size of the result. Or do you know how to know it? --- Ciao Romano

 [14/26] from: jason:cunliffe:verizon at: 24-Oct-2002 5:11


> Generating HTML and then browsing it (Rebol/View's 'browse) is one > reasonable solution. I agree, a printing solution would be really great for > Rebol. It's something that I need as well.
Until Rebol has its own robust solution, Flash is also a good tool for printing. Oldes' %make-swf.r allows considerable Rebol interface to this already :-) http://oldes.multimedia.cz/swf/ Players for Mac, Windows, Linux [and some other platforms with restricted features] http://www.macromedia.com/support/flash/downloads.html http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=Shockw aveFlash http://www.macromedia.com/shockwave/download/alternates/ http://www.macromedia.com/support/flash/ts/documents/flashplayer_beta.htm Can be used within a Web Browser, or as standalone executable which bundles the flash player and allows many more features via 3rd party extension products: http://www.wildform.com/tutorials/cd/#3 http://www.northcode.com/studio/index.html http://www.flashnpack.com/ http://www.flashants.com/ Unlike PDF, no Adobe splash screen to go through, plus better control of which graphic area/page will print. http://www.macromedia.com/support/flash/action_scripts/actions/print.html# http://www.macromedia.com/support/flash/action_scripts/actions/printasbitmap.htm l In Flash fonts can be completely embedded so no system font dependency. Excellent visual scalability, speed and interactivity. Flash also handles Unicode. http://www.macromedia.com/support/flash/ts/documents/unicode.htm http://www.macromedia.com/support/flash/languages/unicode_in_flmx/ http://www.oddhammer.com/unicode/tutorial.htm ./Jason

 [15/26] from: g:santilli:tiscalinet:it at: 24-Oct-2002 14:34


Hi Romano, On Thursday, October 24, 2002, 12:49:51 PM, you wrote: RPT> Or do you know how to know it? You need to SIZE-TEXT on a different face with the same font and text. (Not that is is elegant, but it is possible; Ciphre was even close to a rich text editor...) Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [16/26] from: rotenca:telvia:it at: 24-Oct-2002 17:26


Hi Gabriele
> RPT> Or do you know how to know it? > > You need to SIZE-TEXT on a different face with the same font and > text. (Not that is is elegant, but it is possible;
I know it, but what sense? You draw it twice and the first only to calculate the length? Is it not better to draw only once with the method which permit to calculate the length? The only reason i can see for your method is to not waste memory, but time. --- Ciao Romano

 [17/26] from: greggirwin:mindspring at: 24-Oct-2002 10:32


<< You draw it twice and the first only to calculate the length? Is it not better to draw only once with the method which permit to calculate the length? The only reason i can see for your method is to not waste memory, but time.
>>
That's basically how Windows works though. If you want to draw text, and you need to know how large it's going to be, you call something like GetTextExtent, DrawText/DT_CALCRECT, or one of the more modern APIs that are more exacting. Those function take a Device Context handle as a parameter, which is kind of what we're missing in REBOL, though I'm not sure what the best solution is. If you want to do things like a print preview feature, that approach can be nice because one set of drawing commands can work for both screen and printer. Complexity is a big downside though. I think RT can come up with something better. A big difference, performance wise, might be whether the text is actually rendered, or if you can do it in a hidden face and avoid that overhead. --Gregg

 [18/26] from: louisaturk:coxinet at: 24-Oct-2002 11:32


Thanks, Jason, I'll check this out. Louis At 05:11 AM 10/24/2002 -0400, you wrote:

 [19/26] from: g:santilli:tiscalinet:it at: 24-Oct-2002 19:02


Hi Romano, On Thursday, October 24, 2002, 5:26:07 PM, you wrote: RPT> You draw it twice and the first only to calculate the length? You don't need to draw a face to be able to use SIZE-TEXT on it. RPT> Is it not better to draw only once with the method which permit to calculate RPT> the length? If there was one such method... Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [20/26] from: rotenca:telvia:it at: 24-Oct-2002 19:43


Hi Gabriele
> You don't need to draw a face to be able to use SIZE-TEXT on it.
You do not need to DISPLAY a face...
> RPT> Is it not better to draw only once with the method which permit to
calculate
> RPT> the length? > > If there was one such method...
Using standard face not draw effect. But perhaps too many faces in a window slows down the view engine so that using draw can be more fast. At the end, i think we have 2 inefficient ways to do the thing. Rebol is lacking something on this area. --- Ciao Romano

 [21/26] from: rotenca:telvia:it at: 24-Oct-2002 20:33


Hi Gabriele, Gregg
> You don't need to draw a face to be able to use SIZE-TEXT on it.
To be more clear: i think that size-text draws the text also if it does not display it.
> RPT> Is it not better to draw only once with the method which permit to
calculate
> RPT> the length? > > If there was one such method...
Yes there is not this method, but what i was asking is: why i must use draw, if i must use a face to make all the calc? If i make the calculation with a face, is it not a more direct solution to use the face? For what reason i must use a face for calc and draw to display? What advantages draw gives to the code? --- Ciao Romano

 [22/26] from: nitsch-lists:netcologne at: 24-Oct-2002 20:42


Am Donnerstag, 24. Oktober 2002 19:43 schrieb Romano Paolo Tenca:
> Hi Gabriele > > You don't need to draw a face to be able to use SIZE-TEXT on it.
<<quoted lines omitted: 9>>
> At the end, i think we have 2 inefficient ways to do the thing. Rebol is > lacking something on this area.
not benchmarked, but size-text should be pretty fast. there is a native os-function to do only size-calculation. it needs text, font and some args. i think /view takes the arguments from the face and calls it. so instead of size-text face/text face/font/name face/font/size .... one simply can call [size-text face]
> --- > Ciao > Romano
greetings Volker

 [23/26] from: g:santilli:tiscalinet:it at: 24-Oct-2002 21:44


Hi Romano, On Thursday, October 24, 2002, 8:33:25 PM, you wrote: RPT> For what reason i must use a face for calc and draw to display? What RPT> advantages draw gives to the code? I think we should do some benchmarks, to find out what is really faster/slower, uses more/less memory etc. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [24/26] from: gschwarz:netconnect:au at: 25-Oct-2002 9:33


Andrew, I have made program to printing HTML with REBOL. I use a small program (running in the back ground) that looks for HTML files in a shared folder, if any HTML files are found, then they are sent to the printer using IE6 rendering. After the file is printed, the file is then deleted from the folder. The first Rebol program to test this out was a Fax cover sheet printing program. From the time you press print button on the Rebol program to the printer starting is very quick (less than 1/2 second). Using IE6 rendering is fast and has some page break features which I use to print multi page booklets (24 page double sided A5 booklet). Version two of the program for printing HTML files will be done in a few months time. :-( to much work in other projects. Regards, Greg

 [25/26] from: louisaturk:coxinet at: 24-Oct-2002 20:41


Hi Greg, Would you mind sharing your code? Louis At 09:33 AM 10/25/2002 +1000, you wrote:

 [26/26] from: gschwarz:netconnect:au at: 25-Oct-2002 12:09


Louis, The printing program is written in VB for version 1. Will be rewitting it in C for size of the exe reasons (I like small size programs). This version will be avalable to the public as version 1 does not have error trapping. The main use of the printing program for me is the ablity to use Rebol in accounting software. The printing of invoices and statments can be made in HTML format and sent to the printing folder by the Rebol accounting software to be printed. Regards, Greg

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