formatting PDF fields not working as expected

Previous topic - Next topic

garydale

I am running Scribus 1.5.8 on a Debian/Bookworm system. I have a short document that is to be distributed in PDF form with a few fields that people can fill in to customize it to a particular use. I want the fields to look like they were part of the original document. Each field is on its own line so there is no moving items around - the type face just needs to match the rest of the document.

Unfortunately, the list of fonts I can use for a PDF field isn't the same as the list of fonts installed on my computer. The document is designed to a style standard so it uses a particular set of fonts that I can't seem to select for the fields' style.

Why am I only seeing an abbreviated list of fonts in the field property's type face pulldown? How can I change this?

To be clear, I can clear direct formatting and select the paragraph & character styles but when I do that, the fields don't display in the document after they are filled. I can enter data but it doesn't show when I turn off the form entry (I'm using Okular to view PDFs)...

I can only get the data to display when I set the font from the pull-down list for each field. When I've done that, I can turn off form entry and the data displays in the selected font. But unfortunately (as mentioned above), I don't get the option of selecting the font I actually want.

Any ideas on how to fix this?



Nermander

If I am not wrong, this is a limitation of the PDF forms specification.

garydale

I don't think so. The Adobe site suggests that a font can be any that is available "on your computer". The font chosen is embedded in the PDF file so any character should be able to be input.

garydale

The fact that it's likely not a PDF forms limitation is also evidenced by the inclusion of character and paragraph styles in the PDF field properties. In my particular case the font I want to use is Adobe Caslon Pro but it doesn't show up in the fonts pulldown list. It's installed as an OpenType font. A font I'm given as an option is Times New Roman, which is TrueType (part of the M$ core fonts). Another is the Liberation family of truetype fonts from RedHat.

The collection of fonts in the pulldown list is quite varied and includes some oddities that I doubt would included as a "PDF" standard. For example, I can pick "Bloody Stump" (again TTF) and it works.

I can't find any mention on the Internet of OpenType fonts not being allowed in PDF fields. And OpenType has been around since before Scribus

MrB

I don't remember the specific, @jghali can confirm for sure, however PDF forms are limited in what fonts you can use. The answer may be TTF/Type1 only ( see https://bugs.scribus.net/view.php?id=3282 ). It may be different between PDF 1.3, 1.4, etc. There was also a limitation to the standard 14 fonts that Adobe bundled with Reader at one point, I think.

garydale

I tried it using PDF 1.6 export as well and it still didn't work. However it's clearly not limited to some 14 fonts (unless Bloody Stump somehow made that cut  ;) ). The 1.3 fallback seems to be in case anyone actually wanted to create a PDF to that antique standard.

Since OpenType is an extension of TrueType, you would expect that OpenType support would not be an issue. It should simply fall back to the TTF core features in the worst case. Moreover, OpenType has been around for a quarter century. There is no way that it should be supported in some parts of Scribus but not others.

The bug report is from 2006. The problem he reported was that the 1.3 fallback was always being used even for later versions of the PDF standard. That seems to have been addressed.

As I pointed out earlier, clearly the intent of the programmers is that PDF fields should be subject to normal Scribus paragraph and character styles. It's apparently not working properly.

Nermander

Quote from: garydale on May 24, 2023, 05:56:37 PMI don't think so. The Adobe site suggests that a font can be any that is available "on your computer". The font chosen is embedded in the PDF file so any character should be able to be input.

Maybe an embedded font is considered available "on your computer".

And in any case I don't think it is Scribus that decides what fonts are available for a form, it is most likely the PDF viewer.

jghali

Quote from: garydale on May 25, 2023, 02:20:43 AMAs I pointed out earlier, clearly the intent of the programmers is that PDF fields should be subject to normal Scribus paragraph and character styles. It's apparently not working properly.

Per PDF specifications, point 12.7.4.3, PDF Forms fields are limited in their use of fonts and colors : "The text shall be presented in a single style (font, size, colour, and so forth), as specified by the DA (default appearance) string". Scribus will consequently only use the styles defined at text frame level when exporting to PDF. Any style defined on the text itself will be ignored.

Practically PDF Forms fields are also limited to the kind of fonts they can use. If the font used in the form field is not available on user computer, it is mandatory to fully embed the corresponding font and the font has to be embedded in a specific way. So for PDF 1.4 and 1.5, this excludes any OpenType font using PostScript outlines such as Adobe Caslon Pro as such fonts cannot be fully embedded in PDF 1.4 and 1.5 formats. PDF 1.6 supports fully embedding OpenType fonts with PostScript outlines, however glyphs in such fonts are not addressed the same way as OpenType fonts with TrueType outlines, which Scribus considers as TTF btw, so these fonts will not work reliably across viewers when used in PDF Form fields.

The only fonts which works reliably in PDF form fields across viewers are the PDF base 14 fonts, TTF fonts and OpenType fonts with TrueType outlines (which can be embedded in PDF as if they were TTF fonts).