Let's embed fonts into non Western ePub books of choice!



+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 38
  1. #1
    Tom Sawyer
    Join Date
    Dec 2009
    Posts
    146

    Default Let's embed fonts into non Western ePub books of choice!

    Hey all,

    Since the arrival of my nook I've had enough time to play with it, get the softroot up and running and explore the device. However while I myself prefer to read content like books, rss feeds and what not in English it was my mom that pushed me to sort it out how one can get their non Western language content displayed on the nook (Cyrillic in our case).

    The original problem is that the reader app comes with and operates three fonts that are meant to provide glyphs for Western languages: while you can see your book titles in the listing due to Android OS being UTF-based and having corresponding fonts to display glyphs of your content's language on-board when opened you'd be facing a nice mess of questions instead of expected characters unless.. your ebook comes in with embedded fonts and corresponding style declarations which tell nook's reader app to use them instead of built-in fonts. However it may not always be the case so what's up then? A temporary workaround - till this gets addressed by BN - is to manually embed fonts having specific glyphs into your content and override reader's fonts selection by playing with stylesheet declarations. Since ePub is the format of choice for the most of us - at least I tend to believe in that - let's see what we can do with this idea as a starting point.

    First off let's presume you enjoy benefits of using Calibre as much as I do. By the way you can check this useful thread by our very own Klaatu.
    Secondly lets stand on the grounds you have experienced the need to visit any program's preferences menu and did something there
    And in the last but not the least important place let's consider your content is stored in UTF-8. If the latter isn't true you have to do the conversion prior to proceeding.

    Embedding your fonts into ePub automatically using Calibre
    • 1. Download Calibre for your OS (Win/Lin/Mac) and install it;
    • 2. Download the attached plugin file (originally from Paul Tomashevskyi, GPL, see MobileRead thread)
    • 3. Install it via Calibre's Preferences> Plugins: provide the path to the downloaded plugin and click "Add" button;
    • 4. Check that it has appeared in the list of plugins at File type plugins branch under EPUB Font embedding plugin name and it's enabled (which is a default behavior on plugin addition);
    • 5. Now open Preferences> Conversion> Look & Feel and add the following CSS declaration into Extra CSS area:
    Code:
    body {
    	font-family: "Liberation", sans-serif;
    }
    • This will tell Calibre that we want to use "Liberation" font family we're going to embed into converted ePub content and it will add the font-family into own styles when it parses your ePub contents;
    • 7. Add your content - which lacks embedded fonts and CSS declarations OR its embedded fonts aren't capable of providing glyphs for our UTF codepoints - into Calibre's library;
    • 8. Select (or highlight) the content in the library list;
    • 9. Proceed with the next toolbar icon and its option: Convert E-Books> Convert individually;
    • 10. Set input format and output format to EPUB;
    • 11. Check Look & Feel and that Extra CSS area contains what's been specified in (5) (On Windows it was okay while under Ubuntu it took a couple of restarts for the defaults we set in (5) to pop up on actual conversions in the app: dunno, guess I did something dead wrong);
    • 12. Click OK.

    Your ebook gets converted into EPUB and we end up having a set of Calibre's own UTF aware fonts (Liberation, serif set) embedded into it with corresponding stylesheet declarations of the latter and inclusion into book's manifest file plus (5) will make Calibre to define our font-family as the default one when it parses / creates css style declarations used throughout ebook files. Thus the reader app will ultimately use the embedded font rather than trying to apply its built-in one. Beware that this plugin will run always when conversion to ePub takes place unless it's disabled (Preferences> Plugins> File type plugins> EPUB Font embedding plugin, enable/disable). If you'd like to disable it also remove Extra CSS code (undo 5).

    Well, what to add.. If you find the Liberation font-family unsuitable for you due to any reason (either subjective as to its fonts looks or being not able to provide support for your UTF codepoints) there are good news too.

    Changing the font family to be embedded
    • 1. Google for free font types that do support your native language (please make sure they are free to use: for example see wiki's List of Unicode Fonts, License column; remember they must be UTF ones);
    • 2. Download them;
    • 3. Create a directory with a name that stands for the downloaded font family name into Calibre's fonts directory. Please make sure to provide the name in lowercase;
    • 4. Put the fonts in newly created directory;
    • 5. Amend Python file zipped into the attachment (plugin) where change variables' values that declare font family (fontFamilyName) and fonts themselves to point to your ones (fontRegularName, fontItalicName, fontBoldName, fontBoldItalicName);
    • 6. Save changes into the plugin's zip file;
    • 7. Add the plugin to Calibre;
    • 8. Don't forget to amend (or add) Extra CSS (step 5 in above guide) declaration to point to your new font family:
    Code:
    body {
    	font-family: "{fontFamilyName}", sans-serif;
    }
    • where {fontFamilyName} = value of the variable we set in (5).

    I understand that this little how-to is written by a guy who is in no way a pro in understanding standards in their full extent so there may be errors, misconceptions and caveats but as so far it's been working for me I decided to share it with you fellows. Summarizing, there are ways to play around current situation with content provided in non Western languages on Nook. You can embed different fonts that work for you and enjoy reading anything you'd like on our favourite device.

    Have a good one and feel free to correct my bads or post any suggestions!

    LATEST UPDATE
    Updated the post with small caps solution, attached specifically updated CalibrePlugin_LibertineFontFamily_SmallCapsInclude d.zip to this post and here's the link to packed free Libertine font-family archive (includes small-caps font; it's on my Dropbox so it's on the net while the service's up, fingers crossed). On a second though, here's the mirrored plugin. Once again, thanks to denijane for pushing the lazy me to do this.

    UPDATE 3
    Please note that it's common that chapter titles are given in capitals. Some may use font-variant:small-caps; CSS property which produces the desired effect however it also implies that your font must support small caps. Which isn't the case with Liberation font family, so you'd see unknown character [?] instead of chars. Thanks to denijane for bringing this up.

    UPDATE 2
    Adobe Mobile Reader doesn't support right-to-left directive, so those of us with Arabic or Hebrew books are out of luck (PDF will do but no ePub).

    UPDATE 1
    myNook.ru - another custom firmware
    Those willing to get a softroot on and running may grab one from myNook.ru - these guys have altered the original firmware's paths for fonts and placed them on the nook's internal card's FAT32 partition (e.g. the one you see when you connect your Nook to your Mac/PC via USB).

    - That's great and all, but what's in for me?
    - Well, no more hassle with embedding / pointing to the fonts on per book basis, you have three font folders over the nook's drive located in my fonts folder and these are the very same fonts used by the reader app. You can replace them with any (free) UTF8 capable .ttf fonts to your heart's content

    Links
    Current Version (v1.5.1, based on official v1.4) (Google Translate)
    myNook.ru / Firmware Section (Google Translate)

    Less font-wise, they've got - eye-candy looks, nice apps, correct approach at the whole customizing thing - cookies!

    P.S. Thanks to our mem, lamzor, for the tip
    wbr,
    Vad

  2. Remove Advertisements
    B&N Nook Forum
    Advertisements
     

  3. #2
    Puck
    Join Date
    Feb 2010
    Posts
    303

    Default Re: Let's embed fonts into non Western ePub books of choice!

    I don't know that much about fonts past whether or not I happen to like how they look. If you used a font that supported non western characters would it also still be able to display English characters properly?

    For instance, if you were going to be travelling and wanted to create a reference of common Russian words or phrases with translations. Would it be able to display both sets of characters properly in one document?

  4. #3
    Tom Sawyer
    Join Date
    Dec 2009
    Posts
    146

    Default Re: Let's embed fonts into non Western ePub books of choice!

    Absolutely.
    Historically English (Basic Latin) characters are present in any codetable (0 .. 127) and UTF preserved that too, thus any Unicode font will have them by default.
    See Unicode Typefaces for better understanding of supported languages.
    wbr,
    Vad

  5. Remove Advertisements
    B&N Nook Forum
    Advertisements
     

  6. #4
    Thing 1 Klaatu's Avatar
    Join Date
    Oct 2009
    Posts
    2,716

    Default Re: Let's embed fonts into non Western ePub books of choice!

    This is an excellent post on how to do this. However I would like to point out that you should make sure you have the rights to use the font-face you are embedding in the .epub file. Not all font-faces are free to use and may be commercial or otherwise copyrighted intellectual property.

    We always want to encourage folks to respect intellectual property on this board.

    Regards,
    Michael
    'Not all who wander are lost.'
    ~ J.R.R. Tolkien

    CURRENTLY READING: A Dance with Dragons by George R.R. Martin

  7. #5
    Tom Sawyer
    Join Date
    Dec 2009
    Posts
    146

    Default Re: Let's embed fonts into non Western ePub books of choice!

    Thanks Michael!
    I've edited the original post and put additional emphasis on this.
    wbr,
    Vad

  8. #6
    Thing 1 Klaatu's Avatar
    Join Date
    Oct 2009
    Posts
    2,716

    Default Re: Let's embed fonts into non Western ePub books of choice!

    Quote Originally Posted by sPACEYE
    Thanks Michael!
    I've edited the original post and put additional emphasis on this.
    Thanks!

    Regards,
    Michael
    'Not all who wander are lost.'
    ~ J.R.R. Tolkien

    CURRENTLY READING: A Dance with Dragons by George R.R. Martin

  9. #7
    Mowgli
    Join Date
    Dec 2009
    Posts
    55

    Default Re: Let's embed fonts into non Western ePub books of choice!

    Thanks for your comprehensive how-to. There is another option to embed font.

    If you can somehow convert your original documents into MS Word, you can use "Atlantis" word processor (shareware) to create an ePUB book with embedded fonts and then add the ebook to Calibre without further conversion (or choose to copy it directly to your Nook).

    You format and choose whatever fonts inside Atlantis word processor, and save as ebook (ePUB) with embedded font option. This won't require any complicated technical skill.

    (Avoid any commercial fonts, use free fonts)

    For me, even I embed Thai fonts into the ePUB, Nook can display readable Thai, but it won't wrap sentence/paragraph to fit the screen. Every paragraph will display as one single line; so I can see only small part of each paragraph. This is not limitation of Nook, it is the Adobe ADE software which Nook use to render ePUB.

    My only solution now for Thai ebook is to create it as PDF.
    Chote
    iPhone3G, KooNooK, Astronomy
    http://twitter.com/chotechai
    http://www.flickr.com/photos/Europacafe

  10. #8
    Tiny Tim
    Join Date
    Dec 2009
    Posts
    20

    Default Re: Let's embed fonts into non Western ePub books of choice!

    thank you, thank you, thank you so much !

    This is exactly what I was looking for ! I have large amount of books in Slovak and Czech and now I can finally read them on my nook. The only issue I am having is that calibre is not remembering the extra css code, I have to enter it each time manually. But other than that it works like a charm ! Thanks again

  11. #9
    Tom Sawyer
    Join Date
    Dec 2009
    Posts
    146

    Default Re: Let's embed fonts into non Western ePub books of choice!

    Quote Originally Posted by bthoven
    Thanks for your comprehensive how-to. There is another option to embed font.
    ...
    My only solution now for Thai ebook is to create it as PDF.
    You're welcome!
    I feel sorry for you mate. At first I did try to convert a book in Cyrillic into PDF but the problem was that font size selection worked oddly: like selecting a larger font resulted into very small font size and it simply couldn't satisfy me - that's why I decided to dig into ePub direction. Though maybe you will be able to overcome this long paragraphs which go out of nook's screen boundaries if there is an option to do that within Calibre.. like somehow limit the paragraph size - I bet you can do that using proper CSS declaration (also CCS Extra: p {width: %value% px/pt/em}) granted Thai symbols occupy some definite amount of screen space - sorry if I sound lame as I've never ever played with anything besides Latin / Cyrillic).
    wbr,
    Vad

  12. #10
    Tom Sawyer
    Join Date
    Dec 2009
    Posts
    146

    Default Re: Let's embed fonts into non Western ePub books of choice!

    Quote Originally Posted by gulo
    thank you, thank you, thank you so much !

    This is exactly what I was looking for ! I have large amount of books in Slovak and Czech and now I can finally read them on my nook. The only issue I am having is that calibre is not remembering the extra css code, I have to enter it each time manually. But other than that it works like a charm ! Thanks again
    It's my pleasure (i njama za szto)!

    As for Extra CSS - make sure you have it set in global Calibre's Preferences at first (Preferences> Conversion> Look & Feel: Extra CSS). Like I mentioned in the original post it took me a couple of app restarts under Ubuntu to make it appear on individual ebook Conversion screen, though no such problem was met under Windows. Once again presuming this piece of app's code is all the same under different platforms it's quite strange. Well, try to tick some option at that Look & Feel screen of the Global Preferences and later untick it - maybe this will trigger the code to be read and set later on actual conversion. I recall I set "UTF-8" for Input character encoding.
    wbr,
    Vad

+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast

Similar Threads

  1. .epub books from open source
    By phillyohgal in forum original nook
    Replies: 0
    Last Post: 09-27-2012, 01:40 PM
  2. getting ePub books onto nook
    By MEB in forum simple touch
    Replies: 11
    Last Post: 02-15-2012, 05:38 PM
  3. EPUB Formatting: embedded fonts
    By e.Fingerips in forum simple touch
    Replies: 2
    Last Post: 10-14-2011, 09:10 PM
  4. fonts for The Daily and fonts for Reading a book
    By everyman in forum nook Discussions
    Replies: 2
    Last Post: 12-11-2009, 12:45 PM
  5. New Feature: Auto-Embed Videos
    By rachel in forum Forum Tips & Tricks
    Replies: 0
    Last Post: 11-07-2009, 09:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Powered by vBadvanced CMPS v4.1.0