Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto populating text fields. Text insert question. 2

Status
Not open for further replies.

stevef22

Technical User
Sep 20, 2005
83
US
Hello and good day to everyone, glad to be a part of this forum! I am going to stick around this site, GREAT INFORMATION!

My question is how do I insert text faster? I am bulding a plaque. Booooring yes I know but necessary. Anyone know how to set up "pre-determined" text fields that populate from an internal or external text? Right now I have to >duplicate layer>drag layer to new spot>enter in new text. It would be really neat if PS could populate from a file like web-site populate pages from other text files. If anyone knows a faster way to enter in this text then your are the PS GURU. Thanks again.
Steve
attachment.php
 
No, postscript is not a windoze thing.
I think you need to realise that the world existed before Bill Gates and Microsoft and many Microsoft tools and features have been borrowed from other places over the years.
Did you download Knoppix as I suggested?
BTW: If the panels are off the top, lower the $v starting value and try again.


Trojan.
 
I have found a page that lists some fonts used in Postscript.
I'm not sure whether these are the normal defaults that are available or whether some of these are extras but it might be worth a look.
AR
AvantGarde-Book
AI
AvantGarde-BookOblique
AB
AvantGarde-Demi
ABI
AvantGarde-DemiOblique
BMR
Bookman-Light
BMI
Bookman-LightItalic
BMB
Bookman-Demi
BMBI
Bookman-DemiItalic
CR
Courier
CI
Courier-Oblique
CB
Courier-Bold
CBI
Courier-BoldOblique
HR
Helvetica
HI
Helvetica-Oblique
HB
Helvetica-Bold
HBI
Helvetica-BoldOblique
HNR
Helvetica-Narrow
HNI
Helvetica-Narrow-Oblique
HNB
Helvetica-Narrow-Bold
HNBI
Helvetica-Narrow-BoldOblique
NR
NewCenturySchlbk-Roman
NI
NewCenturySchlbk-Italic
NB
NewCenturySchlbk-Bold
NBI
NewCenturySchlbk-BoldItalic
PR
Palatino-Roman
PI
Palatino-Italic
PB
Palatino-Bold
PBI
Palatino-BoldItalic
TR
Times-Roman
TI
Times-Italic
TB
Times-Bold
TBI
Times-BoldItalic
With respect to the perl we have created, the font name is the first part only since it adds the "-Bold" extentions.
Looking at the syntax though I might need to add 2 names, one for normal and one for bold.


Trojan.
 
Great job, this is something else! I am now starting to see that we can get along just find w/out windows. Amazing. Simply Amazing.I haven't dled Knoppix yet becuase Ive been so busy w/ school. But I will tonight and let you know how I fair. V string worked, this is very interesting stuff.

Steve
 
Glad you appreciate all the effort.
I shall be away tomorrow, going to a University Open Day but I'll be around over the weekend and next week.
Whilst I'm not here I guess you'll have to rely on Duncs.
I'm sure he'll be back and I think he knows a little more than I about Postscript.
BTW Duncs: When you are back, always use warnings and strict!!!!
;-)
Bear in mind that Duncs and I are in the UK and it's gone 9pm already here. I doubt you'll get much more from either of us tonight but I'm sure you have plenty to tinker with already.


Trojan.
 
Wow, I have much to do! Thanks again, your efforts have been very successful! I am learning allot and plan to learn much more. Time here is 3pm so I’m just getting started. Have a good night and thanks again for a job well done. I’m sure you will be hired by a big software company! If you can put up with me, u can put up w/ anything. : )
 
I wish I could find a company that appreciated my talents.
Unfortunately I'm contantly being told that I'm overqualified!!!


Trojan.
 
Oh my god!

What the f**k is going on!!! I see you are having fun!!! ;-)

Cool!

Blimey Steve - you have been busy!

about 68 posts back... hi Trojan - no, not seen Flickr!? Think i have heard of it?

It's so fantastic to see Steve make such progress - and thank you Trojan for doubtlessly improving my code and helping him have some fun! This is marvellous!


Kind Regards
Duncan
 
Trojan
sorry - scrub Flickr - dodgeit is what i meant to say!

