[haiku-bugs] Re: [Haiku] #7797: [app_server] Alternative implementation of subpixel rendering (patch)

  • From: "stippi" <trac@xxxxxxxxxxxx>
  • Date: Thu, 18 Dec 2014 10:06:07 -0000

#7797: [app_server] Alternative implementation of subpixel rendering (patch)
----------------------------------+----------------------------
   Reporter:  diver               |      Owner:  leavengood
       Type:  bug                 |     Status:  in-progress
   Priority:  normal              |  Milestone:  R1
  Component:  Servers/app_server  |    Version:  R1/Development
 Resolution:                      |   Keywords:
 Blocked By:                      |   Blocking:
Has a Patch:  0                   |   Platform:  All
----------------------------------+----------------------------

Comment (by stippi):

 These findings are correct. However, the custom sub-pixel filter (average
 based) looks crappy for any fonts that are not strongly hinted. If a glyph
 is already strongly hinted, or designed to fit a pixel grid in the first
 place, then the freetype subpixel filtering will actually make it more
 blurry, since perfectly aligned stems are blurred by the filtering. For
 this reason, I came up with the average based filtering. The idea was to
 take the gray scale anti-aliased result, and mix it with the unfiltered
 sub-pixel result. This should lead to a result which is sharper than the
 gray-scale rendering alone, but does not have color fringes as bad as the
 pure sub-pixel result. The slider lets the user adjust the weighting
 between the two results. In practice, it can still have strongly colored
 pixels. It has no blurring problem, but the freetype filtering is overall
 more homogeneous in appearance. Many people (including myself in the
 meantime) prefer the freetype blurring.

 Way back in time, I came across a site which claimed there is prior art to
 the sub-pixel rendering, and the ClearType patents should be invalid. They
 mentioned that Apple used the trick on some two-color displays way back,
 but I don't remember the details. Of course this may not affect the
 patents if they only concern the exact method of filtering versus the idea
 of sub-pixel rendering in itself.

 In any case, it should be possible to do what you recommend in comment:18.
 All app_server needs from freetype is to render the glyph with 3x the
 width. This is achieved by passing the flag which is disabled by the
 define. But it could also be accomplished by simply setting a transform
 matrix. If you don't want to mess with app_server code to do that,
 enabling just one of the defines hopefully gets the results.

--
Ticket URL: <https://dev.haiku-os.org/ticket/7797#comment:19>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: