When I compile my book, I have all of my scenes set to compile “as is” to match editor styles. However, this seems to ignore font family changes.
Throughout my book, I have certain paragraphs as well as inline portions of paragraphs where the font changes from the default to KaiTi SC. I need to preserve this change, but Scrivener is completely ignoring it.
I’ve opened the epub’s HTML files and can see that for those paragraphs, Scrivener is just outputting the default styles, i.e. there’s no distinction in the HTML between paragraphs using the default font in the editor and paragraphs whose font was changed to KaiTi SC. There are also no tags in sight to mark places where the font was changed in-line either.
I tried with other fonts and it seems Scrivener only recognizes some fonts, like a change to Courier New will output font-family: monospace, and a change to Arial Black will output tags, but other fonts like Helvetica or the one i’m using (KaiTi SC) might as well not exist because they make no changes to the output.
Helvetica is likely the default font for your epub, so that explains why no tags for that.
Fonts need to be available on-device in order for an e-reader to render them. Once you get past a small family of stock fonts, this means your additional font must either be installed on the user’s device or embedded. Guessing that KaiTi SC is in this latter category. Might be a relevant fact.
Hopefully someone with actual knowledge will come by soon!
If I remember rightly, KaiTi SC is a stock simplified Chinese font on the Mac, along with SongTi SC (an equivalent of TNR or Serif for Chinese) and PingFang SC (the equivalent of Helvetica or Sans Serif); I’ve had them on my various Macs for so long that I can’t remember. Windows has completely different default fonts.
On my iPhone and iPAD, the only Chinese fonts are the PingFang series. I do have access to Android devices, but I’ve never investigated fonts on them; and Kindle, Kobo, etc are yet another question.
All that said, I think you need to make either a “Chinese” paragraph style, and or a separate Chinese character style, and edit the compile format to include those styles. I haven’t worked with ePub, but I would think if you do that it should result in a <p class="Chinese"> or <Span…> definitions in the ePub. But test it out with PingFang SC, because that is the most likely font to be on your target device .
Embedding fonts or non-standard fonts does not quite get to what the issue is. If I edit the epub manually (by modifying the xHTML files) and add “font-family: KaiTi SC;” styles to the correct parts of the text, it will display as it should on my ereader (the Books app).
The problem is that Scrivener’s epub output is not tagging these paragraphs and inline-text at all. The output epub’s paragraph markup (the < p > tags) looks the same for both a normal paragraph (default font) and one that was set to KaiTi in the editor.
I don’t need Scrivener to embed a font, I just need it to output the epub with the KaiTi paragraphs correctly tagged as such (or as something anything different from a regular paragraph, so that I can at least do a find and replace on the markup…). As it stands right now, the fact that these paragraphs have a non-default font on the editor is lost information, not reflected anywhere in the markup at all.
I could have made a paragraph and character style, in retrospect, I will keep trying to see if there’s anything else I can do though, as that would require a significant amount of additional editing.
It certainly seems like an epub reader should fail gracefully if a css tagged font is not installed or embedded, so I don’t know why Scriv would not just tag your fontified text ranges — even if the font is not epub-standard and even if Scriv doesn’t do embedding and Scriv thinks that would have to be embedded to be generally shareable.
FWIW, I think you could probably search-by-format for all the Kaiti text spans in order to apply a custom character style, so it could be made fairly short work of. That way, as you know, the style could be set in your compile format so as to add the css wrapper you want.
Unfortunately, I tried and it doesn’t seem like search by format supports searching specifically by Font…
I’m getting a bit concerned because I have 3 whole books like this that I have now finished writing and want to compile (adding up to over 1 million Chinese characters).
It just feels like the “as is” compile option should really be “as is” (or there should be another option to preserve all editor formatting). I did try Format>Preserve Formatting for the entire manuscript, and it still didn’t really preserve the font family changes.
Further to @sobs suggestion, I made a trial compile of a text containing a brief section of English and another of Chinese to RTF, opened it in Nisus Writer Pro where I could mark the Chinese text as being Chinese (unlike NWP Scrivener cannot apply language marking directly). I then exported it to ePub from NWP… when opened in Books the Chinese comes out perfectly. Here it is… you’ll need to unzip first.
Done it very quickly. I created a new Scriv project, imported the RTF I had, didn’t even create the Chinese character style, then compiled to ePub without editing the default compile format. It opened flawlessly in Books. This .zip contaoins the mini Scriv project and the resulting ePub.
Thanks guys, compiling to RTF then to epub using Pages worked great. The font changes were preserved. I lost the table of contents and some structure but that’s good enough for now!