Announcement

Collapse
No announcement yet.

FreeType 2.4.12 Features New CFF Engine

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • FreeType 2.4.12 Features New CFF Engine

    Phoronix: FreeType 2.4.12 Features New CFF Engine

    Last week Adobe open-sourced their CFF rasterizer engine -- in conjunction with Google -- for use by FreeType. Now FreeType 2.4.12 has been released to ship these CFF font improvements...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    I'm not familiar with fonts and how fonts are handled guys, so this may be a stupid question...

    When it comes to high DPI and large magnification, fonts tend to look like crap and part of the font engine's job is to make them clearer and less of an issue.... wouldn't all fonts in vector formats fix this? I know when i pull up a vector image of a program's icon vs a non-vector, I can immediately tell the difference between the two because the vector still looks good even when enlarged.

    Is there a specific reason why we don't use vectors for fonts? Or are we already using vectors for fonts and its a different issue that comes up? Or something else?
    All opinions are my own not those of my employer if you know who they are.

    Comment


    • #3
      They're already using vectors (except for bitmap fonts that are very rare).
      And actually, I see the issue much more with small font sizes. When fonts are big, they usually look very good.

      Comment


      • #4
        Originally posted by Ericg View Post
        I'm not familiar with fonts and how fonts are handled guys, so this may be a stupid question...

        When it comes to high DPI and large magnification, fonts tend to look like crap and part of the font engine's job is to make them clearer and less of an issue.... wouldn't all fonts in vector formats fix this? I know when i pull up a vector image of a program's icon vs a non-vector, I can immediately tell the difference between the two because the vector still looks good even when enlarged.

        Is there a specific reason why we don't use vectors for fonts? Or are we already using vectors for fonts and its a different issue that comes up? Or something else?
        I'm not sure this will answer your question (and I'm not an expert here) but as retina displays become the norm, font handling should become easier since you shouldn't have to alias anymore. Thus one of the big differences between font types (how they handle grid alignment and how they alias, along with hinting) should just go away.
        Most fonts are "vector" (outline by way of cff or tff/otf), by the way, but they (well, not cff, apparently) can also include bitmaps for specific difficult character/resolution combinations.
        Turn off hinting and I would expect fonts to look better in a retina situation.

        Comment


        • #5
          The new CFF hinting engine is fantastic. To try it out from git, do:

          Code:
          --- a/src/cff/cffobjs.c
          +++ b/src/cff/cffobjs.c
          @@ -1056,8 +1056,8 @@
           
           
               /* set default property values */
          -    driver->hinting_engine    = FT_CFF_HINTING_FREETYPE;
          -    driver->no_stem_darkening = FALSE;
          +    driver->hinting_engine    = FT_CFF_HINTING_ADOBE;
          +    driver->no_stem_darkening = TRUE;
           
               return FT_Err_Ok;
             }
          The stem darkening thing is a matter of taste but makes CFF fonts appear more saturated, making them stick out when used together with Truetype fonts, which still make up the majority of (web)fonts out there. Mind you, the new engine will only work with (manually) hinted CFF fonts (usually contained in .otf files), it will do nothing for Truetype (.ttf) or old Postscript fonts (.pfa, .pfb) like the Helvetica and Times replacements from the Ghostscript package (Nimbus Sans L, etc.), even though they do contain hints! The solution to the latter problem is to convert the PS fonts to .otf with e.g. FontForge or with an online service, follow the instructions on http://voices.yahoo.com/use-fontforg...02.html?cat=15.

          Next, instruct fontconfig as follows in .config/fontconfig/fonts.conf:

          Code:
              <match target="font">
                  <test name="fontformat">
                      <string>CFF</string>
                  </test>
                  <edit mode="assign" name="autohint">
                      <bool>false</bool>
                  </edit>
                  <edit mode="assign" name="hinting">
                      <bool>true</bool>
                  </edit>
                  <edit mode="assign" name="hintstyle">
                      <const>hintfull</const>
                  </edit>
              </match>
          Use Adobe's Source Sans Pro and Source Code Pro to test this. Play with stem darkening if you like. Bask in the glory that are beautifully hinted fonts.

          Comment


          • #6
            Originally posted by Ericg View Post
            I'm not familiar with fonts and how fonts are handled guys, so this may be a stupid question...

            When it comes to high DPI and large magnification, fonts tend to look like crap and part of the font engine's job is to make them clearer and less of an issue.... wouldn't all fonts in vector formats fix this? I know when i pull up a vector image of a program's icon vs a non-vector, I can immediately tell the difference between the two because the vector still looks good even when enlarged.

            Is there a specific reason why we don't use vectors for fonts? Or are we already using vectors for fonts and its a different issue that comes up? Or something else?
            If font's appear blurry or pixelated that is probably because you are zooming/scaling the font AFTER it has been rendered to the out surface.

            Comment


            • #7
              Originally posted by Ericg View Post
              I'm not familiar with fonts and how fonts are handled guys, so this may be a stupid question...

              When it comes to high DPI and large magnification, fonts tend to look like crap and part of the font engine's job is to make them clearer and less of an issue.... wouldn't all fonts in vector formats fix this? I know when i pull up a vector image of a program's icon vs a non-vector, I can immediately tell the difference between the two because the vector still looks good even when enlarged.

              Is there a specific reason why we don't use vectors for fonts? Or are we already using vectors for fonts and its a different issue that comes up? Or something else?
              Fonts are not supposed to look identical at all sizes. A font that looks good at 8 points won't look as good at 12 points if it is simply scaled up, regardless of how perfect the scaling is. It's an aesthetic issue, not a technical one.

              My understanding is that's why we even have hinting in the first place.

              Edit: Changed my example point sizes. 12 to 48 was a ridiculous example.
              Last edited by Serge; 11 May 2013, 12:09 AM.

              Comment


              • #8
                Originally posted by mudig View Post
                Play with stem darkening if you like. Bask in the glory that are beautifully hinted fonts.
                I'm going to build this version with the CFF-enabling patch later today, I was wondering what you meant by 'play with stem darkening if you like' ?

                Comment


                • #9
                  Originally posted by XorEaxEax View Post
                  I'm going to build this version with the CFF-enabling patch later today, I was wondering what you meant by 'play with stem darkening if you like' ?
                  I mean, do "driver->no_stem_darkening = TRUE;" or "driver->no_stem_darkening = FALSE;" and see what you like better.

                  Comment


                  • #10
                    Originally posted by mudig View Post
                    I mean, do "driver->no_stem_darkening = TRUE;" or "driver->no_stem_darkening = FALSE;" and see what you like better.
                    Ah, I see now, I just tried it using the straight up patch from the release notes (ie no stem darkening) and I think it renders dark enough as it is on the fonts I've tried (same adobe fonts as you + Linux Libertine), certainly (imo) a noticeable improvement on the previous CFF rasterizer, particularly when using 'hintfull'.

                    Comment

                    Working...
                    X