Skip to content

Conversation

@Arklaum
Copy link
Contributor

@Arklaum Arklaum commented Aug 23, 2025

I moved the fonts, and fixed typos inside the font css files, so the real changes were in the 6 files:

  • EpubJsReader.tsx
  • FontFamily.tsx
  • FontSelect.tsx
  • DefaultFontFamily.tsx
  • ComboBox.tsx
  • Overrides.css (i hope this one is okay)

I know there's another pull request for this fix #663, and I'm not sure what other features that one included so I don't know if this supersedes it (I think it does). I did try that fork but there seemed to be issues like colour of text and background not loading correctly, etc. Solves #660 I guess.

I did not fix the flashing when changing line height / font / font size.

I made sure the dropdown boxes for font in 'reader settings' rendered in their own font and not the font set under 'appearance'.

Edit: I didn't update the documentation either. I'll do that now and send an update.

@Arklaum
Copy link
Contributor Author

Arklaum commented Aug 23, 2025

Okay documentation has been updated

@aaronleopold aaronleopold linked an issue Aug 24, 2025 that may be closed by this pull request
Copy link
Collaborator

@aaronleopold aaronleopold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you!

I don't know if this supersedes it (I think it does) [the other PR]

I think it does, at the very least I can see the fonts being requested by the component locally and they seem to be working as expected. This is also a good bit leaner of a change, which is a plus.

I did not fix the flashing when changing line height / font / font size

I think this is an artifact of epub.js, so I think it's acceptable

I made sure the dropdown boxes for font in 'reader settings' rendered in their own font

I appreciate this!

Comment on lines +58 to +70
const injectFontStylesheet = (rendition: Rendition) => {
const doc = Object.values(rendition.getContents())[0]?.document
if (!doc) return

const head = doc.head
if (!head) return

const link = doc.createElement('link')
link.rel = 'stylesheet'
link.id = 'stump-fonts-stylesheet'
link.href = '/assets/fonts/fonts.css'
head.appendChild(link)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@aaronleopold aaronleopold merged commit df74101 into stumpapp:develop Aug 24, 2025
7 checks passed
@Arklaum Arklaum deleted the font-dropdown branch August 25, 2025 10:03
@Arklaum
Copy link
Contributor Author

Arklaum commented Aug 25, 2025

I think this is an artifact of epub.js, so I think it's acceptable

Oh I see. I was testing out an implementation of foliate-js because of my Japanese book issues and it didn't flicker.

foliate-js.mov

@aaronleopold
Copy link
Collaborator

aaronleopold commented Aug 25, 2025

I think this is an artifact of epub.js, so I think it's acceptable

Oh I see. I was testing out an implementation of foliate-js because of my Japanese book issues and it didn't flicker.
foliate-js.mov

My browser doesn't want to show me that video for whatever reason, but I'll trust you 😅 I haven't explored foliate-js, epub.js has been a headache to work with in the past. The mobile app will likely use readium since they have native toolkits, so I had loose plans to explore that for web at some point. If it's an area of interest you're welcome to try and port the reader to either, at the end of the day if it can support highlights/annotations, epubcfi-based progress tracking, etc, and provides a better experience, it's a win

I would ask that you base it into breaking/sea-orm though so conflicts are more manageable for that larger-scale of a change

@aaronleopold aaronleopold mentioned this pull request Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] EPUB Font controls do not effect book contents

2 participants