Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 03-27-2020, 11:50 PM   #1
candyfloss
Junior Member
candyfloss began at the beginning.
 
Posts: 7
Karma: 48
Join Date: Jan 2011
Device: Nook Glowlight 3
AO3 epub, embedded font removal problem

Hello everyone! I have a problem that googling didn't really yield much help... I primarily use my ereader for organizing my fanfic collection; I use a Nook Glowlight 3 and use Calibre Companion to sync my Calibre library, and I use Archive Of Our Own (AO3)'s epub download feature for most of my fic. It's pretty perfect for my use, except I haven't been able to find a good solution to this: AO3's epub formatter automatically adds in a font-family: serif; to the style classes that format the blocks of text.

I know this forum feels a certain type of way about embedded fonts and I'm no different. So I went about deleting them from the book files like this:
  1. open with Calibre's Book Editor
  2. use a saved search for "font family: serif;" to find and replace with "" (nothing)
  3. Tools > Beautify all files to remove the empty line left from replacing with nothing
  4. save and exit

I went through 18 files before I stopped to check how the progress was looking on my nook and realized that only some had been stripped successfully, others had not. Upon doing a little trial and error the ones that had been successfully stripped were files I had never accessed on CC before; the ones I had accessed previously, whether or not I manually changed the font in my ereader, were not stripped. My theory is that accessing the file in CC generates meta data of some kind that is messing with the font.

So my question is... how do I work around this??? My goal ultimately is to strip these files of embedded fonts so that they load in whatever my ereader's default font is set to. Btw I had also tried the Modify ePub plugin but because it searches for font-face it doesn't pick up the font-family used in these AO3 epub files. I'm still quite the newbie at Calibre so any advice or thoughts are helpful. TIA!
candyfloss is offline   Reply With Quote
Old 03-28-2020, 02:43 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
just remove the whole line instead of leaving a nil
font-family: .+?\;

But EMBEDDED fonts have @font-face {... }
The font-family in the rest of the places, just connects the pieces together

So the real questions are
1) Turning off "Publishers styling" (or similar naming) does not accomplish the VISUAL goal?

2) Do you really want to destroy all typeface manipulation within the book?
serif, sans-serif, monospaced, slanted may convey story elements,
and the sign said: KEEP OUT
theducks is offline   Reply With Quote
Old 03-28-2020, 04:53 AM   #3
candyfloss
Junior Member
candyfloss began at the beginning.
 
Posts: 7
Karma: 48
Join Date: Jan 2011
Device: Nook Glowlight 3
Quote:
Originally Posted by theducks View Post
just remove the whole line instead of leaving a nil
font-family: .+?\;

But EMBEDDED fonts have @font-face {... }
The font-family in the rest of the places, just connects the pieces together

So the real questions are
1) Turning off "Publishers styling" (or similar naming) does not accomplish the VISUAL goal?

