Re: pdfmark and fonts

"Valeriy E. Ushakov" <[email protected]>
Newsgroups gmane.comp.type-setting.lout
Message-ID <[email protected]>
On Wed, Jun 20, 2012 at 17:06:45 +0100, Tristan Williams wrote:

> I wanted the current font to pass to the pdfmark code that I have put
> in the left argument to the @Graphic which I then put inside a Lout
> function. If I leave out the /DA line from the pdfmark code (below)
> the default (Postscript?) font used does not seem to be the same one
> as the current font in Lout. So far, I have not been able to pass
> successfully any element of Postscript's currentfont to/through the
> pdfmark. I just don't know enough to do it yet!
[...]
> def @edit
> left  varname                 # pdf form variable name
> named @font     {@CurrFamily} # current Lout font family. To work this must = Postscript font name

You can use 

  named @font { @FontDef&&{@CurrFamily-@CurrFace} @Open { @Name } } 

to refer to PostScript font name of the current font.  There's an
interesting potential issue with font recoding, though.  The problem
is that /DA doesn't use graphic context of the surrounding text, so
any postscript setup lout does (and distiller picks up and reflects in
the PDF) doesn't affect /DA.


>     "/"DA ("/"@font @fontsize Tf @fgcolour rg)

Picking up font size automatically is tricky.  The value of /DA is a
string, so you cannot easily use the usual trick of computing correct
value with postscript code ("12 pt").  And anyway, since /DA has its
own context, lout default coordinate transformations (that include
scaling) don't apply (note that you use just plain "12", using default
scale).  So you'd need something like a sprintf(3), so to say, to
create the string for /DA using postscript code.

You may probably play /_objdef games to help some of this, I haven't
really thought about it in details.

-uwe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.