🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
6 messages
6 total messages Started by Andy Gray Fri, 11 Sep 1992 16:07
PSsetfont
#958
Author: Andy Gray
Date: Fri, 11 Sep 1992 16:07
25 lines
805 bytes
Having a slight problem with PSsetfont and I can't find the answer on my system,
can anyone help?

The raw PostScript required is

	/Times-Roman findfont 12 scalefont setfont

I can wrap this as

	defineps tm12()
		/Times-Roman findfont 12 scalefont setfont
	endps

but would like to code it inline as

	PSfindfont("Times-Roman");
	PSscalefont(12.0);
	PSsetfont(???);

The last line is the one that causes me grief. I'm supposed to send it a
reference, any clues?

Thanks

Andy Gray
Re: PSsetfont
#994
Author: Ingo Feulner
Date: Sat, 12 Sep 1992 08:08
41 lines
1577 bytes
In article <1992Sep11.160744.2376@axion.bt.co.uk> agray@axion.bt.co.uk (Andy  
Gray) writes:
> Having a slight problem with PSsetfont and I can't find the answer on my  
system,
> can anyone help?
> 
> The raw PostScript required is
> 
> 	/Times-Roman findfont 12 scalefont setfont
> 
> I can wrap this as
> 
> 	defineps tm12()
> 		/Times-Roman findfont 12 scalefont setfont
> 	endps
> 
> but would like to code it inline as
> 
> 	PSfindfont("Times-Roman");
> 	PSscalefont(12.0);
> 	PSsetfont(???);
> 
> The last line is the one that causes me grief. I'm supposed to send it a
> reference, any clues?

What about
	myFont = [Font newFont:"Helvetica-Bold" size:18.0 style:0 
			      matrix:NX_FLIPPEDMATRIX];

and then
	[myFont set];
	PSmoveto(x, y);
	PSshow("urgl");
?

Greetings, Ingo.
-- 
Ingo Feulner - Wolfacher Weg 22 - 7030 Boeblingen - alf@xenon.stgt.sub.org
                                  ---
  "Scheisse." - "Was?" - "Ne Streife." - "Nein." - "Doch." - "Scheisse."
                            (Blues Brothers)
Re: PSsetfont
#992
Author: Simson L. Garfinkel
Date: Sat, 12 Sep 1992 22:48
50 lines
1576 bytes
Don't use the PS wraps for fonts; use the Font class.  It's  much faster.

	id	aFont = [Font newFont:"Times-Roman" size:12.0];

	[aFont set];
	PSmoveto(323,321)
	PSshow("foobar");

to change the size, use:

	aFont = [Font newFont:[aFont name] size:aNewSize];


In article <1992Sep11.160744.2376@axion.bt.co.uk> agray@axion.bt.co.uk (Andy  
Gray) writes:
> Having a slight problem with PSsetfont and I can't find the answer on my  
system,
> can anyone help?
> 
> The raw PostScript required is
> 
> 	/Times-Roman findfont 12 scalefont setfont
> 
> I can wrap this as
> 
> 	defineps tm12()
> 		/Times-Roman findfont 12 scalefont setfont
> 	endps
> 
> but would like to code it inline as
> 
> 	PSfindfont("Times-Roman");
> 	PSscalefont(12.0);
> 	PSsetfont(???);
> 
> The last line is the one that causes me grief. I'm supposed to send it a
> reference, any clues?
> 
> Thanks
> 
> Andy Gray


--

................................................................simson

-- 

................................................................simson
Re: PSsetfont
#1008
Author: Matthew Dillon
Date: Sun, 13 Sep 1992 17:42
23 lines
1082 bytes
In article <1992Sep12.224836.17946@next.cambridge.ma.us> simsong@next.cambridge.ma.us (Simson L. Garfinkel) writes:
>Don't use the PS wraps for fonts; use the Font class.  It's  much faster.
>
>	id	aFont = [Font newFont:"Times-Roman" size:12.0];
>
>	[aFont set];
>	PSmoveto(323,321)
>	PSshow("foobar");
>
>to change the size, use:
>
>	aFont = [Font newFont:[aFont name] size:aNewSize];

    Don't you want to free the old aFont ?

					-Matt

--

    Matthew Dillon		dillon@Overload.Berkeley.CA.US
    1005 Apollo Way		uunet.uu.net!overload!dillon
    Incline Village, NV. 89451	ham: KC6LVW (no mail drop)
    USA 			Sandel-Avery Engineering (702)831-8000
Re: PSsetfont
#1012
Author: Robert D. Nicholson
Date: Mon, 14 Sep 1992 09:48
20 lines
1134 bytes
dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:

>In article <1992Sep12.224836.17946@next.cambridge.ma.us> simsong@next.cambridge.ma.us (Simson L. Garfinkel) writes:
>>Don't use the PS wraps for fonts; use the Font class.  It's  much faster.
>>
>>	id	aFont = [Font newFont:"Times-Roman" size:12.0];
>>
>>	[aFont set];
>>	PSmoveto(323,321)
>>	PSshow("foobar");
>>
>>to change the size, use:
>>
>>	aFont = [Font newFont:[aFont name] size:aNewSize];

>    Don't you want to free the old aFont ?

A quick look at Font.rft cleared this up.

"Thus, Font objects shouldn't be freed; Font's free method simply returns self"
Re: PSsetfont
#1046
Author: moose
Date: Mon, 14 Sep 1992 18:00
41 lines
1818 bytes
In article <1992Sep11.160744.2376@axion.bt.co.uk> agray@axion.bt.co.uk (Andy  
Gray) writes:
> Having a slight problem with PSsetfont and I can't find the answer on my  
system,
> can anyone help?

I'm going to assume you know about the Font object but don't want to use it for  
some reason.  Otherwise, ignore the rest.

> but would like to code it inline as
> 
> 	PSfindfont("Times-Roman");
> 	PSscalefont(12.0);
> 	PSsetfont(???);

I would recommend using PSselectfont instead as it is less postscript to send  
to the Window Server.

> 
> The last line is the one that causes me grief. I'm supposed to send it a
> reference, any clues?

After quickly going through the disassembly, we see that if we pass in 8, the  
following postscript is emitted

8 execuserobject setfont

If 9 is passed in

9 execuserobject setfont

is emitted.  So, I would say that you pass in the user object that your font  
is.  Since neither PSfindfont, nor PSscalefont create the user object, you  
probably have to do that manually.  Overall, quite a painful process when you  
can use either PSselectfont, or just make your own wrap.

--
Michael Rutman			|	moose@svcdudes.com
Cubist				|	makes me a NeXT programmer
Software Ventures		|	maker of MicroPhone Pro
#include <std.disclaimer>	|	really offensive political statement
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads