r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Postscript] Emitting Postscript from REBOL

Henrik
20-Apr-2008
[1597x3]
if that's the case, let me test the theory
what?...
why doesn't that work for smaller cells?
Geomol
20-Apr-2008
[1600x2]
PageSize A4
page [
	font [Times 18]
	at 60x421 "abcdefg"
	font [Times 36]
	at 130x421 "abcdefg"
	font [Times 96]
	at 260x421 "abcdefg"
]
In my example, the baseline of all the text is vertical centered 
on the page.
Henrik
20-Apr-2008
[1602x3]
now I'm reallly confused. it would mean the height of the paper is 
somehow misleading. I tried your method in the table cells and get 
top-aligned text as I expected.
sorry
not top-aligned text, but text where the baseline is the center.
Geomol
20-Apr-2008
[1605x2]
Ok, if it does, what you need. :-)
Do you have the psrefman.pdf document for PS second edition? Seciton 
5.4 has a drawing of font positioning.
Henrik
20-Apr-2008
[1607]
I. Need. Vertically. Centered. Text. :-) Is that so hard to understand? 
:-)
Geomol
20-Apr-2008
[1608]
LOL :)
Henrik
20-Apr-2008
[1609x2]
Your method produces this:

http://hmkdesign.dk/rebol/postscript/testsheet.ps
That is _not_ vertically centered text. That is text that is vertically 
centered around the baseline.
Geomol
20-Apr-2008
[1611]
Eh, the baseline is centered in each cell, right? And you're asking 
each word to be centered within its cell with equal space above and 
below the text?
Henrik
20-Apr-2008
[1612]
... yes :-)
Geomol
20-Apr-2008
[1613]
Because if you want that, then it'll look strange, because each line 
in the table will have text jumping up and down, depending on whether 
you have letters like 'g' and 't' or you just have letters like 'a'. 
And that will look less nice to me.
Henrik
20-Apr-2008
[1614]
sigh... I've already said 4 times that I use the alphabet to prevent 
this! :-)
Geomol
20-Apr-2008
[1615]
But you're right, that if you really want that, then you need to 
get info from each letter in the font.
Henrik
20-Apr-2008
[1616]
yes! now you get it
Geomol
20-Apr-2008
[1617]
:) In REBOL/View, there is things like offsets to position text within 
field and so. Couldn't you go with something like that? Just subtract 
a little from each vertical position to get the text a little down, 
if you want?
Henrik
20-Apr-2008
[1618]
then I have to do that for each single individual case. with the 
deadline I have to produce this table, that may be my option for 
now, but that is definitely not optimal.
Geomol
20-Apr-2008
[1619x2]
If you have different fontsizes in your tables, you could do something 
like:
y-pos: y-pos - (fontsize / 10)
Then adjust the 10 factor, until you're satisfied. And that should 
then work for all fontsizes.
Henrik
20-Apr-2008
[1621]
well, possibly. I'll see if that works for now.
Geomol
20-Apr-2008
[1622]
Sorry, that I find it hard to understand, what you mean from time 
to time, my fault. I get you now. I would put things like margins, 
linespace, vertical position within tables, etc. in a dialect above 
the postscript dialect level. Doing it that way, the same postscript 
dialect can be used for all sorts of layout engines, because it has 
little restriction.
Henrik
20-Apr-2008
[1623]
for the syntax and input yes, but if you need accuracy, you need 
to get the information via postscript.
Geomol
20-Apr-2008
[1624]
ok
Henrik
20-Apr-2008
[1625]
because we are already doing it correctly using stringwidth, namely 
by calculating the text size accurately inside postscript. the same 
should count for the vertical size. it's strange that information 
is so hard to get.
Geomol
20-Apr-2008
[1626]
Don't you think, it already is centered, if you take underline into 
consideration? It seems weird to me, that Adobe would position text 
being off some amount, either up or down.
Henrik
20-Apr-2008
[1627x2]
it is not centered, because the baseline is not at the center of 
the text. if only it were :-)
and the position calculation is around the baseline.
Geomol
20-Apr-2008
[1629]
That is the reason, that they put the baseline as they did?
Henrik
20-Apr-2008
[1630x3]
the baseline is a typographical tool. it is the place where your 
letters are "resting" against, just like when you were learning to 
write in school, you had a guide line to write characters on. but 
the baseline itself is completely useless for vertical centering 
of text.
adobe didn't invent the baseline
but I do wish that each char in a font had a center point that indicates 
the absolute center of a character both horizontally and vertically. 
horizontally, that would be individual for each char, but vertically 
it has to be identical for all chars, like the baseline is.
Geomol
20-Apr-2008
[1633]
I can see, that text in tables in html is centered more like you 
want it, at least in Safari. Actually the text is much lower in Safari, 
so there is more space above the text than below, if you use words 
with 'g'. I can't judge, if they do a simple calculation or use the 
font box.
Henrik
20-Apr-2008
[1634x2]
it depends on the chars you use. if you use a word like "judge", 
the word might appear offset downward, because there are no really 
tall letters in that word. if you use a word like "Greg", the word 
might appear more centered. If you say "GGG", the word might appear 
offset upward, because "G" is a tall character in Helvetica or Times. 
But overall, if you write a long sentence like that, the words should 
appear centered.
And when I say the letter is tall in Helvetica or Times, that means 
it may not be so in other fonts. I don't believe a font like Verdana 
does this. This is why when getting the absolute center for a font, 
you must calculate it using all glyphs in the font.
Henrik
24-Jun-2008
[1636]
I gave in, and have begun using ghostscript for printing postscript. 
There are many printer specific bugs that require a windows printer 
driver to make postscript printing work properly, so I now use the 
mswinpr2 driver. However it eats about 40 MB RAM printing one page. 
Anyone got ideas on how to reduce that?
Graham
24-Jun-2008
[1637]
what do you mean by printer specific bugs?
Henrik
24-Jun-2008
[1638x3]
I had problems with feeding postscript files generated by postscript.r 
directly to an HP Laserjet 1200. It would stop printing after the 
first job. Feeding it through Ghostscript or the adobe postscript 
printer driver solved the problem, but now the printer is replaced 
with a different one with different issues.
I read about the HP Laserjet 1200 and it has such a bug in its postscript 
implementation that is easiest worked around in the driver.
I've also seen a Laserjet 4500 lock completely up, when you feed 
it a specific postscript or PDF file.
Graham
24-Jun-2008
[1641]
and you're sure that your postscript code is correct??
Henrik
24-Jun-2008
[1642]
I have worked for many weeks on the problem and it's unsolvable, 
so I went to Ghostscript instead, but I'm unhappy with its speed.
Graham
24-Jun-2008
[1643x2]
what happens when the code you send is rendered by gsview?
or is interpreted interactively by ghostscript?
Henrik
24-Jun-2008
[1645]
I don't use GSView, I use the printer with Ghostscript as passthrough.
Graham
24-Jun-2008
[1646]
so, you send postscript to ghostscript when then generates postscript 
again to send to the HP printers?