bugFree UCS Outline Fonts - Bugs: bug #37817, wrong f kerning in FreeSerif (all...

 
 

bug #37817: wrong f kerning in FreeSerif (all flavours) if -liga

Submitted by:  Pablo Rodríguez <ousia>
Submitted on:  Mon 26 Nov 2012 05:06:26 PM UTC  
 
Category: font metricsSeverity: 3 - Normal
Item Group: letter positioning poorStatus: Non-bug
Privacy: PublicAssigned to: Steve White <Stevan_White>
Open/Closed: ClosedRelease: 2012-05-03

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 02 Dec 2012 10:45:59 AM UTC, comment #17:

Hi Pablo,

It's probably best not to pursue this discussion in a closed bug report.

Please either mail me privately, or else open a new "support" thread (that's more appropriate, since we aren't discussing a FreeFont bug here, rather, how to use FreeFont on certain devices.)

> Sorry, but I don't understand what you mean with my really primitive
> @font-face.


I said if the device is properly using the CSS and loading the font, yet failing to implement kerning, then the font renderer (on your device) might be really primitive.

I did not call your code "primitive".

> And with being 100% sure whether the font is loaded by the
> ereader.
>
> @font-face {
> font-family: "serifita";
> font-style: normal;
> font-weight: normal;
> src:url("FreeSerif.otf");
> }
>
> What is wrong here? Why is surprising that the ereader loads the font?


I think that is correct syntax. It would help to see a photo of how your reader renders your text (like the one I attached showing my reader last week.)

It is not surprising that the e-reader would load the font (why do you ask?)

It is disappointing that even today some e-reader software do not support embedded fonts.

Furthermore, a few months ago, I made a SourceForge project with test files for EPUB. Have a look.
https://sourceforge.net/p/epub-test-suite/

> I'm afraid that the different features with different ereaders lies in the
> ePub reading software and not that much on the ereader itself.


There is
the ePub reading software,
the operating system of the ereader,
the hardware of the ereader.

Font rendering libraries might be present in either the ePub reader software, or the operating system, or both.

I don't know how much Adobe's reader relies on the underlying OS for font rendering.

Maybe you could research forums or blogs about your particular e-reader.

> The issue is that when vendors release new firmware updates for their devices,
> they don't normally include an updated version of the reading software. I
> don't know whether they aren't aware of nasty bugs, don't mind or don't want
> to pay for what Adobe could consider a new version (instead of a bugfix
> release).
>
> But maybe I can find why is the bug caused and try to workaround it (I mean
> with FreeSerif Bold). I had a similar problem with another bug that consisted
> in Adobe Reader Mobile not being able to display fonts with an OS/2 table
> numbered version 4.


I would like to understand your difficulty too.

My E-reader also says it has Adobe Reader Mobile. But I have no idea how to determine the version of that software.

Also, the rendering of this e-reader is ... spectacularly good.
There are some glitches, but text with OpenType fonts properly uses all the font features, and really looks great.

Cheers!

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Sat 01 Dec 2012 05:54:24 PM UTC, comment #16:

Thanks for your reply, Steve.

Sorry, but I don't understand what you mean with my really primitive @font-face. And with being 100% sure whether the font is loaded by the ereader.

@font-face {
font-family: "serifita";
font-style: normal;
font-weight: normal;
src:url("FreeSerif.otf");
}

What is wrong here? Why is surprising that the ereader loads the font?

I'm afraid that the different features with different ereaders lies in the ePub reading software and not that much on the ereader itself.

The issue is that when vendors release new firmware updates for their devices, they don't normally include an updated version of the reading software. I don't know whether they aren't aware of nasty bugs, don't mind or don't want to pay for what Adobe could consider a new version (instead of a bugfix release).

But maybe I can find why is the bug caused and try to workaround it (I mean with FreeSerif Bold). I had a similar problem with another bug that consisted in Adobe Reader Mobile not being able to display fonts with an OS/2 table numbered version 4.

Thanks for your help,

