Summary: | FIR filters with custom constants from fontconfig | ||
---|---|---|---|
Product: | fontconfig | Reporter: | Robin Johnson <robbat2> |
Component: | library | Assignee: | fontconfig-bugs |
Status: | RESOLVED MOVED | QA Contact: | Behdad Esfahbod <freedesktop> |
Severity: | enhancement | ||
Priority: | medium | CC: | akira, dirtyepic, freddie, freedesktop, pva |
Version: | 2.8 | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Robin Johnson
2010-03-30 19:59:10 UTC
I'm not very font of changing the filter values directly in ftlcdfil.c; however, I rather like the set of patches to change the filter at runtime, and I'll add them to FreeType (as soon as time permits, which can take some time unfortunately). Indeed, this particular problem was, as far as I can remember, never reported to one of the FreeType lists. IIRC, the early versions of the lcdfilter API from David did take the vector from the user. The new function is now in the git. Will update the demo programs as soon as time permits. Please test. Umm, I'm only handling the FreeType side, so I change the bug status back. > gentoo-bug306053:{ 0x1C, 0x38, 0x55, 0x38, 0x1C } These coefficients roughly correspond to 1/9, 2/9, 3/9, 2/9, 1/9 and are better known as the Gibson coefficients --- being popularised in Steve Gibson's 1998 article on sub-pixel rendering. Some of the early patch sets to Cairo used these coefficients. > russian forum: {8, 28, 100, 80, 40}; Interesting, I've never come across these before. The lack of symmetry is somewhat noteworthy --- on account that I can think of no reason to bias the right side of a glyph as opposed to the left. If anyone is interested in the differences between the light, gibson and default coefficients a comparison can be found here: http://freddie.witherden.org/pages/font-rasterisation/images/fir-filtered.png [light, gibson, default, regular AA]. I'd be interested if anyone had any suggestions for a syntax for this configuration. As currently so far as LCD filtering goes we have two different kinds of filter: intra-pixel (legacy) and inter-pixel (FIR, default and light) which will soon include customisable coefficients. Currently, I think the best course of action so far as fontconfig goes is to use this new found FT functionality to define a couple more pre-sets namely gibson (see above) and whatever we think Microsoft uses for ClearType. (In reply to comment #5) > > gentoo-bug306053:{ 0x1C, 0x38, 0x55, 0x38, 0x1C } > These coefficients roughly correspond to 1/9, 2/9, 3/9, 2/9, 1/9 and are better > known as the Gibson coefficients ... Hah, I knew in the back of my head I'd seen them somewhere before, but couldn't place them. My distant past playing with the VGA demoscene :-) > > russian forum: {8, 28, 100, 80, 40}; > Interesting, I've never come across these before. The lack of symmetry is > somewhat noteworthy --- on account that I can think of no reason to bias the > right side of a glyph as opposed to the left. Maybe readability on bad fonts? > If anyone is interested in the differences between the light, gibson and > default coefficients a comparison can be found here: > http://freddie.witherden.org/pages/font-rasterisation/images/fir-filtered.png > [light, gibson, default, regular AA]. Thanks for the nice image :-) > I'd be interested if anyone had any suggestions for a syntax for this > configuration. As currently so far as LCD filtering goes we have two different > kinds of filter: intra-pixel (legacy) and inter-pixel (FIR, default and light) > which will soon include customisable coefficients. Extend the matrix element attributes for size and type, add a element to represent uint8, allow matrix to have int/double/uint8 child elements? > Currently, I think the best course of action so far as fontconfig goes is to > use this new found FT functionality to define a couple more pre-sets namely > gibson (see above) and whatever we think Microsoft uses for ClearType. +1 (In reply to comment #3) > The new function is now in the git. Will update the demo programs as soon as > time permits. Please test. Is it? I don't see it. (In reply to comment #5) > Currently, I think the best course of action so far as fontconfig goes is to > use this new found FT functionality to define a couple more pre-sets namely > gibson (see above) and whatever we think Microsoft uses for ClearType. Nope. Fontconfig should simply allow specifying a custom filter. It's git commit 460d23f1. I see. Thanks. any operator to access the byte array may be required in fontconfig: <edit name="lcdcustomfilter" mode="assign"> <array> <int>0x1C</int> <int>0x38</int> <int>0x55</int> <int>0x38</int> <int>0x1C</int> </array> </edit> -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/90. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.