View Single Post
Old 01-15-2012, 09:40 AM   #13
Morkl
Connoisseur
Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.
 
Posts: 80
Karma: 68347
Join Date: Oct 2009
Location: Sweden
Device: PRS-T1
Quote:
Originally Posted by soseono View Post
This is a great progress!! Thanks!

Here's what I found: http://www.w3.org/TR/css3-fonts/#propdef-font-variant

"Like other shorthands, using ‘font-variant’ resets all font feature properties to their initial values."

So maybe this is why including font-variant in the @font-face rule breaks all other definitions?

Does the small-cap text display correctly without the css lines above?
Nope, can't get small-caps to render.

Quote:
Originally Posted by quisvir View Post
Awesome! Great job Morkl, on this as well as on your homescreen mod! Some karma coming your way

I am no css expert, but I see nothing wrong with the small-caps definitions. So my guess would be that the reader lib itself can't actually handle small-caps in @font-face (which seems silly, but I have no better explanation).

By the way, how did you get it to log the css? I wanted to try that myself, but I didn't see what I could do with LogAdapter.debug right away.
Yep, it seems like small-caps just doesn't work.

I used android.util.Log and watched the system log to get the data.

Quote:
Originally Posted by sherman View Post
Last time I checked, the Adobe renderer didn't support font-variant: small-caps. I don't know whether this is true for the renderer used on the T1, or whether Sony are trying to employ some font resizing trick or what...
Quote:
Originally Posted by jackie_w View Post
@Morkl

Someone should correct me if I'm wrong, but to the best of my knowledge the ADE reading app doesn't support the @font-face font-variant:small-caps option. This may be because the current epub standard doesn't include support either. That being the case, I'm not sure it's fixable other than by removing the small-caps items as you've done.

Just so I fully understand, I need to root my T1 to do this and your mod becomes a second reading app?

Suppose I decided I will never use any of the 3 sans-serif fonts (Frutiger, Univers, Verdana). Might it be possible to create a modified apk which substitutes the @font-faces of 3 of my own font choices pointing to external fonts stored in /fonts in internal memory by using
url(res:///ebook/fonts/../../mnt/sdcard/fonts/mycustom.otf).
Then I would be able to access my custom fonts via the Frutiger, Univers, Verdana standard options. Or am I being over-hopeful

Well done to you for tracking down the problem.
If the renderer doesn't support it I guess there is not much that can be done. However, if anyone figures out how to get small-caps to work, generating the working CSS is no biggie.

That is correct, root is required. I could make a package that just replaces the stock reader app, but the installation process would be the same as rooting, so depending on why one avoids rooting it might not make a difference. Still, would this be of use?

Custom fonts is next on the agenda

Quote:
Originally Posted by snarkophilus View Post
Awesome indeed Morkl!

The holy grail would be to find something that works without rooting, but rooting is so easy and it looks like these font issues can be fixed (relatively?) easily by modifying the Sony apps.

Do you know anything about dissecting shared libraries? /system/lib/libreadercore.so contains a reference to res:///userStyle.css, but I haven't yet been able to figure out how that is used.

Cheers,
Simon.
Yep, this was an easy fix as soon as i realized what caused the problem.

I'll take a look at libreadercore.so if I find a nice arm disassembler (the more can be done without rooting the better, i reckon), but for now I'll see to putting some kind of custom CSS option that is injected in the Reader app along with the custom fonts settings.
Morkl is offline   Reply With Quote