[pdftex] Embedding a font to use it in a form
Gregory Heytings
ghe at sdf.org
Tue Jul 14 00:23:45 CEST 2015
Hi Karl,
Many thanks for your answer!
>
> It should work to fully embed a font (no subsetting) by using <<foo.pfb
> in the map file entry instead of <foo.pfb. This is tersely discussed in
> the pdftex manual under "fontfile", page 11 in the pdftex-a.pdf that is
> in TeX Live 2015.
>
After some more research, it seems indeed that one aspect of the problem
is to fully embed the font. Apparently it does not work with pfa/pfb
fonts, however (but I am not sure that it cannot be done); it does work,
for sure, with an otf font file.
>
> However, I have no knowledge of how to specify a font for use in text
> field forms. Maybe someone else here (Heiko, Martin ... ?) can help.
>
So far my best answer to my own question goes as follows: one has to
insert the otf file as a pdf object, with something like "\pdfobj stream
attr { /Subtype /OpenType } file {Font.otf}", and then create two other
pdf objects manually, namely a /FontDescriptor and a /Font, the latter
containing /FirstChar 0 /LastChar 255, and 256 values in the /Width array.
Then that font can be used in a form, by adding a reference to it in the
resource dictionary of the form.
(Once I got the above scheme working, I tried to remplace the "\pdfobj
stream attr { /Subtype /OpenType } file {Font.otf}" with a "\pdfobj stream
attr { /Subtype /Type1 } file {Font.pfa}", but it did not work anymore.)
The problem is that doing this involves a lot of manual work. A more
direct way to do this (with pdfTeX) would be much appreciated.
Gregory
More information about the pdftex
mailing list