Bug 155096

Summary: FORMCONTROLS: Combo box exports fonts inconsistently to other form controls
Product: LibreOffice Reporter: Steve <steve>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: ilmari.lauhakangas, markus.kell.r, stephane.guillou
Priority: medium    
Version: 7.1.4.2 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 107742    
Attachments: Source document with combo box and text box
Exported PDF with combo box and text box
Text box properties in Acrobat
Combo box properties in Acrobat
Textbox only source file
Textbox-only exported PDF
Textbox-only PDF font properties
Combobox-only source file
Combobox-only exported PDF
Combobox-only PDF font properties
Textbox + combobox PDF font properties
Screenshot missing font

Description Steve 2023-05-01 03:04:43 UTC
Created attachment 187018 [details]
Source document with combo box and text box

I always try to use Type 1 fonts in my forms to avoid problems with compatibility. In my experience, embedded fonts for form controls can sometimes cause end user error messages when trying to fill the form.

Forms made in Writer using Times New Roman generally translate well; when the exported form is opened in Acrobat, the Properties tab shows the font as 'Times Roman'. This is true at least for text boxes, date fields and number fields.

However with Combo boxes that also use Times New Roman, the exported PDF when viewed in Acrobat shows the font as 'TimesNewRomanPSMT'. I have to individually change each field to 'Times Roman' in Acrobat post-processing in order to avoid unpredictable results by end users.

It would be amazing if combo boxes would export fonts as text boxes do today.

Anecdotally, when I tried making PDF forms with Inkscape (another great open source project) a few years ago, it suffered badly from this problem and also affected text boxes.

I will attach a source test document with a text box & a combo box, the exported PDF, as well as screenshots of the field properties in Acrobat.
Comment 1 Steve 2023-05-01 03:05:29 UTC
Created attachment 187019 [details]
Exported PDF with combo box and text box
Comment 2 Steve 2023-05-01 03:06:21 UTC
Created attachment 187020 [details]
Text box properties in Acrobat
Comment 3 Steve 2023-05-01 03:06:48 UTC
Created attachment 187021 [details]
Combo box properties in Acrobat
Comment 4 Buovjaga 2023-05-11 16:00:14 UTC
(In reply to Steve from comment #0)
> Created attachment 187018 [details]
> Source document with combo box and text box
> 
> I always try to use Type 1 fonts in my forms to avoid problems with
> compatibility. In my experience, embedded fonts for form controls can
> sometimes cause end user error messages when trying to fill the form.

I can't test this as I don't have Acrobat, but Type 1 fonts are not supported in LibreOffice (and most software these days).
Comment 5 Steve 2023-05-15 23:43:44 UTC
(In reply to Buovjaga from comment #4)
> (In reply to Steve from comment #0)
> 
> I can't test this as I don't have Acrobat, but Type 1 fonts are not
> supported in LibreOffice (and most software these days).

My point is that Combo boxes should export the font in the same manner as text boxes, date fields, numeric fields, etc. In the current stable build they do not and it does cause problems and in my opinion should be made consistent.

I will attach another two source files, one with only textbox and the other with only combobox. I have also attached screenshots from Acrobat File -> Properties -> Font tab to show the differences between the 3 cases (textbox only, combobox only, textbox and combobox). You will see that textbox-only contains Times Roman, combobox contains TimesNewRomanPSMT, and the textbox+combobox contains both.

Please let me know if there is anything else I can do to assist your understanding of this issue.
Comment 6 Steve 2023-05-15 23:45:06 UTC
Created attachment 187307 [details]
Textbox only source file
Comment 7 Steve 2023-05-15 23:45:43 UTC
Created attachment 187308 [details]
Textbox-only exported PDF
Comment 8 Steve 2023-05-15 23:46:19 UTC
Created attachment 187309 [details]
Textbox-only PDF font properties
Comment 9 Steve 2023-05-15 23:46:46 UTC
Created attachment 187310 [details]
Combobox-only source file
Comment 10 Steve 2023-05-15 23:47:06 UTC
Created attachment 187311 [details]
Combobox-only exported PDF
Comment 11 Steve 2023-05-15 23:47:34 UTC
Created attachment 187312 [details]
Combobox-only PDF font properties
Comment 12 Steve 2023-05-15 23:48:11 UTC
Created attachment 187313 [details]
Textbox + combobox PDF font properties
Comment 13 Markus Keller 2023-06-13 12:27:40 UTC
Created attachment 187886 [details]
Screenshot missing font

Confirmed in

Version: 7.1.4.2 (x64) / LibreOffice Community
Build ID: a529a4fab45b75fefc5b6226684193eb000654f6
CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-CH (de_CH); UI: en-US
Calc: threaded

We use an internal company font which works fine in regular text and is correctly embedded in the PDF.
- When we set the font on a text form field, it gets silently dropped and replaced by a default font (line "Email" in the screenshot).
- When we set the font on a combo form field, the Adobe Reader shows an error message that the font cannot be found and renders the combo field with bullet characters (last line in the screenshot).

I did not find a way to restore the (Default) font in the control properties window. Workaround is to recreate the combo from scratch and re-apply all the customizations.

The embedded PDF viewer in Firefox doesn't show an error message and replaces the missing font with a readable default font. It also don't use the custom company font in any of the form field types.