Older blog entries for raph (starting at number 148)

I come not only to praise you, but also to bury you

Let me say up front: I bear no ill will against SourceForge, and feel that they have done an incredible service for the free software community. That said, their goals and those of free software are diverging. And, while I hope that SourceForge is able to survive, the prospect of SourceForge Enterprise Edition running on Solaris, powered by an Oracle 8i database fills me with no more excitement than Windows XP Pro. That's based on free software too, right? (historically, the TCP/IP stack has been BSD-derived code)

Unfortunately, the SourceForge people aren't being very helpful about the transition. We'd like to preserve SF as a read-only CVS mirror, but they won't do this. I've also gotten no movement from them about exporting the tracker. While Pat claims that there hasn't been much interest in this, it's consistently been our top request. Nice to know our needs count for so much, thanks. Wes Felter said it well: Thinking about various free services that people are worrying about, I realized that I tend to think about the issues from an accountability perspective. I don't want to use a service if the service provider isn't accountable to me.

We'll be able to replace SF at fairly low cost. The server cost $1250, colo is $250/month, and it'll probably take jack about a month working part time to get CVS, Bugzilla, and related stuff running about as smoothly as it was on SF.

The strange thing is that SF's new business model goes directly against the principles of open source. It's one thing if "collaborative development" is a core competency of your company - then you clearly build your own, as a competitive advantage. But if it's non-critical enough that you're willing to outsource it, you might as well save money and use the existing open source tools that are available. That way, you also avoid all the risks of having your vendor suddenly vanish, as well. If the people who implement these systems cooperate and share their fixes and improvements, everybody benefits. This, it would seem to me, is the core of the open source model.

Strangely, LNUX stock is going up a bit. Perhaps Wall Street feels that they have a chance of being profitable once they shed themselves of all that stupid free software deadwood.

Printing

The inkjet list (and the IJS project) continues to have a lot of activity. I just posted a rather extensive missive about color management on inkjets, and there's quite a bit of other discussion worth reading, as well (at least if you're interested in inkjets).

Grant's completed notes on the OSDN printing summit are also worth reading. Come now, my IJS presentation wasn't that boring, was it? (I freely admit that it was high-level and quite vague on the details, though)

It seems that people are pretty dissatisfied with printing on OS X, especially with older devices. I'd love to see a really clean distribution of Ghostscript and high quality inkjet drivers, but am not at all eager to take on the packaging work myself.

Fonts

I'm continuing to collect screenshots from antialiased font renderers. As I remembered, Microsoft Reader's is particularly pretty. I have the feeling that their fonts were carefully hand-tuned for a handful of faces and sizes. For one, I can't easily find any TTF's in the Reader 2.0 installation.

Incidentally, Reader seems to automatically sense the fact I'm on an LCD screen, and so turns on ClearType, with no way I can figure out to turn it off. Anyone on a CRT who can get me the equivalent screenshot without ClearType, or alternatively tell me the magical setting to turn it off?

I also pulled some screenshots from Acrobat 5. Note how much sharper the Type1 Times sample is than the TrueType. The latter is completely unhinted. The former uses a brand-new AA T1 hinting algorithm, not present in Acrobat Reader 4 (which, incidentally, is still the most recent version for Linux that Adobe sees fit to provide).

We're continuing to delve into the PMingLiU mess (actually Peter is doing most of the work). No real resolution yet, but when we do get some we'll share it, especially with FreeType.

Old-timers

nymia: why do you act so surprised that old-timers have any useful knowledge? Do you really think that computer science has changed all that much just because drives are measured in GB rather than MB?

I consider myself to be more of the old-timer generation than most of the young whippersnappers who write Linux software. I'm 31, but have been a fairly hardcore programmer for three quarters of that time. In addition, I grew up on the writings and work of the serious old timers in the field, including K&R, Dijkstra, Hoare, and so on.

This gives me a somewhat different perspective than most people - how many other people do you know who write their websites in C? I'm a curmudgeon about scripting languages - while I appreciate how much easier they make certain tasks, I also think they encourage sloppy programming. PHP, in particular, just seems icky to me. I'm not at all surprised to see that it's a dangerous tool for creating security vulnerabilities, in part because it's easy for people without real programming knowledge to use it.

