-
Notifications
You must be signed in to change notification settings - Fork 95
add css file selection menu for crengine #721
Conversation
Do you see some reason for user to switch stylesheet on the fly? |
@Nupogodi Welcome back. The only reason mentioned so far was the ability to toggle hyphenation on and off. Do you think it would be better to implement this (hyphenation control) as a separate toggle instead? Or maybe you have an altogether different better idea? |
It seems that font-family property in stylesheet is overwritten by selected font. And the
And I think it's better to use CSS shipped with the EPUB file by default and leave the freedom of choosing pre-defined CSS to users. |
I'm not exactly back (not enough time and inspiration to learn new KPV features), just a curiosity about the reason to switch css's. Hyphenation? Some time ago I've already introduced some corrections allowing me to select between "no hyphenation", "algorithmic hyphenation" (universal method -- it works properly with Russian texts, but gives terrible results when applied to, say, German books) and tex-dictionaries available in crengine distribution -- iirc, in crengine/data/hyph. I'm not sure whether this way is right or wrong, but it works somehow. |
@chrox, font-family overwritten by selected font is somehow expected. I guess the setting in css should has lowest priority. Using the embed CSS is indeed the right thing to do, I totally missed that ;p Will check this on weekend. @Nupogodi , long time no see ;p Currently for me the most useful thing of switching css is to adjust indent. One of my book is rendered with very large indent, which looks very uncomfortable. |
@houqp , iirc, crengine generally allows to switch on/off the embedded styles -- did you try to toggle them via self.doc:setEmbeddedStyles(...) ? static int setEmbeddedStyles(lua_State L) { |
@Nupogodi , aha! That's what I am looking for :) Thanks a lot, will test it tonight. |
@Nupogodi , this feature was suggested by me because KPV was using its own css for all epubs, so that single css will not have best result for these different configurations:
If KPV was using the epub embeded css, this feature may not seemed useful at first. But I think not using embeded css actually is good, because many epubs are not build with best format, or there could always be some settings you don't like, so have some preset css is a easier method. @tigran123 , I think we discussed this before, I also cannot agree about your comment "The real strength and value of KPV is in the PDF and DjVu area, not in crereader." https://github.com/hwhw/kindlepdfviewer/issues/711 |
@houqp, i did not test it, but i suggest that "1" (default value) causes crengine to use the styles embedded into the book, whilst "0" means the external styles (css) |
* now css argument is removed from newDocView call. * when setStyleSheet method cannot read given css file, it clears all the applied style. * add setEmbeddedStyleSheet method.
* now we only use Embedded CSS by default * add toggleEmbeddedStyleSheet methods
OK, the Thanks @Nupogodi Now we only use embedded css by default, and use can change to other css by using the menu and toggle embedded css on/off in the reader config dialog. |
add css file selection menu for crengine
No description provided.