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: Wed, 19 Aug 2015 20:39:11 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

I need to figure out where to best place the darkening calculations
so they are done just once per face/size.  And how to obtain
stdVW/stdHW.

Yes :)


Thanks for your helping along so far :) I spend the day looking for a good place to do and store the calculations and am stumped again. I want to jot down my thoughts to 1. sort them out 2. hope for someone more knowledgeable to point me in the right direction.

My initial idea was to do the calculations after af_face_globals_get_metrics() filled in 'AF_*Metrics->standard_weight'[1] and store them in AF_FaceGlobals->darken. Until I noticed that they aren't redone on size changes because AF_FaceGlobals doesn't deal with size stuff. Duh. Then I thought about putting 'darken' into a sort of associative array like [12ppem -> FT_Pos(0.1), ...] and *then* store it in AF_FaceGlobals and trigger a recompute for a new size before FT_Outline_Embolden() if the new ppem can't be found in the array. That would make sure that the calculations are really only done once per size if the same face is used in multiple sizes or the client changes sizes back and forth. I guess I'd have to understand FT's memory management first to know how to grow the array.

Must investigate AF_GlyphHints and it's use to see if it's better suited than AF_FaceGlobals. I think it gets scrubbed with each size change though?! And I still have to understand the glyph slot FT_Load_Glyph recursion stuff. It still boggles my mind.

At least the dummy FT_Outline_Embolden() that I inserted after each FT_Load_Glyph() do what I want. Yay! Though I still don't know why I can't just do that once somewhere instead of after every FT_Load_Glyph() ;)

[1]: XXX: good enough or must compute 'real' stdVW/stdHW to get 'darkenX' *and* 'darkenY' instead of a 'darken' for both axes? Investigate after prototype works.

Well, ftview tries to mimick the FT_Load_Glyph arguments.  Please
proceed if you find a way to improve that!  It's not easy (at least
not for me) to get something better...

Will see if I get an idea :) Speaking of random cleaning-up thoughts, what's the project's stance on making the TrueType bytecode fitter only fit on the Y axis by default? Or would that touch the ClearType patents?

This is not true.

Whoops. Okay then ;)




reply via email to

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