Mac

I got the extra 512MB SIMM for the iMac, and you know what? It still feels pokey to me. According to El Reg, 1.6 GHz P5's exist as protypes. These will be seriously sweet machines, no doubt.

I'm not sure why it's as slow as it is. The "Hello World" Cocoa application takes a few hundred milliseconds to start up (with a warm cache), but most of that is after control is passed to main(). Perhaps the NextStep framework is too bloated or something - object-heavy UI toolkits tend to grow a lot of overhead (Swing is the other example that comes to mind).

Font rendering

I've learned a hell of a lot about modern font renderers in the past couple of days. Neither Adobe Acrobat nor OS X use the instructions in TrueType fonts for antialiased hinting. This yields lower contrast than your OS9 or Win9x desktop, but also more accurate rendering of the glyph shapes.

But what's even more interesting to me is the fact that Acrobat Reader 5 does apply hinting to Type1 aa rendering. It appears to be a different algorithm than the non-aa renderer, and in any case applies a lot less distortion. In particular, it doesn't seem to quantize stem widths to integral pixels. Instead, it mostly focusses on gently nudging stems to improve contrast. For example, if a stem is exactly one pixel wide, then it should be exactly aligned with a pixel. For 1.5 pixel wide stems, there's a sliding window of .5 pixel where the center pixel is 100% black, but the relative contribution of the two side pixels varies. For the other 0.5 pixel of the phase space, you don't have any pixel at 100% black, so you lose contrast. This "gentler" hinting the right way to go for aa rendering, I think.

I think a big part of the contrast issue is what people are used to. I'm typing this on a 133 dpi LCD screen (an IBM A22p). My browser is Netscape 4.77, and the font is Lucida at a 17 pixels, from the X bitmap font collection. It's actually a pretty font, and is of course related to the Lucida Grande that's the default on Mac OS X. At this size, the stem thickness is 2 pixels, and, because it's a non-aa render and an LCD screen, the contrast is maximal. The window next to this one is a screenshot of Mac OS X. The text looks positively faded by comparison, so much lower is its contrast. Yet, sitting at the Mac, my eyes get used to it. I guess the visual system lumps together all factors affecting contrast, including CRT fuzziness, white luminance/black reflectance ratio, and then "normalizes" so that you only consciously see relative contrast compared with maximum. Part of the brilliance, then, of OS X is that everything on the screen is antialiased without hinting. This won't happen on Linux for a while.

Anyway, at some point I'll write up what I've found, with screenshots and everything. It's certainly been interesting for me.

5 Nov 2001 (updated 5 Nov 2001 at 17:14 UTC) »
Mac OS X first impressions

The iMac came this week, and I've spent quite a bit of time playing with it. It's now landed in Alan's playroom, so at least I won't be tempted by it during the day.

Overall, they've done a great job. Alan (who's five and a half) is able to use the machine fairly fluently. Not only that, but the machine more or less worked out of the box. These are pretty strenuous tests, ones that a commodity PC running any version of Linux would fail pretty badly.

Underneath the hood, it's a pretty good Unix. I was able to compile Ghostscript, ircii, and a few other things with absolutely no difficulty. About the only thing I really miss so far is strace, and that's possibly because I just haven't found the BSD variant yet.

The expectations around Macs are just so different than what I'm used to. Consider this Mac user who feels that one kernel panic in a month is cause for "glowing pride" about stability. I also got a kernel panic doing userish things, but probably putting the machine under more stress than most users (I tend to do that). To me, this kind of stability record means that it needs some serious work. I wish the Darwin team well on this.

Raw hardware price/performance is another area where Mac and PC hardware diverge. I got the least expensive iMac (at $799), and it is obviously made with some of the cheapest parts possible. For one, the 500MHz G3 CPU is roughly equivalent to 600MHz in the x86 world. Try buying a new x86 machine that slow - it'll be a challenge (for contrast, the $599 Dell Dimension 2100 has a 1.1 Celeron, and twice as much RAM, to boot). There's also 64M of PC100 RAM in there, and a 20G hard drive. These aren't insane choices for a low-end system, but even their "high-end" dual 800MHz G4 clocks in with generic PC133 memory. Apple charges a pretty penny for this trailing-edge technology, as well. iMac RAM upgrades run $0.78/MB, while Crucial charges about $0.11/MB. PriceWatch has PC100 memory for $0.045/MB (and PC133 for the same price!), but to me the chance of compatibility or stability problems just wasn't worth it.