Pablo

Pablo Rodríguez <ousia>
Sat 01 Dec 2012 11:10:47 AM UTC, comment #15:

Hi Pablo,

I copied your EPUB books to my reader (iriver STORY). In both samples I see both ligatures and kerning, but that is not surprising. Those features are on by default.

Are you 100% sure the @font-face is loading FreeSerif on your device? If it is, I would have to say, the font renderer is... at least primitive.

Regarding your "CSS3" property settings
font-variant-ligatures: common-ligatures;
font-kerning: normal;
font-feature-settings: "smcp";

These are very new ideas, meant to access OpenType features, some are experimental in mozilla; they are not implemented on my e-reader, or by default on any browser I have seen. In effect, they do nothing in your example file.

We hope such things will become available in the near future!

This one is a real property, but I've never seen the value:
font-variant: common-ligatures;
I guess it doesn't do anything in any environment.

I have only seen the ability to turn ligatures on and off in desktop publishing applications, and to turn on small caps, most page layout programs don't even get it right (but XeTeX does!).

You can turn on some switches from HTML using the "lang" tag...
See the FreeFont "USAGE" file.

Regarding the issues with ConTeXt, I have taken this up directly from your discussion on the NTG-context mailing list
'kern': TrueType table and GPOS lookup feature
http://www.ntg.nl/pipermail/ntg-context/2012/thread.html#70363

It appears that context handles kerning and ligatures properly with FreeSerif. The proplem perhaps arose from a difference in the way they're applied. Those features are turned on according to the script of the text. In most applications such as web browsers, the script is deduced from the Unicode of the current run of text, but in context, one must explicitly specify the script of the text to be "latn".

Some people think I should activate these features for any script. I think they don't see the bigger picture of highly mixed text and a font supporting many languages.
I don't understand why these TeX environments don't deduce the script like other modern applications do.

Cheers!

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Fri 30 Nov 2012 11:52:10 PM UTC, comment #14:

Hi Steve,

it's too late after an exhausting day, so longer reply on the ConTeXt mailing list.

Both ConTeXt and FreeSerif are fine. It is the Sony PRS-T1 ereader that can read the information.

The ereader has even a bug that prevents the display of FreeSerif Bold (css-freeserif.epub bellow).

If your ereader can display the ligatures and kerning from the freeserif-test.epub, the bug is in the Sony PRS-T1 ereader.

So, you can safely close this report as not a bug.

Many thanks for your help,

Pablo