Steve
This is doubtless the best post i have been involved in. It is so fantastic to see you take on board my suggestion and run with it. Blimey - you are an inspiration to the rest of us! You'll be answering questions on the Perl forum before long ;-)

Trojan
When have you ever seen me use strict ? You know i'm crap! But you are correct - i'll probably have to get out the shoe polish again!


Kind Regards
Duncan
 
Duncan, Don't give me all the credit for workin, Trojan is the man whos writing all the code. I actually going out and buying a Perl book. I gotta learn me some Perl! Thanks for the kind words Duncn~! Isnt it like 4am where you are at? Why dont you get some sleep!
 
Hi Steve

I'm not giving you all the credit for working - i'm simply flattered that you liked my solution (or idea at least) - and have progressed to learning Perl & Linux (and Postscript). Well done dude! I am so glad you are enjoying yourself! You are in good hands with Trojan - i am sure you are aware of that!

Keep it up - and keep us both posted as to your progress

Good luck!


Kind Regards
Duncan
 
Awesome! Pretty cool solution really. If you had to do this over and over, it would be a great tool!


Kind Regards
Duncan
 
Hi Trojan. Cool. I will have to msg later as i've gotta go and do some work off-site

Cheers


Kind Regards
Duncan
 
Hi Guys! I love perl and Im having fun!
I am having trouble isolating the dimensions of the grid layout. Currently this perl script produces a 4X4 grid totaling only 16 names. If I include more in the ____DATA____ field it wont produce them. Ive been playing around with the X and V factors. No luck.
Code:
#!/usr/bin/perl -w
use strict;

my $v       = 25;   # Y starting position (counts down from here)
my $xfactor = -6;    # Panel spacing in x axis

open (PS_OUT, "> plaque_names.ps");

select PS_OUT;

chomp (my @data = <DATA>);
#my $fontname = "Helvetica";
my $fontname  = "Times";
my $largesize = 12;
my $smallsize = 10;
my $spacing   = 0.4;

print <<PREAMBLE;
%!PS-Adobe-9.0
%\%DocumentMedia: Default 842 1000 0 () ()
%\%Orientation: Landscape


%---------- Procedures ----------

/cm {28.3464567 mul} def

%---------- Postscript ----------


PREAMBLE

for (my $x=0; $x<=$#data; $x++) {
  if ($x % 3 == 0) {
    for (my $y=1; $y<=4; $y++) {
    
  my   $name = shift @data;
  my  $store = shift @data;
  my   $date = shift @data;
       
#      ($firstname, $surname) = split(/ /, $name);
      
      print $y * 4 . " cm " . $v . " cm moveto\n";
      print "/$fontname-Bold findfont $largesize scalefont setfont\n";
      print "($name) dup stringwidth pop 2 div neg 0 rmoveto show\n";
      
      print $y * 4 . " cm " . ($v - $spacing) . " cm moveto\n";
      print "/$fontname-Bold findfont $smallsize scalefont setfont\n";
      print "($store) dup stringwidth pop 2 div neg 0 rmoveto show\n";
      
      print $y * 4 . " cm " . ($v - $spacing*2) . " cm moveto\n";
      print "/$fontname findfont $smallsize scalefont setfont\n";
      print "($date) dup stringwidth pop 2 div neg 0 rmoveto show\n";
      
    }
    print "\n";
    $v-=3;
  }
}
print "showpage\n";

close PS_OUT;

__DATA__

gee.gif


Notice only 16 names on a 4X4 grid. I had about 32 name in the data field... why arent those included?
 
I can't see how it wouldn't produce the extra data.
I bet that the extra rows are simply off the bottom of the page.
You could test this by displacing the start above the top of the page to see if the extra data appears at the bottom.


Trojan.
 
My bad, actually I can only get 24 squares and I can't seem to figure out where they rest of them went. I have 28 in my __DATA__ field but yet only 24 are displayed. Weird. Any other sugguestions?
Thank you very much,

Steve
gee2.gif
 
Postscript is a textual language so open the postscript file in notepad or word and see if all your data is in there.


Trojan.
 
Man, great idea. I never thought of lookinging at my .ps, only my perl. Thx Trojan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top