Re: Embedding a font to use it in a form

Gregory Heytings <[email protected]>
Newsgroups gmane.comp.tex.pdftex
Message-ID <[email protected]>
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
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.