Bug 503744 - Cannot change font
Summary: Cannot change font
Status: ASSIGNED
Alias: None
Product: Arianna
Classification: Applications
Component: general (other bugs)
Version First Reported In: 25.04.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Carl Schwan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-04 10:34 UTC by Maverick
Modified: 2026-01-05 00:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maverick 2025-05-04 10:34:53 UTC
SUMMARY
Cannot change default font. Default font is set to Serif and it does not change to any other font option when selected.

STEPS TO REPRODUCE
1. With Arianna open, select "Settings". 
2. Select "Change default font".
3. Select any your preferred font and size.
4. Click "Ok" and exit.

OBSERVED RESULT
On opening the epub file, the font reverts to the default serif and default size. The font changes are not effected.

EXPECTED RESULT
Font to change to the selected font and not revert to the default font.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Archlinux KDE Plasma, Wayland Session
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0 
Qt Version: 6.9.0

ADDITIONAL INFORMATION
Comment 1 catalyst 2026-01-03 20:29:42 UTC
This is confirmed. From my investigation thus far, I think it has to do with the switch over to foliate-js and foliate-js is not being told to change the font settings.
Comment 2 catalyst 2026-01-03 23:58:02 UTC
I have a fix but i need to test more to make sure it is the proper fix. In function applyStyle in EpubViewerPage, change userStyleshet to this:

userStylesheet: Config.usePublisherFont ? '' : `
                    body {
                        font-size: ${fontSizePt}pt !important;
                        font-family: "${fontFamily}" !important;
                    }
                    p { font-size: inherit !important; }
                    `,

That will inject the chosen font settings into the rendered output. This does have a caveat, if you make the font too big for your screen, the arianna has no scrollbar for the main foliate rendering widget and text will simply get chopped off the screen.
Comment 3 Bug Janitor Service 2026-01-04 00:31:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/arianna/-/merge_requests/86
Comment 4 catalyst 2026-01-04 02:33:31 UTC
The merge request was cancelled, as the font settings do not get injected when invert colors is on. If invert colors is off it works fine. I will fix that here soon.
Comment 5 catalyst 2026-01-05 00:23:52 UTC
Okay, after going deep into this, there were several bugs in invert colors mode keeping the font settings from changing. In fact, invert mode was fundamentally broken. 

There were also fatal javascript errors such as a dispatch to resize when the backend wasn't setup. 

The invert colors mode  was calling theme.inverted when no theme.inverted existed, thus breaking font changes when invert mode was on
and causing a fatal javascript error. 

I did refactor a lot of the CSS, and it appears font rendering works as expected, and now color inverting works as expected. No javascript errors are displayed on the console when a book is loaded.