View Full Version : ePub custom Fonts on all Sonys


Pages : 1 [2]

Hedaya
07-29-2011, 09:26 AM
Actually, I saw on another thread where they made it work with the same technique: http://www.mobileread.mobi/forums/showthread.php?t=75191.

but I posted on both b/c I can't get it to work and figure it's me.

jackie_w
07-29-2011, 12:19 PM
@Hedaya,

I'm not a Nook owner so I can't be more specific but it's probably just a case of getting the blue bit right.
src: url(res:///Data/font/tradbdo.ttf)

On a Sony the directory where the .ttf files are stored is res:///Data/font/, but to a Windows user it looks like [Drive:]\font in Sony internal memory.

I have skimmed the thread you referenced. It is not clear what the Nook equivalent is, as one user places the ttf files on an SD card and another refers to res:///system/fonts as a system embedded font, presumably meaning a Nook standard directory for storing system font files. There is also a reference to res:///system/media/sdcard

When you connect your Nook do you see a directory in internal memory called [Drive:]\system\fonts or [Drive:]\fonts? Only another Nook owner can give you the definitive advice on the above.

Another potential problem is that the epub you are testing has something in its internal css which is stopping your customized fonts from displaying correctly. I'm attaching a very simple test epub which will definitely work with your custom fonts if you get the above sorted out. I use it whenever I'm trying out a new font.

khin99
08-03-2011, 01:42 AM
Jackie_W,
I own both sony and nook and have rooted them. On nook it is [Drive:]\fonts although i have to open a new folder. What I have done is copy the fonts I wish to use into this folder and the Droid suite of fonts. I have tried many embeds different css and manual converts. Some work but some do not. So I have found that one user has changed his desired font name to DroidFallBack after renaming the DroidFallBack to something else. This idea worked very well with me but of course it is only good for one font. If you want to use another you will have to do it all over again. I am using the Burmese Zawgyi-One font and it works for all epub with this font. But Burmese comes in two three other popular fonts and I am still struggling.
Hedaya you could try this if you wish.

kado
12-29-2011, 05:21 PM
Hi Jackie_W,

I too have a Nook Standard (1st edition) and killing myself to achieve an epub to epub font conversion as explained in the posts 9 and 18, even though it was written for Sony readers. I think I managed to narrow down the reasons for my failure to two, which are:
1) Either the font I use do not contain any regional language support, in my case it is Turkish
2) Or, as you pointed out in your post #252, the blue bits are not correct for my Nook.

When I connect my Nook, I see nook as a new drive and when I double click I see all folders inside. There are a "my fonts" folder to which I believe all new fonts should go. However, I tried almost all possibilities but failed to correctly identify inner folder structure for N1E to locate my fonts. Still not sure what to type there.

As for the correct font, I am still not sure if the fonts I use support non-western characters, perhaps that's the reason why I see "?" in the epub I created with Calibre.

Actually, Calibre does not seem to be working correctly neither. When I convert an epub to epub so that all Turkish chars could be displayed correctly, I check the .css file inside the newly created epub file but I see stylesheet1.css (with a 1 attached at the end) and this file lacks the @font-face decleration bit for font family and all supporting 4 font-types as proposed in the previous posts.

Can anyone suggest a solution for my font replacement endeavour for creating proper epub files?

jackie_w
12-29-2011, 06:07 PM
Actually, Calibre does not seem to be working correctly neither. When I convert an epub to epub so that all Turkish chars could be displayed correctly, I check the .css file inside the newly created epub file but I see stylesheet1.css (with a 1 attached at the end) and this file lacks the @font-face decleration bit for font family and all supporting 4 font-types as proposed in the previous posts.

