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


Groups > comp.lang.postscript > #203

Re: A possible solution to vertical adjustment for text placement

From ken <ken@spamcop.net>
Newsgroups comp.lang.postscript
Subject Re: A possible solution to vertical adjustment for text placement
Date 2011-05-24 17:16 +0100
Message-ID <MPG.2845ea2d5dd48e4998983e@usenet.plus.net> (permalink)
References <b16d5cb2-cbd8-4888-9d8b-fb45fcfab9f7@h7g2000yqa.googlegroups.com>

Show all headers | View raw


In article <b16d5cb2-cbd8-4888-9d8b-fb45fcfab9f7
@h7g2000yqa.googlegroups.com>, macracan@gmail.com says...

> What works is the following:
>   currentfont /FontBBox get 1 get currentfont /FontMatrix get 3 get
> mul

Only works if the FontBBox and FontMatrix are correct (Often not the 
case with, for example, type 3 fonts). 

You don't seem to be taking the CTM into account, which would lead to it 
not working. 

You are not considering shearing or rotation, both of which may modify 
the vertical extent of the font. (This is a common technique for 
artifical italic when no italic face is available).

Won't work properly with CIDFonts as you aren't taking both the parent 
and descendant font's matrices into account.

charpath works better IMO. If you want the font's maxima then enumerate 
each glyph in the Encoding, draw each glyph with charpath etc. If you 
want absolute guaranteed maxima, enumerate each glyph in the CharStrings 
dictionary (Note CIDFonts will require a somewhat different approach, 
but the principle is the same).

Of course, better yet is to use the Font Metrics file supplied with the 
font, and lay out the text in a real application instead of guessing in 
PostScript.


			Ken

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


Thread

A possible solution to vertical adjustment for text placement macracan <macracan@gmail.com> - 2011-05-24 07:13 -0700
  Re: A possible solution to vertical adjustment for text placement ken <ken@spamcop.net> - 2011-05-24 17:16 +0100
    Re: A possible solution to vertical adjustment for text placement macracan <macracan@gmail.com> - 2011-05-24 10:10 -0700
      Re: A possible solution to vertical adjustment for text placement ken <ken@spamcop.net> - 2011-05-25 08:00 +0100

csiph-web