FolioReader / FolioReader-Android

A Java ePub reader and parser framework for Android.
BSD 3-Clause "New" or "Revised" License
2.25k stars 718 forks source link

Do not change the font size and font for added books #243

Closed AsyaLeah closed 6 years ago

AsyaLeah commented 6 years ago

Hi, I'm using the version 0.4.0

In books that are in the application font size and fint is changing but when I add new books it doesn't work. screenshot_1531897833 screenshot_1531897837

hrishikesh-kadam commented 6 years ago

@AsyaLeah Can you please provide EPUB file for investigation?

Also now we have added Issue Template for reporting any issues - https://github.com/FolioReader/FolioReader-Android#reporting-issue

So please fill the template and reply back on same thread.

AsyaLeah commented 6 years ago

is the file tfilat_haderech_ru_ah.zip

i solved it

in file Style.css

It was:

.andada { font-family: "andada", sans-serif; } .lato { font-family: "lato", serif; } .lora { font-family: "lora", serif; } .raleway { font-family: "raleway", sans-serif; }

html.textSizeOne { font-size: 13px !important; } html.textSizeTwo { font-size: 15px !important; } html.textSizeThree { font-size: 17px !important; } html.textSizeFour { font-size: 19px !important; } html.textSizeFive { font-size: 21px !important; }

h1 { font-size: 2em; line-height: 1.2; } h2 { font-size: 1.5em; line-height: 1.2; } h3 { font-size: 1.17em; line-height: 1.2; } h4 { font-size: 1em; line-height: 1.2; } h5 { font-size: 0.83em; line-height: 1.2; } h6 { font-size: 0.67em; line-height: 1.2; } body { word-break: break-word !important; -webkit-hyphens: auto !important; hyphens: auto !important; } p, span, div { font-size: 1em; line-height: 1.5 !important; }

Changed to

.andada, .andada p, .andada span, .andada div { font-family: "andada", sans-serif !important; } .lato, .lato p, .lato span, .lato div { font-family: "lato", serif !important; } .lora, .lora p, .lora span, .lora div { font-family: "lora", serif !important; } .raleway, .raleway p, .raleway span, .raleway div { font-family: "raleway", sans-serif !important; }

.textSizeOne { font-size: 13px ; } .textSizeOnePlus { font-size: 14px ; } .textSizeTwo { font-size: 15px ; } .textSizeTwoPlus { font-size: 16px ; } .textSizeThree { font-size: 17px ; } .textSizeThreePlus { font-size: 18px ; } .textSizeFour { font-size: 19px ; } .textSizeFourPlus { font-size: 20px ; } .textSizeFive { font-size: 21px ; } .textSizeFivePlus { font-size: 22px ; }

h1 { font-size: 2em !important; line-height: 1.2; } h2 { font-size: 1.5em !important; line-height: 1.2; } h3 { font-size: 1.17em !important; line-height: 1.2; } h4 { font-size: 1em !important; line-height: 1.2; } h5 { font-size: 0.83em !important; line-height: 1.2; } h6 { font-size: 0.67em !important; line-height: 1.2; } body { word-break: break-word !important; -webkit-hyphens: auto !important; hyphens: auto !important; } p, span, div { font-size: 1em !important; line-height: 1.5 !important; }

looknear commented 6 years ago

This is a "fix" which is wrong. It is your book specific fix. I suggest you to fix the book and not the engine that opens it. Font face need to effect the global "body" font only. not paragraph specific or special fonts that were set by the book designer. if in other DOM object rather than the body - there is a font define - this not supposed to be override. As a general thumb rule: if you need to add "!important" to your CSS - or you applying it to each object in your DOM separately - you are doing something wrong...

On Sun, Aug 26, 2018 at 12:56 PM AsyaLeah notifications@github.com wrote:

is the file tfilat_haderech_ru_ah.zip https://github.com/FolioReader/FolioReader-Android/files/2321412/tfilat_haderech_ru_ah.zip

i solved it

in file Style.css

It was:

.andada { font-family: "andada", sans-serif; } .lato { font-family: "lato", serif; } .lora { font-family: "lora", serif; } .raleway { font-family: "raleway", sans-serif; }

html.textSizeOne { font-size: 13px !important; } html.textSizeTwo { font-size: 15px !important; } html.textSizeThree { font-size: 17px !important; } html.textSizeFour { font-size: 19px !important; } html.textSizeFive { font-size: 21px !important; }

h1 { font-size: 2em; line-height: 1.2; } h2 { font-size: 1.5em; line-height: 1.2; } h3 { font-size: 1.17em; line-height: 1.2; } h4 { font-size: 1em; line-height: 1.2; } h5 { font-size: 0.83em; line-height: 1.2; } h6 { font-size: 0.67em; line-height: 1.2; } body { word-break: break-word !important; -webkit-hyphens: auto !important; hyphens: auto !important; } p, span, div { font-size: 1em; line-height: 1.5 !important; }

