View Single Post
Old 10-30-2019, 01:55 PM   #3788
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,041
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Okay, Kovid didn't like my tweak settings idea for addressing the cover font sizing issue. Instead, he added code to Calibre for a different solution while also suggesting another different approach based on viewport relative size units.

So, here are the suggested options for dealing with the issue raised by Anyssia.

Cover Image

Perhaps the most logical solution is to create an actual cover image. Calibre has a graphical cover generating feature as well as the Generate Cover plugin, both of which can be extensively configured and automatically called from FanFicFare.

Render Page Size

Kovid has added a feature to appear in the next version of Calibre that allows you to put a render size and margins as metadata in the html of the title page using a <meta> tag such as <meta name="calibre-html-render-data" content='{"size": "A6", "margins": [5, 0, 5, 0]}'/>

It could be included after next Calibre update in all your future downloaded title pages in FFF like so:
Spoiler:
Code:
[epub]
titlepage_start:<?xml version="1.0" encoding="UTF-8"?>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title>${title} by ${author}</title>
 <link href="stylesheet.css" type="text/css" charset="UTF-8" rel="stylesheet"/>
 <meta name="calibre-html-render-data" content='{"size": "A6", "margins": [5, 0, 5, 0]}'/>
 </head>
 <body>
 <h3><a href="${storyUrl}">${title}</a> by ${authorHTML}</h3>
 <div>

But this doesn't work until the next Calibre version is out.

Viewport Relative Font Size

Kovid also pointed out that there are now CSS units that scale relative to viewport size(search for vw, vh, etc) that can be used for font size.

This has the advantage of not needing to wait for the next Calibre version to use and possibly also affecting your book reader.

It also has the disadvantage of possibly affecting your book reader. vw/vh/vmin/vmax are CSS3 and may cause problems to the point that: "Some reader programs are very finicky about CSS stylesheets and will ignore the whole sheet if there is an error. ..."

Right now, it looks like the Calibre convert to AZW3 (for Kindle readers) discards the vw/vh/vmin/vmax sizes for that reason.

It could be included right now in all your future downloaded title pages in FFF like so:
Spoiler:
Code:
titlepage_start:<?xml version="1.0" encoding="UTF-8"?>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title>${title} by ${author}</title>
 <link href="stylesheet.css" type="text/css" charset="UTF-8" rel="stylesheet"/>
 <!-- meta name="calibre-html-render-data" content='{"size": "A6", "margins": [5, 0, 5, 0]}'/ -->
 </head>
 <body style="font-size: 3.3vmax;">
 <h3><a href="${storyUrl}">${title}</a> by ${authorHTML}</h3>
 <div>


Conclusion?

Right now, my favorite is the viewport relative font size.

But it does highlight that I haven't done anything in past to make it easier to selectively apply CSS to FFF's generated output. I'll probably be adding HTML class attrs to various tags in a test version shortly. Then a much shorter add_to_output_css setting could be used instead of titlepage_start.

Opinions?
JimmXinu is offline   Reply With Quote