tag:blogger.com,1999:blog-203063759820106893.post2756391105255505362..comments2023-03-25T08:30:26.602-04:00Comments on A Moment of Zen: Moonlight Text RenderingJeffrey Stedfasthttp://www.blogger.com/profile/12271561115384429651noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-203063759820106893.post-85943998295669868492008-03-25T15:10:00.000-04:002008-03-25T15:10:00.000-04:00BTW, the Agg article and the Turner patches amount...BTW, the Agg article and the Turner patches amount to more or less the same: No horizontal stem snapping, etc.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-10545494264525005042008-03-24T12:27:00.000-04:002008-03-24T12:27:00.000-04:00Aha, thanks Sean! I've read that article when it w...Aha, thanks Sean! I've read that article when it was published a while back, but that was before I had started working on text rendering for Moonlight so I hadn't paid it much attention.Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-79481969292659382332008-03-22T14:15:00.000-04:002008-03-22T14:15:00.000-04:00For what its worth, I think the hinting makes the ...For what its worth, I think the hinting makes the type look pretty bad. It makes the spacing between letters all uneven, and causes the shapes to get sort of lumpy and awkward.<BR/><BR/>And I don't think hinting really helps make the text more readable. Research has shown that we read more based on the overall shape of words than identifying individual features of letters. If anything, not-hinting preserves better the shape of the letters and words making reading easier. <BR/><BR/>Nice crisp verticals don't add much except a belief amongst developers that the rendering is somehow better because it has nice crisp verticals.Erikhttps://www.blogger.com/profile/05378825926763602485noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-72546770398596616772008-03-22T13:17:00.000-04:002008-03-22T13:17:00.000-04:00Sean: was just looking for the antigrain article....Sean: was just looking for the antigrain article.. this has to be the way forward, surely ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-7237569521166595502008-03-22T11:27:00.000-04:002008-03-22T11:27:00.000-04:00Well, deciding how (or if) to hint text in potenti...Well, deciding how (or if) to hint text in potentially dynamic contexts is problematic indeed.<BR/>Although freetype with David Turner's patches is incredibly helpful (in your screenshot, Pango+ft's render sucks), there's no denying that a compromise is needed. Many people are afraid because font hinting is a damn patent minefield. Ubuntu chose to assume the risks, at least since Gutsy, btw.<BR/><BR/>Something I think that would help is the ability to use different hinting modes for horizontal and vertical directions (I think agg's article explores that possibility).<BR/><BR/>agg's article mentioned by Sean is also helpful, but I think that there is always going to be a compromise between animation-enabled rendering and quality rendering... Flash has designer-specified rendering modes for this (so if you won't transform or animate, you can have sharper fonts). What Chris says MS does is not so nice, I think (too instrusive for the user).<BR/><BR/>I would try Light hinting with Turner's excellent patches, and if it's not enough, then switch to non-hinting mode. Of course that depends on the runtime environment.<BR/><BR/>Keep the good work,<BR/><BR/>nachokbnachokbhttps://www.blogger.com/profile/05216212650895955802noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-74373100029414424262008-03-21T23:30:00.000-04:002008-03-21T23:30:00.000-04:00Isak/Jeff: MS intentionally does low quality text ...Isak/Jeff: MS intentionally does low quality text rendering when the text is animated (there's an IsAnimated property someplace in PresentationCore.. ValueSource maybe). There's a timer that makes a pass once it's stopped which switches to a higher quality layout/rendering.Chris Toshokhttps://www.blogger.com/profile/10052533829927815210noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-67878908647922183682008-03-21T19:26:00.000-04:002008-03-21T19:26:00.000-04:00isak: yea, someone else mentioned that to me on IR...isak: yea, someone else mentioned that to me on IRC. I wonder what they are doing...Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-64999583581012376662008-03-21T19:19:00.000-04:002008-03-21T19:19:00.000-04:00marius: Silverlight does not support RTL, so line-...marius: Silverlight does not support RTL, so line-breaking is pretty much the only thing that Moonlight would really gain by using Pango. But as I mentioned, I'd still have to override Pango's wrapping modes to do what I needed which would pretty much defeat the purpose :(<BR/><BR/>(unless we could design some API that allowed all that logic to stay within Pango but give me some means of overriding the behavior in a way that didn't require me to implement my own Unicode line-breaking logic... but not sure how that could be done)<BR/><BR/>Inserting a zero-width space would not get me the desired effect afaict, I've already been dealing with those in a test suite I've been running my text layout code against.<BR/><BR/>taschenorakel: whether I end up using Pango or not, some of the features I'd need in Pango would still be useful for other applications, sure. And these features should definitely be added to Pango regardless :)Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-35541723716500991802008-03-21T19:15:00.000-04:002008-03-21T19:15:00.000-04:00Regarding font readability during animations..I do...Regarding font readability during animations..<BR/><BR/>I don't know if it's just on my hardware, but I think microsoft is actually "cheating" during animations in WPF.<BR/><BR/>If you assign e.g. a DoubleAnimation affecting the scale (in a layout or render transform) for a textblock, the text is blurry during the entire animation, and then at the end (like a few milliseconds after it), it becomes clear again.Isakhttps://www.blogger.com/profile/15112543968000120505noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-16319337934195687612008-03-21T18:27:00.000-04:002008-03-21T18:27:00.000-04:00Hmm, But hinting disabled (as Moonlight on the scr...Hmm, But hinting disabled (as Moonlight on the screenshot), some letters look _really_ clumsy.<BR/><BR/>That's not good....<BR/><BR/>Isn't there a midway?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-80078748113231295062008-03-21T18:20:00.000-04:002008-03-21T18:20:00.000-04:00YES IT IS WORTH, if you consider being part of our...YES IT IS WORTH, if you consider being part of our community: Implementing that features in Moonlight benefits only Moonlight. Pushing that features to Pango benefits the entire community.<BR/><BR/>Ciao,<BR/>MathiasAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-87375901290848712952008-03-21T18:15:00.000-04:002008-03-21T18:15:00.000-04:00Is line-breaking logic really the only thing you'd...Is line-breaking logic really the only thing you'd gain from using Pango? What about supporting right-to-left languages or complex scripts like Arabic or Devangari?<BR/><BR/>On the matter of additional break points between runs, wouldn't inserting U+200B ZERO WIDTH SPACE do what you want?Marius Gedminashttps://www.blogger.com/profile/15155998626202067226noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-4106038634594477612008-03-21T18:01:00.000-04:002008-03-21T18:01:00.000-04:00Freetype only does what you tell it to do. You can...Freetype only does what you tell it to do. You can just as well disable hinting and then try to compare the results.<BR/><BR/>I think it would actually be in the interest of the general public to improve Pango to be more versatile, even if this is not trivial. Best to keep efforts concentrated.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-70534026498287209642008-03-21T17:39:00.000-04:002008-03-21T17:39:00.000-04:00Hi,I've faced the scaling of hinted font issue whe...Hi,<BR/><BR/>I've faced the scaling of hinted font issue when working on the gnumeric graph engine, and solved it by not changing the font size, but just use a different cairo scale.<BR/><BR/>It's not a perfect solution, since the character are not nicely spaced, but at least the graph layout doesn't change when changing the zoom factor.<BR/><BR/>If you want to see how it behaves, open a recent gnumeric (1.8.x), create a graph with some text, then resize the guru window.<BR/><BR/>But what we really want is something that's described in Owen Taylor's Grid Fitting document:<BR/><BR/>http://people.redhat.com/otaylor/grid-fitting/Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-51753736821743150152008-03-21T17:29:00.000-04:002008-03-21T17:29:00.000-04:00The reason text jumps is not so much because of hi...The reason text jumps is not so much because of hinting as because of how freetype does hinting. It's doing it wrong - or more accurately, it's optimized for a use-case other than "correct layout."<BR/><BR/>This is a huge article covering this - I'd assume you've read it, but maybe you've missed it.<BR/><BR/>http://antigrain.com/research/font_rasterization/index.htmlAnonymousnoreply@blogger.com