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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to code other than 100% scale in a text line (show) 2

Status
Not open for further replies.

bvahan5

Programmer
Jun 11, 2005
63
RU
a string (text line) printed by a command show has a 100% width

widthshow & ashow make space between chars/glyphs more narrow or wide.

i need a chars/glyphs themselves to become wider
in AI this feature is been called - Horisontal Scale

is there such a commnand in PS ?

thx in advance
 
This line allows you to set the width and height of a font, just change the Font name and width/height values to what you require

FONT NAME W H
/Helvetica-Bold findfont [7 0 0 6.2 0 0] makefont setfont
^ ^
 
2 popalu
thx
however when i am writing this operator
/Helvetica-Bold findfont [7 0 0 6.2 0 0] makefont setfont

it prints upside down

what operator/parameter is responsible for this?

here is a portion of my Text script

%%start script

%%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 1000 144

100 155.2 moveto
/Swiss721BT-Bold findfont [6.59999 0 0 -6 0 0 ] makefont setfont
(T.J. Clark) show

100 69 moveto
(Swiss721BT-Roman) 6.50 selectfont
0.2 0 (Main: 415 123-4567 ) show

showpage

%% end script

first operator prints upside down
second prints normal
 
Oh, he gets a star for the same information I posted? I'm kidding - I don't care.

So which code are you using, the one the the negative "y" value, or the version with the positive "y" value? You've posted both, so it isn't clear. If -6 makes it print upside down, then use +6, and vice-versa.

Thomas D. Greer
 
2 tgreer

yes, i've noticed that
about +/- in values (+/-6)
now it works

interesting, that original file had "-", so i did copy-paste, and it was not working properly

i have PS tasks in my scripting, but can't spend too much time on it
and i am repeatedly back to PS issues from time to time
my programs generate PS files online for simple layouts

in past i tried to use this FONT notation (operator) making a copy-paste from original file

/Swiss721BT-Roman*1 findfont [6.59999 0 0 -6 0 0 ]mfnt sfnt

it was NOT working, so I switched to another simplier notation, like
(Swiss721BT-Bold) 6.50 selectfont

the point is that AI does not say where is an error trying to open PS file
AI message is "Unable to open file"

today i "accidentally" changed
"mfnt sfnt" onto "makefont setfont"
and it worked

how come "mfnt sfnt" was working in the original file hell knows
(may be there is an operator of re-assigning??)

now about stars
dear tgreer i will give to u 3 stars if u will help me with another issue, i asked months ago

how to make a right justification?

example
if i need to place a line
"tgreer gets 3 stars"
in a position 100 115
my program will generate simple lines
100 115 moveto
("tgreer..") show

now if i want this line to END in a position 100, 115 what is an algorithm? is there a reserse typing operator in PS?









 
Forget the stars, seriously... it makes no difference, I was making a joke.

There is no right-justification command. You use "stringwidth" to determine the length of a string, and back-track to the starting position.

So:

Code:
(some string) dup stringwidth pop 100 exch sub 115 moveto show

Would cause the string to END at position 100,115.

Thomas D. Greer
 
Sorry Tom ... lol, I was just showing the syntax of the command, not stealing your thunder
 
2 tgreer
thx
this forum doesn't allow to give more than 1 star at a time
your last sample of coding was one of the most, that excited me last months
want to be hammer it on (my) wall
works perfect, thx

btw now i am solving the next task - how to make centered a text line, i.e.
(Tom's jokes deserve stars too)
- centered in position 100, 120
when dividing a line in two with different justificaions, a problem occurs with 2 neighbor letters in the very center
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top