2) Do you really want to destroy all typeface manipulation within the book?
serif, sans-serif, monospaced, slanted may convey story elements,
and the sign said: KEEP OUT
I'll use that search string moving forward, but it still doesn't delete the now-empty line. Should I still be using "Beautify all files" afterwards to get rid of the empty line? (I wasn't sure if leaving empty line breaks in was affecting it somehow.)

I will also clarify, the font-family: serif; is part of a style class. I'm unable to edit the OP with this but here is the unedited stylesheet.css:

Spoiler:
Code:
.byline {
    display: block;
    text-align: center
    }
.calibre {
    display: block;
    font-size: 1em;
    padding-left: 0;
    padding-right: 0;
    margin: 0 5pt
    }
.calibre1 {
    display: block
    }
.calibre2 {
    font-weight: bold
    }
.calibre3 {
    display: block;
    font-weight: bold;
    margin: 0
    }
.calibre4 {
    display: block;
    margin: 0 0 1em 1em
    }
.calibre5 {
    display: block;
    margin: 0 0 0 1em
    }
.calibre6 {
    display: block;
    font-size: 1.41667em;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
    margin: 0.67em 0
    }
.calibre7 {
    display: block;
    margin: 1em 0
    }
.calibre8 {
    display: block
    }
.calibre9 {
    font-style: italic
    }
.message {
    display: block;
    text-align: center;
    margin: 1em 0
    }
.tags {
    display: block;
    padding: 0;
    border: currentColor none medium;
    margin: 1em 0
    }
.toc-heading {
    display: none;
    font-size: 1.41667em;
    font-weight: bold;
    line-height: 1.2;
    margin: 0.83em 0
    }
.userstuff {
    display: block;
    font-family: serif;
    padding: 0;
    margin: 1em
    }
.userstuff1 {
    display: block;
    font-family: serif;
    padding: 0
    }
.userstuff2 {
    display: block;
    font-family: serif;
    padding: 0;
    margin: 1em 0
    }


and here is an xhtml file where the style classes are used:

Spoiler:
Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <meta content="ie=edge" http-equiv="x-ua-compatible"/>
    <title>Inevitable - cellorocket - Rogue One A Star Wars</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <link href="stylesheet.css" rel="stylesheet" type="text/css"/>
<link href="page_styles.css" rel="stylesheet" type="text/css"/>
</head>
  <body class="calibre">
<div id="preface" class="calibre1">
<div class="calibre1">
<h1 class="calibre6" id="calibre_pb_1">Inevitable</h1>
    <div class="byline">by <a href="http://archiveofourown.org/users/cellorocket/pseuds/cellorocket" rel="author">cellorocket</a></div>
      <p class="calibre7">Summary</p>
      <blockquote class="userstuff"><p class="calibre7">He had the kind of face you saw everywhere, and nowhere at the same time – so unremarkably average that it was almost suspicious. But he knew how to wear it, knew how to be a thousand different things; whatever the mission required. Though he often disappeared into whatever role he was assigned, sometimes she saw glimmers of an emotion she couldn’t read ripple over those strangely common features, and knew it had no place in a liar’s arsenal of masks.</p><p class="calibre7"><i class="calibre8">Sad eyes,</i> she thought, shivering. <i class="calibre8">He can’t hide those.</i></p></blockquote>

      <p class="calibre7">Notes</p>
        <blockquote class="userstuff"><p class="calibre7">I have to start this off with a confession: I absolutely loved the ending to Rogue One. I thought it fit the tone of the story and conflict perfectly. But I'm also super fascinated by Jyn and Cassian's Connection and really wanted to write about it. Thus; delusion.</p><p class="calibre7">some kind generous souls have posted gorgeous art to tie into my fic so i've compiled them here. thank you so much!! &lt;3<br class="calibre1"/><b class="calibre2"> <a href="https://bossard.tumblr.com/post/156358351217/spacepandar-ive-been-reading-this-rebelcaptain" rel="nofollow">x</a> <a href="https://bossard.tumblr.com/post/156489053692/after-a-moment-jyn-threw-her-head-back-with" rel="nofollow">x</a> <a href="https://bossard.tumblr.com/post/156891251707/jyn-groped-absently-at-her-neck-only-when-she" rel="nofollow">x</a></b> <a href="https://bossard.tumblr.com/post/157715934417/spacepandar-too-tired-to-follow-the" rel="nofollow">x</a> <a href="https://bossard.tumblr.com/post/158512898732/a-sketch-of-what-i-visualize" rel="nofollow">x</a> <a href="https://bossard.tumblr.com/post/158633400872/she-looked-upset-and-he-didnt-want-to-make-it" rel="nofollow">x</a> <a href="https://bossard.tumblr.com/post/158633419142/it-hurt-to-move-but-he-inched-his-hand-across-the" rel="nofollow">x</a> <a href="https://bossard.tumblr.com/post/158667357202/jyn-closed-her-eyes-and-forced-herself-to-be-as" rel="nofollow">x</a> <a href="https://bossard.tumblr.com/post/158703734142/she-didnt-notice-it-at-first-this-was-not-like" rel="nofollow">x</a> <a href="https://bossard.tumblr.com/post/159228035342/spacepandar-what-do-you-want-bodhi-rook-he" rel="nofollow">x</a> <a href="https://bossard.tumblr.com/post/159377178272/spacepandar-what-little-of-dravens-reserve" rel="nofollow">x</a> <a href="https://bossard.tumblr.com/post/159377194857/spacepandar-im-almost-afraid-to-ask-how-youd" rel="nofollow">x</a> <a href="https://bossard.tumblr.com/post/161199390937/spacepandar-hed-no-sooner-toppled-out-of-the" rel="nofollow">x</a></p><p class="calibre7">(the roguejedi starts up around ch7!)</p></blockquote>


  </div>
</div>


<div id="chapters" class="userstuff1">
      
<div class="calibre1">
  <div class="calibre9" id="calibre_pb_2"></div>
</div>


</div>

</body></html>


1) I couldn't figure out what "Publisher's styling" was referring to, is it a feature in the Book Editor or Calibre's library ?

