Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

[Bug]: Font Selection Menu Displays Identical Fonts when signing pdfs with text input on firefox

Open Rudra-241 opened this issue 1 year ago • 5 comments

The Problem

While trying to sign a PDF with text input in Firefox, the font selection menu shows identical fonts. Logs indicate that the customFiles/static/fonts directory is missing. I checked the directory and it is indeed empty. However, despite receiving the same logs with Chrome, the fonts work there.

on Firefox (127.0.2):

MLJvoHr

on Chrome (126.0.6478.61):

image

Version of Stirling-PDF

0.26.2

Last Working Version of Stirling-PDF

No response

Page Where the Problem Occurred

/sign

Docker Configuration

No response

Relevant Log Output

22:08:48.212 [qtp556798624-56] INFO  o.s.c.i.s.PathMatchingResourcePatternResolver - Skipping search for files matching pattern [*]: directory [/home/rudraaa/.git/Stirling-PDF/customFiles/static/fonts] does not exist
22:09:10.962 [qtp556798624-100] INFO  o.s.c.i.s.PathMatchingResourcePatternResolver - Skipping search for files matching pattern [*]: directory [/home/rudraaa/.git/Stirling-PDF/customFiles/static/fonts] does not exist
22:09:58.814 [qtp556798624-56] INFO  o.s.c.i.s.PathMatchingResourcePatternResolver - Skipping search for files matching pattern [*]: directory [/home/rudraaa/.git/Stirling-PDF/customFiles/static/fonts] does not exist

Additional Information

No response

Browsers Affected

Firefox

No Duplicate of the Issue

  • [x] #1629

Rudra-241 avatar Jul 21 '24 17:07 Rudra-241

So looked more into this, i can reproduce the issue itself but not any of the logs or reasons you gave, From my look into it seems like firefox doesn't support custom CSS for each single option box within the dropbown but still renders the font fine when its actually selected.

To resolve this we would need to design (or use) a custom select box instead of standard HTML one

Frooodle avatar Aug 24 '24 15:08 Frooodle

This is unfortunately not fixable without implementing a custom dropdown, see:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option

and

https://developer.mozilla.org/en-US/docs/Learn/Forms/Advanced_form_styling

FiratUsta avatar Sep 07 '24 21:09 FiratUsta

maybe we can just display the font names for firefox instead of showing how the text looks like in those fonts

Rudra-241 avatar Sep 08 '24 09:09 Rudra-241

Seems like a good workaround

Frooodle avatar Sep 08 '24 09:09 Frooodle

maybe we can just display the font names for firefox instead of showing how the text looks like in those fonts

IMHO this would be a good change for all browsers, if you're using this feature often enough it's more beneficial to remember the font name that you use instead of your input text, which's most likely your name.

In fact, I'm not sure how feasible this is (should be doable with onmouseenter even if select doesn't have an onchange event) but if the input text box updates the font on option hover instead of select update, we could cover all bases without compromising convenience.

FiratUsta avatar Sep 08 '24 09:09 FiratUsta