Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #2250

Re: . bbox of a set of glyphs

From ken <ken@spamcop.net>
Newsgroups comp.lang.postscript
Subject Re: . bbox of a set of glyphs
Date 2015-05-08 08:21 +0100
Message-ID <MPG.2fb67458ae3c0a7d9898f4@usenet.plus.net> (permalink)
References <e960544e-41e2-4c87-bda4-dca56daf7c41@googlegroups.com> <766aec49-0b07-4b3b-ad9d-2e6870d1587c@googlegroups.com>

Show all headers | View raw


In article <766aec49-0b07-4b3b-ad9d-2e6870d1587c@googlegroups.com>, 
jodun@mail.com says...

>   Ken's approach - thanks kin for spending a lot of time - may be the 
more accurate one, but it, in my newbish opinion, 
>    a: does not lend it self to a one-process solution
>    b: has 4 arbitrary numbers, 4000 4000 1000 0

Only because a portion of your PostScript lies off the media. The 
numbers are indeed arbitrary, but if you can figure out how much off the 
media your code lies, then its possible to insert real numbers. Or 
simply translate the content onto the media before starting.


> The documentation says that the bbox device writes to stderr
> For a while I thought the bbox device is the equivalent to pathbbox
> but the latter gave me numbers that, after 2 subtractions, gave me a NULL bbox.
> That is what i called "utterly wrong"

The 'latter' being pathbbox ? If so I'm confused, because what you said 
was "But if I use the bbox device, I get an utterly wrong answer.".

Also, a degenerate bbox wasn't the result I saw from the bbox device, 
even without translating the content onto the page. Possibly you are 
misusing the co-ordinates, can you give me an example of the numebrs you 
get ?

What I wrote was:

"The Ghostscript bbox device (which is clipped to the page) says that 
the BBOX is 0 441 439 1301."

So that's llx = 0, lly = 441 urx = 439, ury = 1301. Subtraction yields a 
bbox whch has a width of 439 and a height of 860 PostScript units. 
Certainly not NULL.

 
> Not to mention the 2 sets of quad numbers are utterly different.

Which two sets of numbers ?

 
> Again, would it be pushing my luck to ask for more spoon-feeding complete one-process automatic 2 sets of code ?

In general the application generating the PostScript should keep track 
of where it expects marks to be made so the application, generally, 
would keep track of the bbox. In your case you are generating the 
PostScript apparently, so its really up to you to keep an at least 
approximate record of where the marks are.

As far as I understand it at least part of the problem from your POV is 
that you aren't tracking that, not even to the point of ensuring that 
the content is printable.

Remember, PostScript is intended for printing so its quite important to 
make sure all the marks you print lie on the selected media.

So if you aren't going to keep track of the position of the elements on 
the page then its possible you are going to have to do a 2 pass 
approach, yes.

Id the example you've given really representative of the sort of problem 
you intend to tackle ? You intend to process a database of thousands of 
strings, and yet you plan to render them all at unusual angles and 
sizes, and aren't prepared to track the orientation  and positoin of the 
strings, even a little ?

I actually have not spent any real amount of time on ths, otherwise I'd 
look into why the pathbbox solution gives rise to different answers. My 
suspicion is that its because the resolutoin is coarse (probably 72 dpi) 
and so the glyph paths are not being well represented.

			Ken

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

.   bbox of a set of glyphs jodun@mail.com - 2015-04-30 15:05 -0700
  Re: .   bbox of a set of glyphs ken <ken@spamcop.net> - 2015-05-01 07:48 +0100
  Re: .   bbox of a set of glyphs jdaw1 <jdawiseman@gmail.com> - 2015-05-01 01:50 -0700
  Re: .   bbox of a set of glyphs jodun@mail.com - 2015-05-02 06:48 -0700
    Re: .   bbox of a set of glyphs jdaw1 <jdawiseman@gmail.com> - 2015-05-02 14:13 -0700
      Re: .   bbox of a set of glyphs ken <ken@spamcop.net> - 2015-05-04 08:00 +0100
        Re: .   bbox of a set of glyphs jdaw1 <jdawiseman@gmail.com> - 2015-05-08 01:34 -0700
          Re: .   bbox of a set of glyphs ken <ken@spamcop.net> - 2015-05-08 10:44 +0100
            Re: .   bbox of a set of glyphs jdaw1 <jdawiseman@gmail.com> - 2015-05-08 05:06 -0700
          Re: .   bbox of a set of glyphs SaGS <sags5495@gmail.com> - 2015-05-11 01:40 -0700
            Re: .   bbox of a set of glyphs jdaw1 <jdawiseman@gmail.com> - 2015-05-11 02:58 -0700
    Re: .   bbox of a set of glyphs ken <ken@spamcop.net> - 2015-05-04 08:50 +0100
  Re: .   bbox of a set of glyphs jodun@mail.com - 2015-05-04 11:22 -0700
  Re: .   bbox of a set of glyphs jodun@mail.com - 2015-05-07 14:01 -0700
    Re: .   bbox of a set of glyphs luser- -droog <mijoryx@yahoo.com> - 2015-05-07 21:19 -0700
    Re: .   bbox of a set of glyphs ken <ken@spamcop.net> - 2015-05-08 08:21 +0100
    Re: .   bbox of a set of glyphs ken <ken@spamcop.net> - 2015-05-08 12:06 +0100
  Re: .   bbox of a set of glyphs jodun@mail.com - 2015-05-12 07:44 -0700
    Re: .   bbox of a set of glyphs ken <ken@spamcop.net> - 2015-05-12 16:36 +0100
  Re: .   bbox of a set of glyphs jodun@mail.com - 2015-05-14 08:18 -0700
    Re: .   bbox of a set of glyphs ken <ken@spamcop.net> - 2015-05-14 17:31 +0100

csiph-web