A Calibre conversion puts the @font-faces into every html file in the epub, rather than once in the .css file (don't know why). Try looking in there. If they are present and you have found the Nook magic src: url(res:///... ...) value the epub should still display your custom font correctly as long as your chosen font has the necessary Turkish characters.

kado
12-30-2011, 06:35 AM
A Calibre conversion puts the @font-faces into every html file in the epub, rather than once in the .css file (don't know why).

This upsets me as well Jackie_W. Because I have a very few epubs I came across on the web in which all Turkish fonts are displayed correctly and when I check the file content of these very rare epubs, I see a separate stylesheet.css file in which after the first line there is a whole body of @font-face decleration as exactly as proposed in the earlier posts here. So, not having this css file just gives me another reason to fail, perhaps.

I see my situation like this: I have been trying to solve an equation with 3 unknowns. To be able to sort it out, all these 3 unknowns should be identified correctly. The unknows I am facing are:
1- Whether the font I try to use includes all Turkish characters correctly. I currently try to use LiberationSerif as it is the one suggested in many blogs.
2- Whether the folder in which this font is located are correctly referred to for my Nook within @font-face declaration, i.e. the blue bits in your post.
3- Whether Calibre correctly converts epub to epub as it was expected to. I understand it does not "Override Css" but puts an "Extra Css" as was named under the "Look & Feel" menu in the latest version of Calibre I have been using, namely 0.8.32. From this different menu item naming, I tend to think that, before Calibre was just overriding the stylesheet.css but now it just adds it by renaming it to stylesheet1.css. But I wonder where the stylesheet.css file then...

I realize my long-awaited success will not only be when I correctly resolve each of these 3 unknowns - for each of which there are dozens of alternatives to try; but also I implement only the correct alternatives at once. Perhaps I finally and unwittingly figured out the second unknown correctly but all others were not right when I gave it a try, which eventually led to a failing epub full of ? marks instead of Turkish letters.

Frankly speaking I have tried almost all combinations and I am almost about to give up... I cannot tell you enough since when and how many days I have spent so far for a permanent solution.

As a last attempt I would like to summarize what I have done so far, despite the fact that I realize this is a thread for Sony readers only, not for Nook; however, I do hope you guys would allow me here as I see many expert comments on this thread relevant to my problem as it is mainly an epub/font/css/Calibre issue:

1- "The font" with Turkish Character set: As per a suggestion in one of the blogs I have read, I first used the LiberationSerif font available in the Calibre2\resources\fonts folder, even though I still don't get the logic behind it. Does this font have a built-in and guaranteed Turkish char set inside? Trials, trials, and later I downloaded the very same font from a website specialized on fonts, which also allowed me for a "test-drive" to be able to check whether the chars I am interested in are displayed correctly. Trials, trials And finally I just used the LiberationSerif set I came across inside one of those rare epubs with which my Nook worked correctly. There were this LiberationSerif set embedded inside the epub and I just copied them to "my fonts" folder in my Nook. I don't know if I could do anything furhter to make sure that the font set is correct. How can I see if a font I am interested in contain all the Turkish characters correctly? I suspect some fonts are already installed in my Windows 7 and therefore they are displayed correctly in W7, but not in Nook, which misleads me a great deal, I think. I use W7 in English, could it be the reason?

2-"Syntax" for referring to "my fonts" folder in @font-face: My Nook shows the location of epub files as:
nook/my documents/[writer's name]/[book name.epub]
Truly, when I connect my Nook into my computer, the drive name becomes "nook"; when I double click the drive, I see all relevant folders right beneath the root such as "my document", "my fonts" etc. Therefore, I don't understand where "system/fonts", "data/fonts" etc come from. Nevertheless I have tried all of them but failed. I even thought of the blank character between "my" and "fonts" and used %20 for a proper url reference. No hope. I later chanded the folder "my fonts" to "fonts" not to add another uncertainty to my already complex equation. I now realize that I will keep on failing on absolute referencing for the fonts folder unless I certainly know the inner folder structure of Nook Standard. So far, nobody does seem to be aware of that. For Nook Color it might be "system/fonts" and for Sony "data/fonts" but for my Nook Standard I don't know what it is. Therefore, in order to eliminate this parameter, now I am thinking of relative referencing -thanks to Wikipedia for examples. Consider this reasoning: If the book is under "my documents" folder which is under "[writer's name]" folder, and the fonts folder is located under the root and inside "fonts" folder, would it be correct to refer to the fonts in @font-face declaration with:
src: url(res://../../fonts/LiberationSerif-Italic.ttf);
Do I need "res://" bit here as I have only come across examples without that bit? It doesn't seem to be harmful as it seems merely a protocol which forces the reader to resolve the string, but who knows. I should say, with all what I have been trying to achieve here, I am swimming in foreign waters and this is completely out of my league. I hope what I type makes sense for all of you computer experts.
If this syntax is succesful, it would just give me one less issue to worry about.

3- Calibre "epub to epub" conversion: The epub file which perfectly displays the long-sought-for Turkish characters have a stylesheet.css file and is perfectly a match for what was suggested earlier in posts #9 and #18 and is attached below - the second line is quite long and goes to the right:

@namespace h "http://www.w3.org/1999/xhtml";
@font-face {font-style: italic;font-family: 'Liberation', serif, sans-serif;font-weight: normal;src: url(LiberationSerif-Italic.ttf);}@font-face {font-style: normal;font-family: 'Liberation', serif, sans-serif;font-weight: normal;src: url(LiberationSerif-Regular.ttf);}@font-face {font-style: italic;font-family: 'Liberation', serif, sans-serif;font-weight: bold;src: url(LiberationSerif-BoldItalic.ttf);}@font-face {font-style: normal;font-family: 'Liberation', serif, sans-serif;font-weight: bold;src: url(LiberationSerif-Bold.ttf);}.calibre {
display: block;
font-size: 1em;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
padding-left: 0;
padding-right: 0;
page-break-before: always
}
.calibre1 {
display: block;
font-family: Arial, sans-serif;
font-size: 1em;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
text-indent: 0
}
.calibre2 {
font-weight: bolder
}
.t {
font-size: 1.66667em
}
.t1 {
font-size: 1em
}

What I end up with after converting a non-Turkish epub to a hopefully-Turkish epub is like this - The filename is stylesheet1.css with a "1" at the end and does not look similar to the previous one at all; I see LiberationSerif which gives me a hope though:

@namespace h "http://www.w3.org/1999/xhtml";
.calibre {
display: block;
font-family: "LiberationSerif", serif;
font-size: 1em;
line-height: 1.2;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
padding-left: 0;
padding-right: 0
}
.calibre1 {
display: block;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
margin-top: 1em
}


Having seen this and considered it as an incorrect content for the css file, I decided to manually update the stylesheet.css with the @font-face statement that I believe should be working as stated below and added as the second line:
@namespace h "http://www.w3.org/1999/xhtml";
@font-face {
font-style: italic;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: normal;
src: url(res://../../fonts/LiberationSerif-Italic.ttf);
}
@font-face {
font-style: normal;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: normal;
src: url(res://../../fonts/LiberationSerif-Regular.ttf);
}
@font-face {
font-style: italic;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: bold;
src: url(res://../../fonts/LiberationSerif-BoldItalic.ttf);
}
@font-face {
font-style: normal;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: bold;
src: url(res://../../fonts/LiberationSerif-Bold.ttf);
}
body {
margin-right: 8pt;
font-family: 'LiberationSerif', serif;
}
.calibre {
display: block;
font-size: 1em;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
padding-left: 0;
padding-right: 0;
page-break-before: always
}
.calibre1 {
display: block;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
margin-top: 1em
}

But no success again...

Thinking now, perhaps what you have said Jackie_W is right, perhaps Calibre is just working fine but I ruin the overall file integrity by manually manipulating stylesheet.css with this version of Calibre I have. Because, as you reasoned I checked out the index.html file and all LiberationSerif font statements were there. This brings my mind another question for proper referencing to the fonts folder: What is the correct file now for relative referencing: the html files or stylesheet.css? This might be an issue if these two files are located under different folders within the epub; if not, just forget it. But I recall an epub file inside of which there were several html files split probably because of size limitation and Calibre's option for files larger than 260K. These files were, if I am not wrong, were located under another folder. If this is the case the above question of mine still applies.

As you see guys, I feel I am at the end of my adventure with my Nook. And my success is totally depend on fixing each of 3 unknowns and utilizing them in one lucky try.

Could you guys give a hand of what items are we certain, what not. This could help me narrow down my trials and reach a final, permanent and long-awaited solution.

Many thanks in advance.

Kadir

jackie_w
12-30-2011, 08:58 AM
@kado,

I suspect it is item 2 which is your main problem. I don't have a Nook so I can't really help you get to the bottom of that. Have you tried the Nook subforum? Surely, there must be many people there with the right experience.

I can help you eliminate problems with items 1 and 3. If you attach a TXT file saved in UTF-8 encoding which contains all the Turkish chars you want to check. I can create an epub with Calibre which will work on my Sonys and post a screencap for you to check. If it looks OK, that will confirm that Liberation is OK and that Calibre will put the @font-faces somewhere that an ereader can use them. The only thing then missing is the magic Nook url locations.

There is another way you can eliminate problem 2 altogether and that is to 'fully embed' the Liberation font files inside each epub. I think the perfect Turkish epubs you referred to were using that method. Calibre is not a great deal of help with this method so your task is a bit more manual but not difficult. I recently wrote a post outlining how to do this for Sony PRST1 users when we thought this was the only way we were going to get custom fonts to work on our shiny new readers (since then the magic PRST1 url location has been discovered so full embedding is no longer required for T1 owners). I am fairly confident this will work for you (as long as we confirm a good Turkish font). Here's the link (http://www.mobileread.com/forums/showpost.php?p=1818037&postcount=11). It is referencing Gentium fonts to read in Vietnamese but much of the info is general. If you have trouble with the details feel free to ask.

If you do post the Turkish text I will also create and post a fully embedded Liberation epub for you so you've got a sample to examine closely.

In the meantime, I wrote another post a few months ago giving a general overview of 3 different ways to customise fonts (http://www.mobileread.com/forums/showpost.php?p=1726853&postcount=190). It is not specific to any ereader brand but it may provide some background for you.

kado
12-30-2011, 04:27 PM
Hi Jackie_W,

Many thanks for your kind return and support.

Yes, as soon as I finished my post at this Sony-specific thread, I immediately initiated a new thread under Nook subforum here, with a direct link to this thread in order to avoid double effort and identical threads. Currently I am waiting for Nook experts' return on my issues, especially for the issue no 2.

As requested, I attach all the problematic Turkish fonts in a txt document. I also attach a screenshot of the fonts so that you could yourself see if they are displayed correctly and get a hint of what we are speaking about. Besides, if you see those letters correctly with any of your fonts, this would mean that in addition to LiberationSerif, that particular font of yours does also support Turkish. This would give me more alternative fonts to use in my Nook. Your support in resolving the issues 1 and 3 will therefore be truly and higly appreciated.

Happy new year to everyone.

jackie_w
12-30-2011, 06:40 PM
@kado,

The Liberation Serif font appears to display Turkish OK. The attached image is a screencap from my Sony PRS650 of an epub created by Calibre from your Turkish TXT file. It references the Liberation fonts stored in a /fonts directory on the Sony using the Sony-special urls
@font-face {font-family: serif; ... ... src: url(res:///Data/fonts/LiberationSerif-Regular.ttf)}
etc ... etc ...
in @font-faces stored in Calibre Look&Feel ExtraCSS. So if the Nook community can tell you the Nook equivalent you should be OK to prepare your epubs this way.


If you can't find the Nook url info then you still have the option to eliminate problem 2 by fully embedding the Liberation fonts inside each epub. I've attached your sample so you can test it on your Nook.

jackie_w
12-31-2011, 09:27 AM
@kado,

This Nook webpage (http://nookdevs.com/Font_Changes#Instructions_for_Linking_3rd_Party_Fo nts_from_ePubs) looks as if it should help.

kado
12-31-2011, 04:06 PM
@kado,

This Nook webpage (http://nookdevs.com/Font_Changes#Instructions_for_Linking_3rd_Party_Fo nts_from_ePubs) looks as if it should help.

Hi Jackie_W again,

You won't believe but I came across that page a few hours ago. You are right - it quite looks like what I am missing, i.e. my second concern - reaching my LiberationSerif fonts with correct url string. It also suggests using built-in and hidden Droid fonts.

I have just tried each and every alternatives offered here except softrooting and installing the plugin which is effectively the same thing.

Guess what, still failing. I cannot tell you enough how I am disappointed. On this special day of the new year eve, look what I am spending my time with. Just two hours left to 2012.

I came across several threads directing this page, which are older than 1.5 years. That might be my problem actually. My Nook firmware version is 1.7.0 not 1.5.0 and Calibre is the latest 0.8.32. I really started to think that these two are my current issues.

You won't believe, now I am studying how to softroot my device and use ADB - Android Debug Bridge - to be able to see the inner structure of my Nook Classic. Enough is enough. Gosh! Where am I heading to?

I myself want to see LiberationSerif in the hidden maze of my Nook with my own eyes or the Droid fonts, which I highly suspect that they do not exist there. There cannot be any other explanation to my failure.

If it goes like that, it will mean that in 2012 I will spend all my year with hacking, rooting, debugging some electronic devices, Nook, iPhones, iPads...

Thanks for your continuous support. This means a lot to me.

jackie_w
12-31-2011, 05:19 PM
That Nook webpage seems quite specific.

The directory you need to create and copy the Liberation fonts into (if you haven't already) is /my fonts (all lowercase and including the space) and it needs to be created in the same place as /my documents

The magic Nook url is
src: url('res:///system/media/sdcard/my fonts/LiberationSerif-Regular.ttf')
Pay particular attention to the quotes wrapped around the url location. Did you make sure you had this? The Sony url doesn't need them but I suspect the Nook does because of the space in the path between my and fonts


P.S. Did the fully embedded epub work on your reader?

kado
12-31-2011, 06:15 PM
Certainly, I was at first quite puzzled with the quotes, sometimes without, sometimes with double quotes. I have tried the exact string. LiberationSerif fonts are copied under "my fonts" as suggested, so the url string should work out correctly.

What I am trying to convert is the attached txt file and the resultant epub is also attached. In the epub, the famous url statement is not in sheetstyle.css but in index.html as we discussed before. There is just a reference to LiberationSerif family in sheetstyle.css rather than the whole Extra CSS block which is:
@font-face {
font-style: italic;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: normal;
src: url('res:///system/media/sdcard/my fonts/LiberationSerif-Italic.ttf');
}
@font-face {
font-style: normal;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: normal;
src: url('res:///system/media/sdcard/my fonts/LiberationSerif-Regular.ttf');
}
@font-face {
font-style: italic;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: bold;
src: url('res:///system/media/sdcard/my fonts/LiberationSerif-BoldItalic.ttf');
}
@font-face {
font-style: normal;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: bold;
src: url('res:///system/media/sdcard/my fonts/LiberationSerif-Bold.ttf');
}
body {
margin-right: 8pt;
font-family: 'LiberationSerif', serif;
}

This is where we are different Jackie_W, I mean the stylesheet.css. The epub you sent me worked out perfectly and it is exactly in the same format and structure with the very rare Turkish-friendly epubs I could ever find on the net: These epubs contain LiberationSerif family fonts (4 alltogether) inside epub and also stylesheet.css is exactly how it looks above and not in the index.html. The epub that I generate does not contain LiberationFonts -well it should not contain, that's normal, we are hoping it will be accessed from Nook internal memory.

If the fonts are correct, if the url string is fine, then I started to think that I am falling victim to Calibre conversion. Really don't know what else to think after all my trials and all those solid and confident suggestions by Nook experts... Another possibility is the firmware difference as I mentioned before.

I have a question: When you generate your epub - the one you sent me through, am I right to think that you yourself didn't insert those LiberationSerif fonts inside the epub container, nor the stylesheet.css which I expect it was created by Calibre? What I expect after my conversion is the very same epub but without fonts embedded in the epub.

It is 2012 here in Turkey for 8 minutes now. :)

kado
12-31-2011, 08:20 PM
I just sent out a PM to Kovid -the creator of Calibre, to find out what he thinks of my issue with my Nook Classic and Calibre.

To my surprise I could find in this forum the genius behind that beautiful program ... I didn't miss that opportunity to get acquainted with him...

jackie_w
12-31-2011, 08:58 PM
@kado,

As our conversation is off-topic for this thread I'm going to continue as a PM.

kado
12-31-2011, 09:13 PM
I still believe our discussion is applicable to this thread as I am switching to Sony from Nook if all this does not work out properly... :)

jackie_w
12-31-2011, 09:46 PM
Well then, you'll be delighted to hear that the Sony PRS-T1 contains at least 6 built-in fonts which display Turkish characters OK :D

kado
12-31-2011, 10:28 PM
Well then, you'll be delighted to hear that the Sony PRS-T1 contains at least 6 built-in fonts which display Turkish characters OK :D

Do you mind sharing the names of the fonts then so that I could download them and use in my Nook. :)

Well I think you are now the most unwelcome person for Sony as you have just saved my Nook's going to wastebin and ruin Sony's hope to sell one more Sony unit to me as I am proceeding now with my Nook. Well, this is my mom's, I will consider a Sony for myself, I promise :)

Yes guys, if anyone follows my threads in many blogs up to this point, my issue has been cleverly resolved by this gentlemen, jackie_w... I truly owe him a lot.

My problem turned out to be lack of a proper codepage utilisation. When I choose cp1254 for Turkish (jackie_w says it is cp1252 for English windows users) everthing worked out perfectly. cp1254 should be chosen in Calibre under Common Options/Look and Feel/Input Character Encoding.

As part of the solution the ExtraCSS block in Calibre also turned out to be:
@font-face {
font-style: italic;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: normal;
src: url('res:///system/media/sdcard/my fonts/LiberationSerif-Italic.ttf');
}
@font-face {
font-style: normal;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: normal;
src: url('res:///system/media/sdcard/my fonts/LiberationSerif-Regular.ttf');
}
@font-face {
font-style: italic;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: bold;
src: url('res:///system/media/sdcard/my fonts/LiberationSerif-BoldItalic.ttf');
}
@font-face {
font-style: normal;
font-family: 'LiberationSerif', serif, sans-serif;
font-weight: bold;
src: url('res:///system/media/sdcard/my fonts/LiberationSerif-Bold.ttf');
}
body {
margin-right: 8pt;
font-family: 'LiberationSerif', serif;
}

I hope this is helpful.

Many thanks again Jackie_W!

jackie_w
01-01-2012, 09:03 AM
Do you mind sharing the names of the fonts then so that I could download them and use in my Nook. :)

The PRST1 built-in fonts which are accessible from simple menu options are:
Serif
Amasis
Palatino Nova
Really No2
Sans-serif
Frutiger Neue
Univers Next
Verdana

You can also access the internal Droid serif and sans-serif fonts, but not from a simple menu.

Charis SIL (serif only), DejaVu (serif, sans, mono) and Droid (serif, sans, mono) fonts are all freely available and are worth a try.

I'm not sure just knowing the font names is enough. For instance, the PRST1's version of Amasis font does show Turkish chars but the NookSTR's version of Amasis does not. Even though I don't own a Nook, I managed to get hold of the NookSTR's built-in fonts to test by downloading the latest Nook upgrade file and unzipping it on the PC to extract the fonts directory.

Nook Malabar and Ysobel serif fonts show Turkish fonts OK.

kado
01-01-2012, 09:24 AM
Wow! Level of your support and guidance is more than I deserve Jackie.

And my depest apologies for omitting the obvious re your nick... With 3108490 karma points divided by circa 2 per your assistance you have rendered so far means it is more than 150000 life saving help cases from you to the people who are lost like myself.

Being a lady and with such an angel rank, I wonder how many marriage offers you have received so far. :)

Many many many thanks again.

kado
01-01-2012, 09:26 AM
My mistake, it must read more than 1,500,000 in lieu of 150,000.

Even more WOWW!!!

jackie_w
01-01-2012, 09:41 AM
My mistake, it must read more than 1,500,000 in lieu of 150,000.

Even more WOWW!!!

No. The more karma you have the more you are allowed to give. I certainly have not answered 1.5 million queries.

kado
01-01-2012, 09:50 AM
I have never ever felt that much worthless and tiny in my life with my dinky 2 karma points...

Sorry for not being able to contribute to your angel rank more. But at least I have managed to put my 2 points several times. :) Good for you!!! :) You badly needed them...

Timur
01-01-2012, 09:11 PM
... For instance, the PRST1's version of Amasis font does show Turkish chars but the NookSTR's version of Amasis does not. ...

This made me curious and try all the fonts on my Nook STR. All 6 of them (Caecilia, Malabar, Amasis, Gill Sans, Helvetica Neue, Trebuchet) support Turkish characters. Maybe the Amasis you have tried is not really identical to the one in Nook STR.

You can get all the font files that are on Nook STR by downloading the standalone firmware update package from Nook Support pages on B&N website. It is a zip file and the fonts are under /system/fonts directory.

JSWolf
01-01-2012, 10:28 PM
Which version of Amasis is better (T1 or nook)?

jackie_w
01-02-2012, 08:55 AM
@Timur,

Re: Nook Amasis - that's very interesting and somewhat perplexing, because that's exactly how I did acquire the Nook fonts to try out on my Sonys. Admittedly it was a few weeks ago.
Nook Amasis Regular font is called Amasis30.ttf sized 83,420 bytes
PRST1 Amasis Regular font is called AmasisMTW1G.otf sized 122,660 bytes


The Nook Amasis shows most of the Turkish chars, but not all, when used on my Sony. The PRST1 Amasis shows all of them. See attached screencaps, 1st is Nook, 2nd is PRST1. The same epub on the same PRS650 reader was used for both screencaps.

Which version of Amasis is better (T1 or nook)?
@JSWolf,
That would depends on your point-of-view. Based on visual clarity I'd say Nook Amasis because it's a heavier font (like a semi-bold) -- presumably that '30' in the filename is describing font-weight. However, if you need non-English char support then the T1 is probably more versatile.

IMO the Amasis font is rather nice. Amasis Regular has the benefits of the Kindle Caecilia fonts (clear, plain, simple) with the added benefits (again IMO) that Amasis Italic is more elegant than Kindle Caecilia Italic and Amasis has a bigger difference between bold and non-bold.

Timur
01-02-2012, 11:46 AM
I see the reason for the discrepancy now, your Amasis is from 1.0.1 update package, mine is from 1.1 update package. These are the file sizes from 1.1:

220,280 Amasis30.ttf
234,924 Amasis30-Bold.ttf
259,544 Amasis30-BoldItalic.ttf
263,936 Amasis30-Italic.ttf

Coincidentally, although the font files in 1.0.1 update seem to be missing Turkish glyphs, I have used 1.0.1 for a long time and I remember checking Turkish characters with all fonts and found them working then as well. Maybe 1.0 firmware had the bigger files anyway and the updater was not really copying those font files from 1.0.1 during update.

jackie_w
01-02-2012, 12:06 PM
I see the reason for the discrepancy now, your Amasis is from 1.0.1 update package, mine is from 1.1 update package. These are the file sizes from 1.1:

220,280 Amasis30.ttf
234,924 Amasis30-Bold.ttf
259,544 Amasis30-BoldItalic.ttf
263,936 Amasis30-Italic.ttf

Coincidentally, although the font files in 1.0.1 update seem to be missing Turkish glyphs, I have used 1.0.1 for a long time and I remember checking Turkish characters with all fonts and found them working then as well. Maybe 1.0 firmware had the bigger files anyway and the updater was not really copying those font files from 1.0.1 during update.

Thanks for clearing that up, Timur. I'm off to re-download the newer, better version. Thanks :)

kado
01-02-2012, 12:31 PM
This made me curious and try all the fonts on my Nook STR. All 6 of them (Caecilia, Malabar, Amasis, Gill Sans, Helvetica Neue, Trebuchet) support Turkish characters. Maybe the Amasis you have tried is not really identical to the one in Nook STR.

You can get all the font files that are on Nook STR by downloading the standalone firmware update package from Nook Support pages on B&N website. It is a zip file and the fonts are under /system/fonts directory.

That's exactly what I have been after Timur.

Thanks a lot, very much appreciated...

jackie_w
01-02-2012, 01:11 PM
Follow-up ... after downloading Nook Amasis from Nook update v1.1

The results are mixed. The Turkish chars are now displayed correctly with the v1.1 Amasis. However, despite the filenames remaining the same (Amasis30...) I see that the font-weight of v1.1 is not as heavy as it was in v1.0.1.

I would say the Nook v1.1 Amasis looks more like the PRST1 Amasis, but the fact that the Nook font files are twice the size of the PRST1 font files may mean that the Nook is 'better' in some way. I don't know enough about how fonts work to draw conclusions.

For anyone interested in a comparative visual overview from a Windows PC, the 3 versions are, from left to right, Nookv1.0.1, Nookv1.1, PRST1.
(I hope I'm not breaking any copyright protocol)

Timur
01-02-2012, 02:26 PM
Although the new files are named "Amasis30", they are not Amasis30 but regular Amasis(different weight). One can tell from fontname property embedded in the files.

Couple of comparisons between 81kB and 215kB Amasis follows in the attachment:

jackie_w
01-02-2012, 03:02 PM
... and just to complete the comparison, the PRST1 equivalent of Timur's Nook font properties...

Phil_C
01-14-2012, 09:01 PM
@notsure

Try this:

Reimport the original epub, i.e. before you did any conversions.

Convert using all the ExtraCSS you had before, but replace

body {
font-family: "Fontin", serif;
}

with

body.calibre {
font-family: "Fontin", serif;
}

I'm having a similar problem where i can't get the specified fonts in Extra CSS to work.

This is probably because of the html output by Book Designer. The converted epub always retains the original font, in this case GeorgiaEInk15.

There is no simple <body> tag in this original html file, and I can't find a similar way to make the Extra CSS work. You can see in this snippet of html that there is a single line that begins with "<body" followed by several other items including the font-family. A single "</body>" tag appears at the end of the book.

So I'd like to know if there is a way to replace:

body {
font-family: AmasisMT;
}

with something that will work.

Original html snippet:


---
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Unknown</title>
<meta content="http://www.w3.org/1999/xhtml; charset=utf-8" http-equiv="Content-Type"/>

</head>
<body bgcolor="#ffffff" style="FONT-WEIGHT:normal; FONT-SIZE:small; MARGIN-BOTTOM:245px; LINE-HEIGHT:normal; FONT-FAMILY:GeorgiaEInk15" text="#000000">
<h2 align="center" id="BookTitle"><font color="#b90000"><b>BOOK TITLE</b></font>
</h2>
<div align="justify"> </div>
<div align="center"><b>BOOK TITLE #1</b></div>
<div align="justify"> </div>
<div align="justify"> </div>
<div align="center">by</div>
<div align="justify"> </div>
<div align="justify"> </div>
<h2 align="center" id="BookAuthor"><font color="#ff0000"><b>JOHN SMITH</b></font>
</h2>

Yes, I can run the Calibre conversion and then use Tweak Book to manually change the font name in stylesheet.css, but that is cumbersome and the tweaked epub file retains the original (now incorrect) font name in a zillion places.

jackie_w
01-14-2012, 09:35 PM
@Phil_C,
Can you be a bit more specific? Which ereader are you trying to create the epub for (PRS300? PRS350? PRST1?) Where on your reader are the Amasis fonts you want to use?

In that html file the <body> tag is
<body bgcolor="#ffffff" style="FONT-WEIGHT:normal; FONT-SIZE:small; MARGIN-BOTTOM:245px; LINE-HEIGHT:normal; FONT-FAMILY:GeorgiaEInk15" text="#000000">

Is this the only place in the html file where font-family GeorgiaEInk15 is referenced? Or is it coded into every paragraph?

What have you been entering, if anything, in the Calibre Look&Feel ExtraCSS box in your zip-to-epub conversions?

To give a more helpful response, the answers to these questions are necessary.

Phil_C
01-14-2012, 10:02 PM
@jackie_w

This for a PRS-350.
The Amasis fonts are in the proper folder on the Reader. Extra CSS is:

@font-face {
font-family: AmasisMT;
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/Amasis-MT.ttf);
}
@font-face {
font-family: AmasisMT;
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/Amasis-MT-Bold.ttf);
}
@font-face {
font-family: AmasisMT;
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/Amasis-MT-Italic.ttf);
}
@font-face {
font-family: AmasisMT;
font-weight: bold;
font-style: italic;
src: url(res:///Data/fonts/Amasis-MT-Bold-Italic.ttf);
}
body {
font-family: AmasisMT;
}


The only other things I use in Look & Feel are line height, base font size, and font size key. Those work fine.

Yes, the GeorgiaEInk15 is referenced only once in the html (zip) file.

I just found that I can use Search & Replace during the Calibre conversion to change that one instance of the font name. The book seems to look OK. I'll have to take a closer look. An added step that I'd like to eliminate, though.

(BTW, you got me on the right track in another recent thread regarding RegEx and TOCs. I since have expanded and refined the expressions to do even more. Thanks!)

jackie_w
01-14-2012, 10:48 PM
@Phil_C

You shouldn't need to resort to Search&Replace to make it work. It's not immediately obvious to me why your current settings aren't working. Difficult to say more without trying it myself.

However, I would be tempted to do a minor edit to the raw html file before you import it to Calibre. Try changing the <body ...> tag by removing the red bit
<body bgcolor="#ffffff" style="FONT-WEIGHT:normal; FONT-SIZE:small; MARGIN-BOTTOM:245px; LINE-HEIGHT:normal; FONT-FAMILY:GeorgiaEInk15" text="#000000">

Then reconvert with your existing ExtraCSS.

In fact, most of the info in the html's existing <body ...> tag is redundant. You could try simplifying it right down to
<body>
and see how that converts.

Edit: If none of that works I can only think that the font filenames are not quite correct. They should be stored in the reader's internal memory in a directory [drive:]\fonts and the filenames, Amasis-MT-Bold.ttf etc., must match exactly those in the @font-faces. All filenames, directory names are case-sensitive

The only other thing to check is that the Amasis font files are stored in the reader's internal memory in a directory called

JSWolf
01-14-2012, 11:03 PM
Converting ePub to ePub... Bad idea... Use Sigil to edit the CSS.

jackie_w
01-14-2012, 11:07 PM
Converting ePub to ePub... Bad idea... Use Sigil to edit the CSS.

...but he's converting zip to epub.

Phil_C
01-14-2012, 11:31 PM
@jackie_w

I don't think I have an html editor. Office 2007 does not seem to include one. I'd try what you suggested in an attempt to narrow things down.

But that still involves extra steps that I want to avoid for regular use. Easier to use the Search & Replace workaround.

But, like you, I'd like to know how to get this to work through Extra CSS. The Reader finds the font files just fine once the correct font name is in the body statement.

The whole problem is that darn unorthodox body tag form Book Designer. (Although I claim almost no knowledge of things html.)

My purpose is to be able to select any of several fonts I have installed on the PRS-350 when I am about to begin reading a new book. I have the Extra CSS text for each font saved in a text file. The Book Designer htm files for all books are in Calibre. So I just want to decide on a font, copy the related Extra CSS to Calibre, and quickly convert the book from the html zip file to epub. Send to Reader. Read.

Sounds simple.

JSWolf
01-14-2012, 11:32 PM
...but he's converting zip to epub.

What is in this zip file? ePub is zip and can be zip if the extension is changed.

JSWolf
01-14-2012, 11:33 PM
Phil, if your book has been anyplace near Word, then you may find a mess in the CSS that can cause your embedded fonts to fail.

If your book went through Word, take the ePub and load it into Sigil and clean it up so your embedded fonts will work.

Phil_C
01-14-2012, 11:55 PM
My books are edited in RTF for cleanup, then imported into Book Designer for layout, and output as htm. When the htm is placed in Calibre, it's saved as a zip file (by Calibre).

I use Calibre to convert the zip (htm) to epub while setting fonts, chapter breaks, line height, etc. Everything works except the problem with the <body> tag in Extra CSS. Can't get the font name right without workaround as stated in previous posts.

jackie_w
01-15-2012, 10:12 AM
My books are edited in RTF for cleanup, then imported into Book Designer for layout, and output as htm. When the htm is placed in Calibre, it's saved as a zip file (by Calibre).

I use Calibre to convert the zip (htm) to epub while setting fonts, chapter breaks, line height, etc. Everything works except the problem with the <body> tag in Extra CSS. Can't get the font name right without workaround as stated in previous posts.

To answer your 'html editor' question... an html file is just a text file and can be edited with any old text editor, e.g. Notepad in Windows. The reason people refer to 'html editors' is that some of the better text editors (e.g. the free Notepad++ on Windows) recognise the file extension as an html file and will colour-code the text and tags to make it much easier to see what you're doing.

If you want to be able to change fonts from your PRS350 (or PRS300) whilst you're reading, as the mood takes you, then you should really take a look at installing the PRSPlus custom firmware (http://code.google.com/p/prs-plus/). Font changing is only one of many very nice features which will be added to the standard Sony features.

If you do install PRSPlus (it really is very easy to install) then you do not need to do anything at all with fonts in Calibre ExtraCSS. You would put all these Amasis @font-face statements in a .css file (created with a simple text editor) and store it in the designated directory on your Sony. You create one .css file for each font-family you may want to use. PRSPlus then has a menu feature which allows you to pick which .css you want from a list. Once you've set up all your .css files, it couldn't be easier to switch from one to another. One of the main benefits of doing it this way is that it keeps the epubs in your Calibre library nice and clean, free of device-specific and font-specific code. So when you want to re-read the epub in a few years you won't need to clear it all out so you can read it on a completely different device.

As an additional benefit, these PRSPlus css files can also be set up to display your epubs in a range of font sizes. This helps to overcome the poor Sony only-3-zoom-levels-available.

Edit: On re-reading your earlier post, do you already have PRSPlus? If so, then perhaps we need to look at generalising your existing PRSPlus css files to be 'more accommodating'.

Phil_C
01-15-2012, 12:55 PM
@jackie_w

I previously considered PRSPlus, but decided not to mess with the original Sony FW. I think I would also lose my built-in dictionaries on the PRS-350.

Your earlier suggestion appears to work, i.e replacing this

<BODY style="FONT-WEIGHT:normal; FONT-SIZE:small; MARGIN-BOTTOM:245px; LINE-HEIGHT:normal; FONT-FAMILY:GeorgiaEInk15" text=#000000 bgColor=#ffffff>

with this

<body>

Why that code is there if it's not needed, I do not know. You said it appeared to be redundant, and that's the way it looks. (Except the font must fall back to some default, since that code contained the only font reference in the htm document.)

I don't need to switch fonts in the middle of a book. I just like to decide on a font before beginning a book, and want the ability to quickly use Calibre to convert the original htm to epub with the selected font.

So now I can do this:

-Clean up book in RTF.
-Create book in BookDesigner and output to htm.
-Edit htm in Notepad to adjust the single body tag as above.
-Place htm in Calibre for conversion using Extra CSS for font designation.

I have saved Extra CSS statements for each font that I like. So it's only a matter of copying one of them to the Calibre conversion Look & Feel screen and converting to epub. (The rest of the conversion settings are already saved in Calibre Prefs.)

Works great for a guy that does not know html. :)

jackie_w
01-15-2012, 03:23 PM
I previously considered PRSPlus, but decided not to mess with the original Sony FW. I think I would also lose my built-in dictionaries on the PRS-350.

No, I can vouch for the fact that you wouldn't lose the built-in dictionaries, but the decision is yours.


Why that code is there if it's not needed, I do not know. You said it appeared to be redundant, and that's the way it looks. (Except the font must fall back to some default, since that code contained the only font reference in the htm document.)

Many of the settings are just hard-coding the default values that would be used if the code wasn't there. If no font-family is specified then the generic font-family:serif is assumed.


Works great for a guy that does not know html. :)
Glad to hear it :) but you now know about the <body> tag. As an aside, a little knowledge of html and css goes a long way when trying to tweak ebooks.