2) The files I'm formatting don't really use typeface manipulation for story elements, so I wouldn't mind if that was a solution.

Another thing to add to OP: I have tried using Convert Books > Look & feel > Styling > Select what style information you want completely removed: Fonts. It does work on the unaccessed files*, but still no dice on previously accessed files.


*While this seems like a more elegant way of removing font-family: serif; in a way that can be done in batches, this had the side effect of generating a titlepage.xhtml where there wasn't one before, despite selecting "No default cover" under EPUB output
candyfloss is offline   Reply With Quote
Old 03-28-2020, 10:13 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Publishers styling is a Device feature. It means use the CSS
Some devices that is All or Not-a-thing used switch. Some allow some CSS control on top of the devices.
Calibre's viewer allows your choice for DEFAULT generic font classes (image) lik serif... That are used if any other font called is unavailable. eg
font-family: "Rickety Old Typewriter", monospaced;
As you may have observed, many cleaning tools fail once a document has become corrupted by a partial removal of intertwined elements.
Attached Thumbnails
Click image for larger version

Name:	Viewer fonts set.PNG
Views:	223
Size:	6.5 KB
ID:	177983  
theducks is offline   Reply With Quote
Old 03-28-2020, 05:00 PM   #5
candyfloss
Junior Member
candyfloss began at the beginning.
 
Posts: 7
Karma: 48
Join Date: Jan 2011
Device: Nook Glowlight 3
Quote:
Originally Posted by theducks View Post
Publishers styling is a Device feature. It means use the CSS
Some devices that is All or Not-a-thing used switch. Some allow some CSS control on top of the devices.
Calibre's viewer allows your choice for DEFAULT generic font classes (image) lik serif... That are used if any other font called is unavailable. eg
font-family: "Rickety Old Typewriter", monospaced;
As you may have observed, many cleaning tools fail once a document has become corrupted by a partial removal of intertwined elements.
I don't see any feature for Publishers styling, or a similar phrasing, on my Nook GL3 or as an option under the Nook reader (I'm using the stock Nook reader app)...


As for cleaning tools malfunctioning: using Convert to clean up the unwanted font-family: serif; elements even when I have not tried to do so manually still does not work. The problem still only affects files that I have previously opened with CC.
candyfloss is offline   Reply With Quote
Old 03-30-2020, 06:15 PM   #6
candyfloss
Junior Member
candyfloss began at the beginning.
 
Posts: 7
Karma: 48
Join Date: Jan 2011
Device: Nook Glowlight 3
Alright, so I still haven't solved the mystery of what exactly was causing the font to display as serif as the file's "default font" but I figured out a slight workaround: replace all instances of serif in the stylesheets with sans-serif, which is what I read in and what I was having to change the text to. Sometimes the solution is easier than one thinks

I plan on writing into AO3's tech support team to see if they'll consider removing mentions of a default font for their otherwise fantastic epub output template. Cheers
candyfloss is offline   Reply With Quote
Reply

Tags
ao3, archive of our own, font, font display


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with an embedded font on Kobo e-reader hulabula ePub 6 10-03-2019 12:31 PM
Embedded font problem rbruce1314 Sigil 17 07-18-2017 08:30 PM
Embedded font question/problem pmorris Editor 13 05-12-2014 03:19 PM
Embedded font problem Moonraker Sigil 13 05-21-2013 05:33 PM
problem with embedded font ericshliao EPUBReader 2 12-11-2009 10:04 AM


All times are GMT -4. The time now is 04:55 PM.


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