Of course, Apple users aren't buying megahertz and simm's, they're buying a system that just works. For the most part, I think they're getting their money's worth.

Diehard Mac enthusiasts will have you believe that Apple hardware comes with some mystical "Quality" missing in x86-based PC's, but I tend to doubt it. I've found a few minor irritants with the machine that you'd think Apple would have fixed. The most annoying to me is the fact the keyboard generates extra press events when you type with "rollover". The way I type "cd ", it comes out as "cdd ". The $11 Mitsumi keyboard that came with my cheapo dual 400MHz Celeron doesn't have any defects like this, and it's quieter and feels better to my fingers.

You get the development environment for free. That's cool. For native OS X applications, you want to use ProjectBuilder, which is a decent IDE based on Jam/MR for the actual build engine. The compiler is GCC, and the debugger is GDB, but the IDE does a pretty good job abstracting those away. You write your apps in Objective-C, on top of the Cocoa framework, which is all actually quite similar to NextStep. There's been a GNUstep project for a while, attempting to clone this environment, and they're no doubt hard at work on the OS X enhancements as well.

There's also Carbon, which is primarily for porting older Mac apps. That's much less interesting to the free software community. Lastly, there's Classic, which boots the actual MacOS 9 operating system in a virtual machine. It works, I suppose, but it feels clunky (even by Linux standards), and it's clear that its main function is to go away as OS X native applications become available.

I like the "app bundle" concept, in which applications are directories containing an executable, localization files, and other resources. I think it's easier for users than the Unix tradition of binaries in /usr/bin/appname, data under /usr/share/appname/, etc. Further, they've got libraries in bundles the same way (called "frameworks"), so your library and header files are together. Even better, it's pretty easy to create a bundle. We'll probably put make targets into the Ghostscript build to make it into an OS X framework.

OS X is visually quite appealing. With all the antialiasing and transparency, it feels "softer" than a comparable Linux, or even Win2k install. I also note that the aa font rendering seems to have changed radically between OS9 and OS X. The former is your standard algorithm of applying the TrueType hints intended for non-aa rendering to the outline, then rendering at 4x and subsampling. In MSIE5 (which is the default browser), a lot of glyphs end up not looking very good. The "2" in Times Roman is a classic case.

In OS X, the hinting is a lot more subtle, so it's quite a bit closer to a non-hinted aa render. It's a tough tradeoff. You get much more accurate rendering of the glyph shapes, but at the cost of lower edge contrast. I get the feeling there's still some hinting in there, but haven't investigated carefully yet. I'll post some screenshots when I do.

You'd think that an overall softer render would have been a good opportunity to crank up the resolution, but no. In fact, the default is 800x600. This is roughly the res I'd like to see on a handheld, not a desktop. Fortunately, it's easy enough to crank it up to 1024x768. Part of this, no doubt, is Apple's penchant for cheap components. While the video tube doesn't suck, it's only 15 inches, it's a plain shadow mask (as opposed to Trinitron), and it has a fairly high "black" reflectance.

I'm confused about whether the underlying software will support a move to higher resolutions or not. All the user interface guidelines are written in terms of pixels, and the UI builder tool (InterfaceBuilder) places components in absolute pixels, rather than the logical layout of Gtk+ and others. This will make it hard to change the resolution, but on the other hand, it might be possible to just apply a scale factor in the rendering engine. I sense some difficulty for Apple here in the future, as non-low-res displays become more common.

I encourage people in the free software community to take a careful look at OS X. They've largely succeeded in creating a usable desktop on top of Unix, which is a goal we're still striving for. They've done a lot of things right, and very few hopelessly wrong (that I can see), even though it's clear that they have a significant journey ahead of them to make the user experience totally seamless. It's worth learning from their experience.

