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: Behdad Esfahbod
Subject: Re: [ft-devel] Taming CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y* for a gamma of ~2.2/sRGB?
Date: Fri, 21 Aug 2015 14:59:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0

Thanks Nikolaus for working on this.  This is amazing!

One thing we need to figure out before this goes out is, this will be
introducing drastic weight differences between unhinted, autohinted-light,
autohinted-medium+, and bytecode-hinted.  That's not very good.  I think at
least unhinted should get the same boost, unless turned off explicitly.
Though I might be wrong.

Do you also modify advance width?  If yes, that shouldn't happen on unhinted.
 If no, then this is essentially just a rasterizer change and shold be done
more widely.

I'm still am of the opinion that this is a hack to work around lack of
gamma-corrected blending AND lack of optical sizes.  But since it's in the CFF
engine already, we might as well do it universally.

behdad

On 15-08-20 10:40 PM, Nikolaus Waxweiler wrote:
>> 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...
> 
> ;)
> 
> _______________________________________________
> Freetype-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/freetype-devel
> 



reply via email to

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