freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Taming CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y* for a gam


From: Nikolaus Waxweiler
Subject: Re: [ft-devel] Taming CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y* for a gamma of ~2.2/sRGB?
Date: Thu, 20 Aug 2015 23:40:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

As soon as you switch to a new size, simply recompute the values.

Done! I'm almost there. I have extended AF_FaceGlobals to hold:

 ...
 FT_UShort stem_darkening_for_ppem;
 FT_Pos    darken_x;
 ...

and modified af_loader_load_g() to do:

 ...
 error = FT_Load_Glyph( face, glyph_index, flags );
 ...
if ( face->size->metrics.x_ppem != loader->globals->stem_darkening_for_ppem )
   af_loader_compute_darkening( ... );
 if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
   FT_Outline_EmboldenXY(..., ...->darken_x, 0);
 ...

That works for size changes. I have crudely... copy-pasted and adapted cf2_computeDarkening() into af_loader_compute_darkening(). I feel dirty now but IT WORKS!!! There's just one problematic line left:

 ...
 stemWidth = cf2_intToFixed(84); /* XXX fill in somehow */
 ...

That's hopefully the last step ;) Thanks for all your pointers so far! That helped a lot :) I uploaded a small screenshot to show how it looks like with the current stand-in: http://postimg.org/image/6obxidt9d/ (native CFF engine, emboldening autohinter, normal autohinter, all with a gamma of 1.8).

A similar argument holds for `af_latin_metrics_init_widths': Only the
stem width measured along the vertical axis is used for light hinting.

Meaning, I'd have to modify AF_*Metrics to also compute stem widths on the horizontal axis and use that for stemWidth? By the way, I can't directly access e.g. AF_LatinMetrics->axis->standard_width from my af_loader_compute_darkening() as I have only an AF_StyleMetrics to go from.. Is there a reason why standard_width is specific to writing class implementations of AF_StyleMetrics? I'll see if I can find a way around or get a hold of the implementing class somehow... but first some sleep..

The current subpixel hinting code should already be quite near to
that goal.

And what keeps it from being made the default mode for the native TT fitter?

Oh, and what's that about subpixel hinting in af_loader_load_glyph()?

Certainly not.  You can't patent the omission of something if
everything else stays the same...

;)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]