Changed to

.andada, .andada p, .andada span, .andada div { font-family: "andada", sans-serif !important; } .lato, .lato p, .lato span, .lato div { font-family: "lato", serif !important; } .lora, .lora p, .lora span, .lora div { font-family: "lora", serif !important; } .raleway, .raleway p, .raleway span, .raleway div { font-family: "raleway", sans-serif !important; }

.textSizeOne { font-size: 13px ; } .textSizeOnePlus { font-size: 14px ; } .textSizeTwo { font-size: 15px ; } .textSizeTwoPlus { font-size: 16px ; } .textSizeThree { font-size: 17px ; } .textSizeThreePlus { font-size: 18px ; } .textSizeFour { font-size: 19px ; } .textSizeFourPlus { font-size: 20px ; } .textSizeFive { font-size: 21px ; } .textSizeFivePlus { font-size: 22px ; }

h1 { font-size: 2em !important; line-height: 1.2; } h2 { font-size: 1.5em !important; line-height: 1.2; } h3 { font-size: 1.17em !important; line-height: 1.2; } h4 { font-size: 1em !important; line-height: 1.2; } h5 { font-size: 0.83em !important; line-height: 1.2; } h6 { font-size: 0.67em !important; line-height: 1.2; } body { word-break: break-word !important; -webkit-hyphens: auto !important; hyphens: auto !important; } p, span, div { font-size: 1em !important; line-height: 1.5 !important; }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FolioReader/FolioReader-Android/issues/243#issuecomment-416026977, or mute the thread https://github.com/notifications/unsubscribe-auth/AA91x47FbaV8rksd6gPaHwqsrQjJkJ5Xks5uUnDJgaJpZM4VUEi- .

hrishikesh-kadam commented 6 years ago

@AsyaLeah You don't have to change the styling that much. Issue has been fixed by changing font-size unit from em to rem. This fix will get release in next release.

Thanks for submitting the issue and sharing EPUB file.

hrishikesh-kadam commented 6 years ago

@AsyaLeah Issue fix released in v0.4.2

MostafaShiri7071 commented 3 years ago

is the file tfilat_haderech_ru_ah.zip

i solved it

in file Style.css

It was:

.andada { font-family: "andada", sans-serif; } .lato { font-family: "lato", serif; } .lora { font-family: "lora", serif; } .raleway { font-family: "raleway", sans-serif; }

html.textSizeOne { font-size: 13px !important; } html.textSizeTwo { font-size: 15px !important; } html.textSizeThree { font-size: 17px !important; } html.textSizeFour { font-size: 19px !important; } html.textSizeFive { font-size: 21px !important; }

h1 { font-size: 2em; line-height: 1.2; } h2 { font-size: 1.5em; line-height: 1.2; } h3 { font-size: 1.17em; line-height: 1.2; } h4 { font-size: 1em; line-height: 1.2; } h5 { font-size: 0.83em; line-height: 1.2; } h6 { font-size: 0.67em; line-height: 1.2; } body { word-break: break-word !important; -webkit-hyphens: auto !important; hyphens: auto !important; } p, span, div { font-size: 1em; line-height: 1.5 !important; }

Changed to

.andada, .andada p, .andada span, .andada div { font-family: "andada", sans-serif !important; } .lato, .lato p, .lato span, .lato div { font-family: "lato", serif !important; } .lora, .lora p, .lora span, .lora div { font-family: "lora", serif !important; } .raleway, .raleway p, .raleway span, .raleway div { font-family: "raleway", sans-serif !important; }

.textSizeOne { font-size: 13px ; } .textSizeOnePlus { font-size: 14px ; } .textSizeTwo { font-size: 15px ; } .textSizeTwoPlus { font-size: 16px ; } .textSizeThree { font-size: 17px ; } .textSizeThreePlus { font-size: 18px ; } .textSizeFour { font-size: 19px ; } .textSizeFourPlus { font-size: 20px ; } .textSizeFive { font-size: 21px ; } .textSizeFivePlus { font-size: 22px ; }

h1 { font-size: 2em !important; line-height: 1.2; } h2 { font-size: 1.5em !important; line-height: 1.2; } h3 { font-size: 1.17em !important; line-height: 1.2; } h4 { font-size: 1em !important; line-height: 1.2; } h5 { font-size: 0.83em !important; line-height: 1.2; } h6 { font-size: 0.67em !important; line-height: 1.2; } body { word-break: break-word !important; -webkit-hyphens: auto !important; hyphens: auto !important; } p, span, div { font-size: 1em !important; line-height: 1.5 !important; }

In some pages the font is not applied and in some pages it was applied, which solved my problem