[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pdfmark and fonts
From: |
Valeriy E. Ushakov |
Subject: |
Re: pdfmark and fonts |
Date: |
Fri, 22 Jun 2012 06:17:29 +0400 |
User-agent: |
Mutt/1.4.2.3i |
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 address@hidden # current Lout font family. To work this must
> = Postscript font name
You can use
named @font { @FontDef&&address@hidden@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
- pdfmark and fonts, Tristan Williams, 2012/06/20
- Re: pdfmark and fonts,
Valeriy E. Ushakov <=