(file #27001, file #27002)

Pablo Rodríguez <ousia>
Wed 28 Nov 2012 08:37:05 PM UTC, comment #13:

Pablo,

Do I understand you to say, you will not provide me with a working ConTeXt input file, and a command line to build it?

That's weird and disappointing but it's up to you. It unfortunately makes it difficult for me to help the next ConTeXt user. See below.

Did you try the e-book in the link I sent you? (Did you get the Google Drive link?) I would really like to know if in your e-reader, it displays kerning. If it does not work, that would back up your claim. If it does work, I can maybe explain something to you.

In the attachments find your example re-done in XeTeX, showing ligatures working well. It would seem your problem lies either with your input file or with ConTeXt.

I don't understand your suggestion. The old-style TrueType kern tables and the new-style OpenType lookups do have the same values, if FreeFont is built properly, as it is in the FreFont distribution. What makes you think they don't?

In most applications, all the OpenType features we discussed (standard ligatures and kerning) are enabled by default. In fancy typesetting programs such as LaTeX derivatives, they may choose differently. But it is not the business of fonts to enable the features -- they only provide them.

You will find however, there is a section on LaTeX in the FreeFont USAGE, delivered with the fonts. If you provide me a working example, I can document proper use of the fonts in ConTeXt as well.

Let's finish the job!

(file #26989, file #26990)

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Wed 28 Nov 2012 07:22:38 PM UTC, comment #12:

Well, I guess it's better to summarize my replies here (to avoid an unnecessarily verbose message [being my reply not short]).

Sorry for the mess with ConTeXt. I posted the output not to trick you with ConTeXt, but to show that the old TrueType kerning table hasn't all kerns (although I haven't explained it at all).

ConTeXt has properly implemented OT features, they aren't turned by default if they don't belong to the default script and default language (it's more complex, but let's say it so).

Unless you're properly interested in ConTeXt(*), I'd forget it here. (Again, apologies for the trouble caused.)

Only a suggestion on the font that I think it's important: not all applications support OpenType features and not all users know how to enable it. As of kerning, I think that it would be important that both the old TrueType kern table and the OpenType 'kern' feature have the same values. But this is only a suggestion.

I wrote that OpenType features weren't available in Sony PRS-T1 with Adobe Reader Mobile 9 (yes, meaning ePub files), because I checked it. I didn't wrote the file myself, but it took it for granted that OT features didn't work (see attached files from http://www.mobileread.com/forums/showpost.php?p=1721243&postcount=1).

I must admit that, after checking the source of both files, OpenType features don't work because they aren't simply invoked. Maybe there is some hope that OpenType features might be available on my ereader.

Many thanks for the file sent through Google Docs, but I'm afraid I don't have an account.

I don't need the whole ePub file, just the relevant CSS code. If these features aren't invoked, I'm afraid the Sony PRS-T1 cannot handle OT features.

Many thanks again for your help,

Pablo

(*) Only for the record: ConTeXt isn't a LaTeX derivative, but it is derived from TeX.

Pablo Rodríguez <ousia>
Wed 28 Nov 2012 05:46:42 PM UTC, comment #11:

> Sorry for the noise.


I'm only trying to check whether some marking for replies work.

Otherwise, it won't be easy for me to have all six messages you sent me in only one.

Pablo Rodríguez <ousia>
Wed 28 Nov 2012 01:04:16 PM UTC, comment #10:

Pablo,

When you say

"In some contexts (such ebook readers), it is not possible to have +liga. "

How do you come to that conclusion?

Is it by viewing a PDF such as the one you attached, or by viewing a proper e-book?

I ask, because I made an ebook with FreeSerif embedded, put it on my e-reader, and see very nice kerning. It's too big to post here (I really need to write a subsetting tool for FreeSerif), I'll send you a link.

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Wed 28 Nov 2012 10:58:01 AM UTC, comment #9:

I just once want to see on my system, the same problem you are reporting.

I couldn't figure out how to make context use installed fonts, but it seems it can be made to load directly from a font file, by changing some of the input lines, e.g.
\setmainfont[file:FreeSerif.otf]
but some of them still choke (bizarrely, \setmonofont just dies when it's pointed to FreeMono, with a bunch of low-level errors, but simply removing that, it chokes later on, once again, with no indication of why). I wonder if I'm missing some part of the context installation -- but the error messages are unhelpful.

So far I have got no example, not your original, not my mods of it, not the examples from the mailing list discussion, to display any text in FreeSerif at all. What am I missing?

Have you tried XeTeX? It's not easy to use either, but it seems to handle modern OpenType fonts pretty well. In particular, I've used it with good results with FreeFont.

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Wed 28 Nov 2012 10:31:20 AM UTC, comment #8:

From the posting mentioned in my last commit, I see that contex relies on the old TrueType kern table, rather than the modern OpenType GPOS 'kern' lookup.

FYI Currently the builds are made with both the old and new tables. I don't like this, and some software complains about it, but there is some software (mostly in Linux!) that does the wrong thing still. The correct procedure is to prefer the kerning info in the OpenType GPOS lookup 'kern' to that in the old TrueType 'kern' table.

You might recommend to the context developers that they implement the preferred logic.

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Wed 28 Nov 2012 10:02:39 AM UTC, comment #7:

Hi Pablo,

I kept messing with it and made some progress, but no luck reproducing your example yet.

First, your test file has lost all its \ marks.

  • Could you just attach the file?
  • Please provide me the exact command line you use to build.

But even when I put \ marks in where I think they ought to be, contex chokes.

Second, I had forgotten that I had upgraded a machine to the new Ubuntu, and the context version there is 2012.05.30 MKIV. But that doesn't help so far.

Third, I tried using "context" rather than the "texexec" recommended by the introductory documentation. This behaves differently... (I must say I am not happy about this. Is it a secret what the proper command line is?)

Forth, I found your postings on
http://www.mail-archive.com/ntg-context@ntg.nl/msg66805.html
and tried some of the examples there.

With that context gives lots of
simplefonts > font 'freeserif' not found
although FreeSerif certainly is installed.

What is wrong here?
Why is this becoming yet another do-it-yourself lesson in yet another latex derivative?

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Tue 27 Nov 2012 11:41:31 PM UTC, comment #6:

The file doesn't work properly with my Ubuntu distro ConTex 2011.05.18. I don't understand the messages... they don't look like errors, but its PDF output is just the ascii text of the input file.
I'm unfamiliar with this program; I just did
texexec test.tex
Is that the wrong command, or will I have to install a newer version?

I don't understand your remark about the HTML file. What does it have to do with ConTex?

I haven't seen that E-reader. Besides some software e-readers, I have an iriver Story e-reader, also says Adobe Reader Mobile... And most font features look great on it. It is a Linux underneath though.

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Tue 27 Nov 2012 05:19:23 PM UTC, comment #5:

This is the ConTeXt source file:

\setuppapersize[A4,landscape]
\usemodule[simplefonts][size=30pt]
\definefontfeature[plusliga][default][script=latn]
\setmainfont[FreeSerif]
\setmonofont[FreeMono]
\starttext
\showfontkerns
Without {\tt liga} enabled:

dadedidodufafefifofufrflftlalelilolutatetitotu\par
{\em dadedidodufafefifofufrflftlalelilolutatetitotu\par}
{\bf dadedidodufafefifofufrflftlalelilolutatetitotu\par}
{\bf\em dadedidodufafefifofufrflftlalelilolutatetitotu\par}

\par\addfs{plusliga}With {\tt liga} enabled:

dadedidodufafefifofufrflftlalelilolutatetitotu\par
{\em dadedidodufafefifofufrflftlalelilolutatetitotu\par}
{\bf dadedidodufafefifofufrflftlalelilolutatetitotu\par}
{\bf\em dadedidodufafefifofufrflftlalelilolutatetitotu\par}
\stoptext

Thanks for the HTML chunk, but I'm afraid I cannot check this because of a problem with fontconfig (AFAIK ConTeXt doesn't use fontconfig at all).

ereader is Sony PRS-T1 with Adobe Reader Mobile 9. BTW, Ligature substitution doesn't work on my ereader (I wish it worked ;-)).

And of course, you are right: I wrote 'liga' OT feature, when I meant 'kern' OT feature.

Pablo Rodríguez <ousia>
Tue 27 Nov 2012 12:18:14 PM UTC, comment #4:

A bit more:

After an hour of messing with it, I've still been unable to reproduce the image using ConTeXt. Without your input file, I'm really guessing.

My initial judgment of the image wasn't very careful. I said, it appears that kerning is turned off -- this is not the case. Some pairs are clearly kerned, others are not.

In the last line (bold italic with liga) the pair a+f is strongly kerned, but e+fi is not. One might think that kerning is working with non-ligatures but failing with ligatures, but later in the same line o+f is not kerned. I checked: substantial kerns for all those combinations are specified in the font.

I don't understand the pattern. Weird. With liga disabled, it looks as if it ignores the font's kerning tables. With liga enabled, it looks like... it tries to kern somehow, but gets totally confused with all the f letters, sometimes kerning tightly, sometimes not.

It's a pity the example doesn't experiment with the ff ligature! That one has strong kerns on both sides.

At this point, I'm leaning toward the idea that it's a bug in some software layer.

For reference, I typed the same text into HTML, and attached the way Firefox renders it.

(And... from that I decided that a few pairs in each face could be tightened up a bit... but this is not the problem in question.)

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Tue 27 Nov 2012 10:28:46 AM UTC, comment #3:

Pablo,

Sorry, I didn't recognize in your "P.S." the typesetting system "ConTeXt". I'm experimenting with it now.

It would be really helpful to have the original ConTeXt document that resulted in the image you attached.

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Mon 26 Nov 2012 05:57:24 PM UTC, comment #2:

Regarding e-book readers,

I have actually tested FreeSerif in several e-book readers (hardware and software), and it looks great. There are some technical issues, but kerning and ligature substitution work fine.

Which e-book reader are you referring to?

Cheers!

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Mon 26 Nov 2012 05:54:01 PM UTC, comment #1:

Hi, Pablo,

Perhaps you still aren't getting my meaning.

Unfortunately, the suggestion about "kerning values to be the same" doesn't make sense. The kerning values are the same, with or without ligatures.

Kerning and ligature substitution are separate features, that can be turned on and off separately. The image you sent shows text with kerning turned off in all cases, and that is the problem. If you turn kerning on, the issue will be resolved.

FreeFont is intended to look best with kerning, and to be readable without it, but it will not look great without kerning.

Besides giving you this information, I can't really do anything more without knowing what the application is.

Thanks!

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Mon 26 Nov 2012 05:06:26 PM UTC, original submission:

If the OpenType ligature is disabled, I'm afraid that the f has wrong kerning will many vowels and consonants (see attached files).

Could you fix the f kerning values to be the same with +liga and -liga?

In some contexts (such ebook readers), it is not possible to have +liga.

Many thanks for your help,

Pablo

PS: OpenType version using ConTeXt - 2012.10.22 23:51 on Fedora 16.

Pablo Rodríguez <ousia>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #27001:  css-freeserif.epub added by ousia (475kB - application/epub+zip)
file #27002:  freeserif-test.epub added by ousia (1MB - application/epub+zip)
file #26989:  kern-xetex.tex added by Stevan_White (1kB - application/x-tex)
file #26990:  kern-xetex.pdf added by Stevan_White (17kB - application/octetstream)
file #26988:  FreeSerif-iriver.jpeg added by Stevan_White (179kB - image/jpeg - FreeSerif EPUB kerning test; running on iriver STORY e-book reader.)
file #26982:  test1.html added by Stevan_White (291B - text/html - test of same text in Firefox)
file #26983:  test-Firefox.png added by Stevan_White (69kB - image/png - test of same text in Firefox)
file #26973:  a.pdf added by ousia (16kB - applicaton/pdf)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by Stevan_White (Posted a comment)
  • -unavailable- added by ousia (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 13 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 01 Dec 2012 11:10:47 AM UTCStevan_WhiteStatusNeed info=>Non-bug
      Open/ClosedOpen=>Closed
    Fri 30 Nov 2012 11:52:10 PM UTCousiaAttached File-=>Added css-freeserif.epub, #27001
      Attached File-=>Added freeserif-test.epub, #27002
    Wed 28 Nov 2012 08:37:05 PM UTCStevan_WhiteAttached File-=>Added kern-xetex.tex, #26989
      Attached File-=>Added kern-xetex.pdf, #26990
    Wed 28 Nov 2012 12:55:41 PM UTCStevan_WhiteAttached File-=>Added FreeSerif-iriver.jpeg, #26988
    Tue 27 Nov 2012 12:21:21 PM UTCStevan_WhiteAttached File-=>Added test1.html, #26982
      Attached File-=>Added test-Firefox.png, #26983
    Mon 26 Nov 2012 05:54:48 PM UTCStevan_WhiteCategoryNone=>font metrics
      StatusNone=>Need info
      Assigned toNone=>Stevan_White
    Mon 26 Nov 2012 05:06:26 PM UTCousiaAttached File-=>Added a.pdf, #26973

    Back to the top


    Powered by Savane 3.1-cleanup