Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 04-28-2017, 11:16 AM   #1
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
text-indent sets in 'pt'

Hello,

I noticed today that some of my epubs which have text-indent css set in with 'pt' values are not indented at all. When switched to 'em' or 'px' values, indentation is displayed correctly.

is it a known bug ? I check with https://github.com/koreader/koreader/issues/2715 but doesn't seems related.
cramoisi is offline   Reply With Quote
Old 04-28-2017, 11:48 AM   #2
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,619
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Yes, it's a known bug: https://github.com/koreader/koreader/issues/1010

pt isn't recommended for on-screen display but obviously the present situation is rather stupid regardless. The browser method of 1em = 12pt = 16px = 100% seems like a fairly reasonable default even if it's technically against the spec because px is a relative value while pt is absolute. I suspect it's currently undefined in order to wait for a proper solution, which is something we'd probably be able to do as well.

So the simple solution: pt_value/12*base_px

The complex solution (but possibly not that complex): use DPI to actually calculate the physical size of 12pt — however, on devices like cellphones doing so would actually result in an inferior experience… which is of course why pt isn't recommended for on-screen display in the first place. So I think the easier solution actually sounds best.

Edit: actually looking at it a bit more I think hwhw might've been mistaken

https://github.com/koreader/crengine...rend.cpp#L1876 seems to do what I suggest

In that case the issue must be something slightly different.

Last edited by Frenzie; 04-28-2017 at 11:57 AM.
Frenzie is offline   Reply With Quote
Old 05-10-2017, 01:53 AM   #3
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
Any help to create a regex for calibre to replace in all css a string like this ?

text-indent: 'ptvalue'pt; with text-ident: '??'em
with '??' = pt_value/12*base_px for the value ?

(i don't know if it's possible to calculate in a regex)
cramoisi is offline   Reply With Quote
Old 05-11-2017, 04:37 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You dont use regex for that you use the the Look & Feel->Transform styling section of the conversion dialog. There you can create rules to make the changes you want, including multiplication, addition, etc.
kovidgoyal is online now   Reply With Quote
Old 05-11-2017, 04:50 AM   #5
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
Oh, i forgot about this option ! thanks !
cramoisi is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible bug with negative text-indent? ShellShock Marvin 5 02-21-2017 06:31 PM
Text Indent copaw Editor 10 11-09-2014 11:44 AM
Cannot get rid of text-indent dawood Conversion 3 10-21-2013 10:10 PM
How do you turn off default text-indent <p> in Nook DAntkowiak Barnes & Noble NOOK 9 07-11-2013 10:43 AM


All times are GMT -4. The time now is 03:59 AM.


MobileRead.com is a privately owned, operated and funded community.