Hi!

It's cool to see both forrest and mbp interested in Ghostscript. I'm really glad to be working on this project - a year ago, it may not have seemed all that sexy compared with other stuff that was happening, but today stability and maturity sound pretty good to me. There are cool things happening in Ghostscript development too. A lot of what interests me will be useful in the long haul, such as high quality font rendering. I'd like it if the Ghostscript graphics library had roughly the same relationship to the dream free desktop environment of the future as Quartz does to OS X.

Rich Tennant's Ghostscript cartoon is now up at ghostscript.com. Enjoy!

Interest in IJS has definitely picked up. This is likely to be very good news for people who want their inkjet printer to just work. A common interface would allow the various inkjet projects to compete on technical excellence, rather than (relative lack of) compatibility problems. Imagine that!

I've purchased an iMac, and will be experimenting with OS X. I'm looking forward to it.

Some more progress on the thesis, which makes me very happy!

26 Oct 2001 (updated 26 Oct 2001 at 16:09 UTC) »

I'm also at the printing summit. Grant has put up an excellent report, to which I have little more to add, except to nitpick the various flavors of interprocess communication between a rendering engine (eg Ghostscript) and a printer driver.

1. hpijs is shipping code from HP now, which works with a fairly wide range of HP printers. The license is MIT with an "HP printers only" exception, which makes it non-DFSG. The HP engineers are very clueful about why this restriction is a problem, but apparently it's been difficult to get it through corporate.

2. OmniPrint is the IBM effort to create a unified driver framework. It is also capable of running in an IPC mode.

3. ijs is a proposal for a very lightweight communications model, based on the ideas of hpijs. It hasn't seen much activity, although I suspect that's about to change, as the need for such a thing was fairly strongly expressed.

Of course, in the "open source" world, the need for something does not map at all into getting it done. I had fairly low expectations for the conference itself, and those have been (so far) met. It's been worthwhile to meet and chat with other people in the Linux printing world, but overall not very fun.

I'm taking advantage of yosh's generous hospitality, and last evening yosh, chema, yakk, nullity and I had dinner at an Ethiopian place. That was fun. My favorite quote is from yosh, discussing davem's taste for high end digital camera equipment: "i don't think he has more money than brains, but he does have a lot of brains".

I've been more or less under a rock for a while, trying to focus on getting stuff done. And, in fact, I have been getting quite a bit of stuff done.

For one, I've checked in a reasonable cut at the new libart intersector. This one is not only more robust, but quite a bit faster than the old one. There are still a few more bugs to wring out, but I'm confident - the concepts should support 100% robust intersection, even for the really nasty cases, even if the implementation currently has some flaws.

I've also integrated Bruce Q Hammond's aa rendering speedup, which keeps the steps list in sorted order as it renders a scanline, rather than just dumping the steps into an array and calling qsort later. Combined with the new improvements, this is at least a factor of two speed improvement. Now I get 6 tigers a second at 72 dpi on my 900MHz PIII laptop. When I started with libart, the tiger took about a second and a half.

I've also put out the 7.03 release of Ghostscript. This is a good one - lots of bugs fixed, and Jack's new automated regression testing should help us keep it that way.

I just bought a new server for Ghostscript and put it up in colocation at transbay.net yesterday. It's a 1.7G P4 with a gig of RDRAM. Performance is better than I expected - a full Ghostscript compile is about 128s.

Now that I've put out a bunch of fires, I'm going to spend some serious time finishing my thesis. That's been on hold for too long.

4 Oct 2001 (updated 4 Oct 2001 at 07:35 UTC) »
maelstorm: I took a look at Joy, and find myself slightly intrigued. It looks a lot like PostScript to me. In fact, I can't really find anything that Joy has that PostScript doesn't, except of course for being purely functional and having formal semantics written down.

All the usual functional programming tricks work just fine in PostScript:

GS>/map { [ 3 1 roll forall ] } bind def
GS>[ 1 2 3 ] { dup mul } bind map
[1 4 9]

