SUMMARY Text in PDFs and annotations are rendered wrongly on version 1.10 installed through Flatpak. The typewriter annotation is invisible too. All works fine when 1.9.3 is installed from Ubuntu's repositories. What could be causing this? OS is Pop OS 20.04, GNOME 3.36
Please attach screenshots and file used for those screenshots
Created attachment 128196 [details] Flatpak (left) wrong rendering Flatpak (on the left) has wrong rendering of the text and the text boxes which are invisible. All annotations have been made in Okular 1.9.3
Can you attach the pdf file?
Created attachment 128206 [details] used pdf file in screenshot
Can you attach a screenshot of File->Properties->Fonts for both?
Created attachment 128207 [details] fonts used 1
Created attachment 128208 [details] fonts used 2
Here are some errors that also pop up on running the flatpak - https://pastebin.com/G1nTUQwy
Yeah, as I suspected the file doesn't have the fonts attached so we're calling fontconfig to return us the font the system things we should be using. In your system for Helvetica it says NimbusSans-Regular.otf but in the flatpak runtime it says qhvr.pfb, that's why you get different font renderings. I have a similar issue locally tsdgeos@xps:~:$ fc-match Helvetica NimbusSans-Regular.otf: "Nimbus Sans" "Regular" tsdgeos@xps:~:$ flatpak run --command=sh --devel org.kde.okular tsdgeos@xps:~:$ fc-match Helvetica LiberationSans-Regular.ttf: "Liberation Sans" "Regular" I don't think Okular flatpak can actually control that. Maybe Jan (or resident flatpak expert) has an idea, adding him to the CC.
I don't know much about how fonts do work, but you should be able to access system fonts inside Flatpak sandbox, because they are mounted into /run/host/fonts and fontconfig is configured accordingly to search in this place. Probably fonts in the runtime itself have higher priority or are in first positions when searching for a suitable font and that's why they get picked instead of the font you would prefer. If I run fc-list inside the sandbox, I see all the system fonts available, but I have no idea how it gets decided which font gets picked.
According to https://github.com/flatpak/flatpak/issues/1563 it seems it's just one of those things that it's not polished enough yet in flatpak