Windows, ttfautohint, and 'strong stem width/positioning'

Lar Gactyl
Lar Gactyl Posts: 10
edited March 2017 in Type Design Software
I am trying to apply ttfautohint to a font generated in FontForge, but I seem to be having problems with the "strong stem width and positioning" settings. As far as I understand, this is supposed to toggle the snapping of horizontal strokes to the pixel grid. I've tried setting this to either 'smooth' or 'strong' for all three Windows targets (grayscale, GDI ClearType, DW ClearType), but I barely see any difference in the results.

The way my font is designed, the "-" (hyphen) for instance is one pixel wide at 12pt, and two at 24pt. I'd like this width to be properly anti-aliased when I vary the font size (that is, what I want is the 'smooth' option here). But that never happens, no matter what I set it to; I still get discrete steps in width -- the hyphen stays one pixel wide up to 17pt, then abruptly becomes two pixels wide at 18pt.

Needless to say, this greatly distorts the appearance of my font. There *are* some minimal differences in rendering when I compare the 'smooth' and 'strong' settings, but they're pretty much unnoticeable, and the long straight horizontal strokes are not affected.

FWIW, I'm testing on Windows 7. My font doesn't suffer from this issue on Linux and Mac. I know that Windows renderers are notoriously overzealous with snapping outlines to the pixel grid, but can this be salvaged somehow? Am I missing some setting e.g. in the 'Grid Fitting' table that could solve this?

Comments

  • Mike Duggan
    Mike Duggan Posts: 239
    Have you tried setting the GASP table to always use ysmoothing? 
  • Have you tried setting the GASP table to always use ysmoothing? 
    I can give that a try -- any tips on how to properly do that with FontForge? It does lets me to modify the Grid Fitting (GASP) table, but the terms/settings used there are rather different.
    Or... come to think of it, it would probably be best to do that after the ttfautohint step, in which case a different (external) tool would be best; any recommendation for such a tool to tweak the GASP table?

  • Mike Duggan
    Mike Duggan Posts: 239
    VTT can edit the GASP table
  • Mike Duggan
    Mike Duggan Posts: 239
    this is how I would recommend the settings.

    when these settings are used, you should set the GASP to always use ysmoothing, and you should not then see the discrete steps in DirectWrite rendering environments.
  • Thanks, I'll try that. Out of curiosity, is there any specific reason for keeping "strong" stems enabled for GDI CT?
  • Mike Duggan
    Mike Duggan Posts: 239
    because there is no support for y-smoothing in GDI as of today.
  • Mike Duggan
    Mike Duggan Posts: 239
    Lar Gactyl real name? :)
  • No, not exactly. ;)

    To enable y-smoothing using VTT's GASP-table editor, do I uncheck 'grid fitting' for all entries?
    If so, that does not appear to work.  In fact, I also tried most of the available combinations using FontForge's own GASP table editor, but to no avail... either I'm misunderstanding something, or this table only applies in limited scenarios (that is, I'm mistaken in assuming that DirectWrite CT is used e.g. in Win7's Font Viewer, Notepad, or most other normal situations).

    At any rate, my horizontal strokes are still being discretely grid-snapped... any other ideas would be welcome.
  • Mike Duggan
    Mike Duggan Posts: 239
    If you send me the font I will take a look mikedu at Microsoft.com
  • Mike Duggan
    Mike Duggan Posts: 239
    Direct write is not used in Win 7 font viewer, or notepad
  • Mike Duggan
    Mike Duggan Posts: 239
    Both use GDI, which does not support ysmoothing so can only snap and break in discrete pixels
  • Both use GDI, which does not support ysmoothing so can only snap and break in discrete pixels
    Okay then, that answers my question (even if it's not the answer I hoped for). :) Know of a quick and easy way to preview fonts specifically in DirectWrite, maybe?
  • All current versions of Edge, Firefox and Chrome use DirectWrite as far as I know.