Once you wrap your brain around the stack, PostScript is a surprisingly modern, powerful language. In addition to all the advanced "combinator" stuff seemingly rediscovered by Joy, it has the usual strings, lists, and maps (dictionaries in PS jargon) as first class data types. In fact, Joy doesn't have the map natively, so in some ways it's even more primitive than PostScript.

PostScript is even fairly well suited to object oriented programming, using the combination of code as first class objects and maps.

Even so, RPN makes readability worse, because you have to keep the stack in your head at all times. 3 1 roll, dup, exch, index, etc., are just poor substitutes for named variables. You can do named variables in PostScript, but it's not popular (or idiomatic), in part because of the nontrivial performance penalty on most implementations (the "activation records" need to be heap allocated and then garbage collected).

I think stack languages are destined to become curiosities, but well worth knowing about for any serious student of languages. I hope the Joy people have fun.

Bad patents

Apple has a patent on alpha compositing. I'm sure there are worse patents, but I don't come across them all that often. I have a short rant about it on my website now.

Incidentally, delphion.com, which used to be the wonderful womplex patent server at IBM, is now a really annoying site in which just about every link brings you to the paid subscription sign up screen. They would appear to be a model of how a company can make money selling free (in the case of US patents, public domain, even) information. Fortunately, the US PTO site is still moderately usable, and offer the bulk data at cost, as well.

12 Sep 2001 (updated 12 Sep 2001 at 07:44 UTC) »
Hope for peace

I was completely unable to concentrate today, not surprisingly. This was a very, very big thing that happened.

I am a Quaker, a member of the Religious Society of Friends. Quakers don't have much in the way of ideology, but peace is a very central testimony. I am praying for those who have died in this attack, and praying fervently that the aftermath doesn't kill too many more people.

And, frankly, I have high hopes for this. Ordinarily, I am not that big a fan of the American military and spy organizations, but in this case I am sure that the best and brightest, the most experienced and knowledgeable anti-terrrorist analysts in the world will be giving their full attention to finding those who are responsible for this attack and bringing them to justice.

As I see it, the greatest risk is the Israeli-Palestinian conflict, which has always been something of a tinderbox. Further, there doesn't seem to be much we can do about it (except to stop supplying them with weapons). These deep-seated religious conflicts have been so pervasive in human history that it seems likely to me they're simply part of human nature.

The images of Palestinians celebrating the attack have angered and enraged many Americans. I hope and believe that the majority of Palestinians decry the senseless loss of human life, as would any compassionate person. There is, of course, a segment whose zealotry outweighs their compassion, but then again there are probably many more Americans at this point who would be happy to see the deaths of all Palestinians.

I'm sure I'm not alone in wondering what I can do. I'm not eligible to give blood. I darkened this site for a while, but have now set it back. I will pray and remain open to any other ways in which I could help.

I notice quite a bit of spam in my mailbox today. I can totally understand wanting to get on with life, and the healing power of work, but for whatever reason sending spam today seems particularly offensive and disrespectful. Ah well, spammers are not known for being nice.

Also, while it's not hard to see why people are drawn to conspiracy theories and wild speculation, I don't have much tolerance for them myself. The attack must have been carried out by intelligent, educated people who embrace irrational beliefs. All this "nostradamus" crap simply serves to illustrate that this irrationality is not confined to the terrorist side. If it comforts you, fine. Just don't take any of it seriously.

I'm (for once) happy that the people in charge are holding back on key information. Eventually, it all has to come out, but for now there's a legitimate emergency. In normal circumstances, I consider myself one of the strongest advocates for free speech and full disclosure, but I do not believe these are normal circumstances.

I see that the "infowar" scare-mongers are at it again, such as this USA Today story. While it's plausible that terrorists do use encryption tools, this story strains credibility (especially with all its factual errors). While encryption protocols are ostensibly uncrackable, in practice they are so subject to human error that I doubt it will slow down a concerted effort to find the truth much at all. I hope the rest of the world has the common sense to see the infowar/cyberterrorism folks as they are, a bunch of opportunists who have read too many hi-tech spy thrillers.

At some point, I want to quibble with the phrasing of "an attack on freedom" and the usage of "coward", but not tonight.

Peace to all.

Raph

