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


Groups > comp.lang.postscript > #2266

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-14 17:31 +0100
Message-ID <MPG.2fbede0730f949069898f9@usenet.plus.net> (permalink)
References <e960544e-41e2-4c87-bda4-dca56daf7c41@googlegroups.com> <be7e3702-5a49-4f72-bef9-b80b4ff1bfc2@googlegroups.com>

Show all headers | View raw


In article <be7e3702-5a49-4f72-bef9-b80b4ff1bfc2@googlegroups.com>, 
jodun@mail.com says...

> How to control the bbox ?
> 
> Say the input is a database that contains, for simplicity,
> just 4 strings, of any number of glyphs per string,  between 1 and 30 :
> 
> sun
> moon
> pluto
> .
> 
> (Yes
> period
> full stop
> or just any single letter)
> 
> The output should be a 2x2 contact sheet.
> All four images , should have the exactsame  dimensions
> say  1000 x 1000 pixels
> 
> How to produce those dimensions-identical 4 images
> a- preserving aspect ratio, padding one dimension with blanks
> b- not preserving aspect ratio, no padding
> 
> /Times-Roman  x selectfont
> what should   x be ?
> 
> If we scale, what scales ?

Use stringwidth to find the width of the strings using a convenient font 
size. Divide the media size in 2, use the string width to calculate what 
scale factor is required to fit the string into that width. Use the 
scale operator to scale the drawing operations using that scale factor.

You can, of course, use the previous answers for charpath/pathbbox to 
get both the width and height of the text and use that to calculate 
scaling in each direction independently.

Of coruse, the full stop might end up being huge, but then what did you 
want ? Its not completely clear to me what you want to do.

		Ken

Back to comp.lang.postscript | Previous | Next — Previous 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