readium / readium-js-viewer

👁 ReadiumJS viewer: default web app for Readium.js library
BSD 3-Clause "New" or "Revised" License
549 stars 186 forks source link

font face and font size features are not working in setting option for epub3 books #738

Closed 575755 closed 3 years ago

575755 commented 3 years ago

Hi,

Currently am working on epub3 books.There we have setting features like font-size,font-face,navigation and themes.Navigation and themes features are working fine but font-size and font-face are not working for epub3 books . (Note: But these all features are working for epub2 books.) Can anyone suggest me how to resolve this issue:

We are using these following readium functions for font-size and font-face : For Settings >>> ReadiumSDK.reader.updateSettings(readerSettings); updateFontFace() , updateFontSize()

danielweck commented 3 years ago

I would suggest opening the "web inspector" (i.e. browser engine debugger) when one of the publication's HTML documents is rendered, and I would look for style elements inside the DOM, and I would check the CSS cascade to see why the Readium-injected styles are not taking precedence over the authored styles (something to look out for: the specificity of CSS Selector).

sneha-s24 commented 3 years ago

Hi Danielweck,

I checked in readium library for pre-paginated epub content applyBookStyles method is not calling.In case of epub2 it is adding a style tag in iframe head *** which is applying these settings.That's why font face is not changing in case of ebub3. Same content I have checked in readium chrome extension too, there also it is not working.

danielweck commented 3 years ago

That is the correct behaviour. Authored styles are untouched in "pre-paginated" EPUBs (aka Fixed Layout / FXL publication), due to their graphical / visual nature. In you application, you are of course free to customize the Readium code, in order to remove this design restriction. But bear in mind that normally reading systems preserve publisher styles in FXL EPUBs.