Back from Chicago

I just now got back from Chicago, where I played booth bunny for Artifex. I wasn't expecting much from the show, but it turned out to be surprisingly fun (and productive). It's always a thrill seeing your work actually being used by people, and I got quite a bit of that thrill at the show. For one, RipIt is now shipping my Even Toned Screening in their product line.

I did a number of fun things in the various bits of in-between time. I did some fun computational geometry to fix a longstanding performance bug in the Ghostscript shading renderer. I traced most of the Roman alphabet glyphs in the Guillaume LeBe contact sheet using pfaedit. I made a little prototype of a multilevel error diffusion dithering algorithm (which should be tasty on newer inkjet printers).

I find myself with a pretty big todo list to work through. No doubt, by the time I get done with that, it'll be time for Seybold. Ah well. At least I can look forward to a few months of relatively uninterrupted development time after that.

Is it time for some rocket science?

I've been playing around a bit with antialiased x-terms using the X render extension, with a particular eye toward font quality. It's not as good as it should be. Meanwhile, proprietary platforms such as the Macintosh have truly excellent font rendering. Check out this OmniWeb screen shot, for example.

Extremely high quality antialiased font rendering is a hard problem. It's also one with a somewhat limited span of interest - as soon as 200 dpi displays become ubiquitous, non-hinted aa will become the ideal solution. The big problem with non-hinted aa at lower resolutions is loss of contrast.

A long, long time ago, a group of rocket scientists did some serious rocket science, resulting in a very impressive font rendering system for hinted, non-aa fonts. However, as it was too difficult to use, very few fonts were made in this system, and the fonts that were made did not excite graphic designers. The proprietary world later adapted bits of this technology in stripped-down, but far more usable, form. TrueType carries forward the concept of using a programming language to compute the hinting, while Adobe Multiple Master fonts carry forward the concept of adjustable font-wide parameters. No current proprietary system implements all of the original rocket science vision.

At the time these rocket scientists did their work, nobody was really thinking about antialiased font rendering. The displays just didn't exist at the time. Heck, even mono-bit displays of sufficient resolution where you'd want to use proportionally spaced fonts were still a bit on the cutting edge. Thus, the original rocket science, while an impressive bit of technology, is not particularly suitable for today's needs.

Meanwhile, free software hasn't been standing still. FreeType is an impressive renderer for the proprietary font standards. However, Type 1 isn't particularly well suited for screen resolution fonts, and while TrueType is, it's saddled with a particularly nasty patent situation. Thus, US users can't legally use a free desktop with good quality fonts.

There is a solution: do some more rocket science. I recently dusted off an old prototype of mine, code-named "procedural screen fonts". It shares from the original rocket science the concept of using programs to determine the geometry of the glyph. I hacked up an interesting antialiased stroke renderer that can handle the (primitive) PSF stroke geometry, which is lines and 90 degree sections of elliptical arcs. The results, as a proof of concept, are encouraging. In particular, stroke contrast is quite near the non-aa case. These fonts don't look much like the "real" fonts they're supposed to represent, but that can be fixed.

Like all rocket science, there's quite a bit of work to be done to make it real, no matter how encouraging the proof of concept. I have a fairly clear vision of what needs to be done: generalizing and tuning the stroke renderer to handle arbitrary cubic splines and varying stroke weights, adapting the Hobby's global curvature optimizer so font designers don't have to fiddle with Bezier control points, actually drawing enough glyphs to be usable, and of course integrating with other applications out there.

Should I spend serious time on this? There are a lot of other things competing for my attention. Would I get significant help from the rest of the free software community? Past experiences have been mixed. To a large extent, I just don't know how important this work is. Perhaps everybody is happy with the status quo, happily ignoring the TrueType patents. If so, I should be spending my time on something else. And, as I mentioned before, as soon as 200 dpi displays come along, the work becomes a bit moot. I can buy an IBM T220 for far less than it would cost me in time to push this project forward. So I get a fabulous aa display soon no matter what. This affects the users, the poor huddled masses who can't afford 200 dpi displays. You can tell me how useful this work would be, but talk is cheap. Can you back it up with action?

139 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!