Older blog entries for freetype (starting at number 7)

Beware, this is a huge entry !!

Work

It can be said: I've quitted the freelance consulting business for a new position as "expert software architect" for a relatively large embedded systems company.

My main motivation for the change was me getting tired of working on my own. Of all the contracts I've done these last three years, nearly all of them were performed entirely in my Paris office alone, mainly for US companies whose representatives I've nearly never met in person (aren't e-mail and PDF contracts wonderful things ? :o)

Interestingly, I also did participate during this period to a startup that some of you may remember as Henzai. Technically, the project was extremely challenging; unlike what many of you probably think, it didn't consist in porting Gnome to Linux PDAs, but to design a very advanced and innovative graphics system and GUI toolkit tailored for PDA screens (and "keyboards", as limited as they can be)

But my most memorable experience was the team we formed. We, the three techies (and founders) in the company did really found a way to work extremely quickly and efficiently together. I guess that our skills simply matched each other, because we could do in a few months a lot more than I could have ever imagined. It's a kind of magic, that I hardly ever found in the various teams I had joined before (at the Unis and previous employers alike).

Of course, the fall of the "dot-com boom" stirred the end of the company, and we had to separate for distinct working lives after that. I quickly went back to my usual consulting job, but working alone wasn't very pleasant after this experience. Moreover, the "freeze" also meant that my choice of contracts was becoming a lot shorter and a lot more boring...

Hence, it was just a matter of months before I decided to look for a new job. Very fortunately, I had secured sufficient amounts of cash in the bank, as well as very small developments contracts to be able to very carefully select and negociate employement proposals during several months...

Very funnily, two distinct companies proposed me consulting contracts at the same time, while I was reaching a final agreement with my (now) current employer. These two proposals were both very interesting (since they allowed me to perform paid work on FreeType itself, among other things), but required that I continue working on my own as usual (or maybe move to a different country !!)

Believe me, my final choice has been very difficult to make. I ultimately decided that I needed to change my work environment though; obviously, I was missing the coffee- room smalltalk !

I've just started this month at my new position, and I must say that I'm extremely happy to have lots of new colleagues to talk to. It's extremely refreshing, even though I know that the novelty will finish to wear off some day :-)

Mounira

Just to say that I couldn't have done all the things I've been through these last three years without the smiles and consent of my wife Mounira. Merci !! J'ai vraiment beaucoup de chance de t'avoir !!

FreeType

There are chances that my new employer(s) might be interested in integrating FreeType into their own products, and this could be fun. However, they already have their own working solution to their problem, and it works pretty well even though it has its own limitations.

I don't think I'll try to force or convince them about it, replacing a font engine with another one that exposes a different API can be a very delicate thing to do in certain systems. One important thing is the fact that upper layers of the system might depend on un-specified bugs or "features" that cannot be easily reproduced with the new code.

However, FT could make it in later major versions of their software, where more drastic internal changes are possible. Something tells me that this won't happen too soon though.

In all cases, I continue to work on the engine on my free time. I have written a lot of new code, but most of it breaks the build since the internal re-design isn't completely finish. Seems that a few weeks will be needed to round the corners :-)

Open Source

mathieu: thanks for you praise, but I'm certainly not as smart as you believe :-) To prove my point, I'll tell you that there is a subtle bug in one of the code snippets that invalidates some of the conclusions. (finding which one is left as an exercise to the reader)

Hey, that's just a draft after all ;-)

On the other hand, I have found some interesting relationships between garbage collection and cleanup stack management, as well as a method that could drastically reduce the number of push/pop pairs required to allocate memory safely when coding in an object-oriented way (and still with minimal interference with typical programmer's habits). This also means that the "invalidated" conclusion would still remain true (and be actually stronger)

Unfortunately, detailing all of this would take me at least four additional pages to the document, and I don't have the time to do that right now (don't ask me how I find the one required to write this mammoth diary entry :-)

On the other hand, you might be interested to know that I'm currently modifying the FreeType 2 internals to use CSEH. I'm doing this for at least two good reasons:

- it's easier than rewriting the library from scratch to use the MLib

- it's also easier because it doesn't need to deal with multi-threading (FT2 isn't thread-safe, and for very good reasons)

- it will provide me some real metrics regarding the code size savings and performance one would expect by using this technique instead of the usual "paranoid scheme" that is implemented in the 2.0.x family.

- these metrics will become part of the final CSEH document :-)

I'l probably post something here when this change is over..

Finally, I still live in Paris, so we could certainly meet there if you happen to come by. Contact me personally at my FreeType address if you want to. As you know, we also have one French friend in common that could be part of the meeting too :-)

FreeType

Well, well, I'm finally preparing a new release for FreeType !! Version 2.0.6 should be available next week, and will contain many important bug fixes and improvements to the font drivers. Since this results in noticeably better anti-aliased fonts in KDE and Gnome, don't hesitate to grab the latest CVS snapshot and install it on your machine to report any kind of problems before the official release.. ;-)

Since the library is becoming more and more central to Unix systems, I'm considering adopting a versioning scheme similar to the Linux kernel, where odd minor version numbers are used for "unstable" branches, and even ones for "stable" ones..

Let's plan a few things, ideally:

  • 2.1.0 will be an "unstable" re-work of the internal design in order to increase consistency and simplify module management and interfacing.. (as well as get rid of just too many hacks within the current sources :o)

  • 2.1.1 will provide a few new important features (sub-pixel filtering, customizable gamma correction, maybe even syntethic emboldening, etc..)

  • 2.1.2 will be a severe rework of the auto and postscript hinters to reach new levels of quality (especially in the monochrome cases).. well, actually, I don't know if I'll have the time to work on these really soon ;-)

  • 2.2 will be the next stable release everyone should upgrade to when it's available :-)


Linux

I finally ditched both RedHat and Mandrake in favor of Debian, and am only now realizing that I'm not going to regret it !!. I strictly don't know why, but KDE 2.2.1 is immensely more responsive on my laptop under the latter than these two other distributions. Even Gnome feels a lot faster too !! I don't know how this is possible, but I'd like to express my gratitude towards the unsung heroes who spend their time maintaing Debian as carefully as they do. APT / DSelect are beautiful once you learn how to use them..

Hell, even the man pages are more maintained and informative than in other distributions I've used. Talk about attention to details !! Great job Debianers !!


Work

I'm getting out of the freelance consulting business !! My main motivation being to take a break from the delays and uncertainty this kind of job requires. These are of course normally compensated by a good pay, but the projects I'm currently getting involved in are so drastically un-interesting that I found a few pay-roll proposals interesting..

I'm thus now officially looking for a job, and I'm sure this will be fun, once the Xmas holidays pass. In the meantime, I'm spending my time moving my furniture from my ex-office, buying all sorts of presents for my family (probably the first year where I didn't buy everything in the last 72 hours before Santa arrives ;-)

And of course, hacking quite a bit. I still don't know if my next job will leave me enough time for doing lots of open-source, but I certainly won't miss this little window of opportunity to work on my pet projects !!


Life

I've been visiting many hospitals lately, since four people in my family recently suffered from various health disorder. Gloomy..

One of my uncle has lung cancer though that's something I would have never imagined: he never smoked in his whole life and has been practicing sport ("boxe française", sort of kick-boxing) every damn week-end of these last 40 years...

Since he went through chimiotherapy, he's constantly tired and lost a lot of muscle and weight. He also needs a cane to walk and avoids stairs since climbing them is too hard for him..

The whole family is shocked. Some christmas aren't so merry sometimes..

Fucked

For a long time, my office/work machine had the unpleasant habit of rebooting unexpectedly. I always thought that this was due to a flaky install. I thus decided last week to re-partition my disk in order to re- install Windows as well as a recent Linux distrib.. This machine is equipped with a backup hard-drive where I did save all my important data. I then re-partitioned my main drive and launched the Windows CD install. For some reason, the installation program did format the backup disk as well.

I basically lost one month of work, and I'm extremely pissed about it (I suppose I'll burn backup CDs more often now). Not only that, but I also discovered that my original Windows crashes were still there, and that Linux failed to boot sporadically, due to unexpected segmentation faults in random locations of the boot sequence..

After some heavy testing, and buying a new motherboard+CPU combo, things are back to stable. However, don't expect me to work on open-source in the following month since I have a lot to recover from :-(


Linux

I however managed to get Mandrake 8.1 installed on both my laptop and work machine (RedHat 7.2 installed but never worked correctly on both of them), and I have mixed feelings about them.

First, the latest KDE is really nice, but it is incredibly slow on a Mobile 266MHz Pentium with 160 MB ram. Launching any KDE program takes several seconds, and everything feels rather unresponsive, especially in the user interface.. Gnome feels a lot faster, though clearly less polished. I haven't tried installing Ximian yet but I've heard good things about it.. Nautilus is a dog (much worse than Konq) and I fail to see any interest int it for me.. I'd never put my mother in front of it, she's going to scream :o)

On the other hand, on the office machine (700 MHz Duron, 256 MB), things are, unsurprisingly, much more responsive..


Fonts

Of course, I couldn't resist testing fonts ! My experience has been rather unpleasant however:


  • Quality

    Many people have complained about the quality (or lack of) of fonts under XFree86. The standard disclaimer regarding this problem is to "use better fonts". Actually, I want to make it clear that fonts are not the culprits here, font engines are, and a modern XFree86 server will use no less than 3 distinct ones to render glyphs !!

    The problem lies in the fact that the renderers used for Type 1 fonts (which are T1Lib used in the X Font server, and FreeType 2 from "libXft") both produce low-to-medium quality glyphs for now.

    Fortunately, I'm enhancing the FT2 Postscript hinter, though it still needs some tweaks to work properly with all fonts.. and I'm out of free time :-( :-(


  • Anti-aliasing

    Nice to see anti-aliased fonts widely deployed. After all, FreeType supported this in 1997, it was about time that XFree86 could support them :-) More seriously, the legibility of anti-aliased fonts vary greatly with the type of screen your using (LCD or CRT) as well as the resolution you're using. I've tried to play with gamma correction by making small modifications in the FreeType sources and it seems that it's difficult to get one solution that works on any kind of display. This means I'll need to add some sort of gamma/alpha lookup support in the anti-aliased renderer, which shouldn't be especially hard (finding good tables is a different topic :-)

    I'm very impressed by Keith Packard's work on LCD-optimised rendering. On my LCD display, I virtually see _no_ color fringes at all (I do with Adobe's CoolType and even MS Reader) and it _definitely_ improves the legibility of text. I need to find time to review the ClearType patents to see if his code conflicts with them. If not, I'm looking forward to add this kind of feature to the core FreeType renderer to let other projects like GtkFB benefit from it..

  • Listing fonts :

    As always, font listing is sadly highly inconsistent. First, KDE and Gnome will not return the same list of installed fonts in their respective font dialogs. Second, enabling anti-aliased fonts in KDE (which uses libXft) completely changes the list of installed fonts (since it uses a completely different configuration file than the X font server). Third, many applications provide font dialogs but fail to properly filter mono-width ones (for example, "fixed" is the only available font in the Konsole font dialog on my machine, even though Courier, Andale, Lucida Console, etc.. are installed)

    Finally, all font dialogs seem to request or provide 'X11 encoding' fields. Isn't it time to drop this aberration from our toolkits (I mean GTK and Qt ??) and hide this from users.. ?? Windows does it pretty well even though it supports (more abstract) encodings too..


  • Installation

    Installing new fonts is still very arcane apparently. Even when using helper tools like DrakFont, it seems that the font name aliasing scheme fools everything. For example, even if I installed "Verdana", I always get its alias during display when I select it in any font dialog.. It seems that installing several versions of the same font typeface will produce unexpected results too.. though I need to dig the issue more deeply.


Excuse me if I seem to rant a lot here, but I'm clearly not satisfied with Unix's font capabilities (if not to say about rendering and printing). I do believe that a unified font & type service is really needed in order to support advanced capabilities like font embedding as well as simplify system-wide and user font management.

I believe that our current infrastructure (including libXft) is just too limited and needs some serious effort. I'd love to work on this topic and have even started designing a few things, but I lack any kind of free time for the moment to do that satisfyingly.. sick.. :-(

Bah.. this has been a long diary entry.. I probably won't post here before one week or two..

It's been a long time since I didn't post there :-)



computers

my laptop's hard disk started to act really badly recently (strange noises, unreliable CD burning and even lockups on file accesses). After making all the usual checks for viruses, bad sectors, etc.. I came to the conclusion that it was dying and nothing could be done about it. I finally replaced it with a new 20 Gb TravelStar, re-installed Windows and copied my data here (backups _are_ wonderful !!)

The first thing I can say is that the computer seems a lot zippier now. Booting is now twice faster and even compiling large projects takes less time, even though it's still a lowly 266 MHz Pentium :o) !!

The second thing is that I have now plenty of space on this machine to install the latest Linux distribution. I'm using the XOSL BootLoader to manage partitions, and I highly recommend it to anyone needing to manage several OSes on their machine. By comparison, Lilo, Grub and the NT Boot Loader look like nerdish toys when it comes to select OS booting.

I'm looking forward to install the latest versions of Debian and Mandrake. My experience with Linux distributions in the past has been less than rosy. It seems I have a gift for breaking Linux installs with a few keystrokes :-)



fonts

I've made some interesting progress on FreeType lately. Mainly, I have added native Type 1 hinting support and improved the auto-hinter. Results are quite surprising because some of the free Postscript fonts have really bad hints (the Nimbus ones for example), and the auto-hinter now performs better with some of them.

It still has some problems with certain composite (i.e. accented characters) as well as serifed fonts, though I'm pretty satisfied with it. There is still a lot of work to do anyway, since I've not tested it with that many fonts for now, and because some issues, like high-quality rendering of diagonals, cannot be solved without taking extreme measures (e.g. re-writing a specific monochrome rasterizer :)

I'm looking forward to use anti-aliased fonts on Linux on a daily basis, either through KDE or Gnome. According to the " eating your own dogfood" principle, this will help find nasty rendering bugs tremendously :-)

The first "FreeType meeting" was organized this week-end in Aachen (Germany), and it has been really fun & interesting. One of my greatest pleasures was to finally meet Werner Lemberg (whom I've been working with for nearly 4 years now) and Just Van Rossum (though I only realized one hour before he left who he and his friend Eric really were). There was also Robert and Thorsten.

We discussed lots of topics: font formats, font editors, OpenType/GX, advanced typography, etc..

Thorsten made an impressive demo of some new font technology/format that his company developped, and is unable to really sell given the lack of adequate support in current systems (Windows/Mac/Unix/etc..).

We claimed that by developing a FT2 module, they could be able to target embedded system integrators, who would more than likely welcome such technology. After all, the system has been designed to allow the inclusion of proprietary font drivers as well.

We also talked a lot about the future of FreeType, and more specifically an upcoming engine that will be used to layout international text and perform advanced typographic effects. I think we have found some pretty ideas to really separate the "C coding work" from the really "typographic/language work". If succesful, this should allow the work to be distributed among a lot more people and to use Python instead of C whenever possible..

And also some talks regarding a few of my own top-secret projects :-)

I missed my train back to Paris (I hadn't run so fast for a long time, that really aches :-), had to find an hotel room (it was noisy as hell) before returning on Sunday.. Spend some time with my family then..

All in all, it has been fun, and turned to be a _lot_ more intersting than I initially expected. We should definitively invite more people the next time (i.e. Antoine, Peak, and other important contributors that are in Europe too)

For now, I'm packing up the last bits of the last FreeType 2 beta release (you know, the one that was promised "real soon now" in my last diary entry. Actually, the auto-hinting module has been available for more than a week now, but we're still updating some docs and the build system which now runs as intended on Unix)

If I'm lucky, the tarballs will be announced tonight.. I'm crossing my fingers..

The last FreeType 2 beta, a.k.a. the "2.0 release candidate" should appear next week on your regular channels.. Yepeee !!

I've thus started a major clean-up of the source code, a tricky hunt for bugs and memory leaks and I've still got tons of documentation to write :-(. The following has already been done:

  • Added support for "pure CFF" and CEF font files to the CFF/Type2 font driver. I hope Raph will like it ;-)

  • Added a Windows FNT/FON driver (yes, FT2 does bitmap font formats too :-). At this point, it's really a proof of concept rather than a real font driver, as it doesn't deal correctly with the infamous Windows charsets/codepages yet.. It's funny to see the "Terminal", "System" and other well-known Microsoft fonts on a Unix box though.. ;-) The PCF/BDF drivers are still in the work by the way..

  • Due to popular demand, I've started working on an advanced glyph cache on which it should be easy to write several kinds of font managers. The tricky part is to make the code generic while very powerful (it uses some features of FreeType that were originally specifically designed for this kind of use, and should have a _really_ low footprint). I'll have some code soon in the CVS, even though it will not be part of the release (think of it as an add-on to the core font library).

On a completely unrelated level, I found some music video from Weird Al Yankovic on the net (look here and here, as well as many mpegs from Gnutella), and Boy, that is hilarious. I only regret that my wife and most of my friends cannot understand the lyrics or the references.. there are exquisite things in there !!

Shame on me, I've just ordered the DVD even though I have nothing to play it ;-)

I've made some interesting breakthroughs on FreeType 2 recently:

  • Fixed the CFF driver. It know handles the Acrobat 4.0 CID-keyed fonts gracefully, and doesn't crash anymore. Tom reports that there are still some 64-bits issues on DEC Unix though.. I'll add support for pure-CFF fonts (as well as CEF) later, as I've switched to more important things to make the release candidate soon (grin...)

  • Dedicated most of my time looking for bugs and memory leaks. I must admit I've been a bit too succesful at that, but the code seems a lot better now ;-)

  • Finished reworking the auto-hinter to make it a simple module for the latest FT2 design. I have also some pretty nice demo programs. Here's for example Book Antiqua rendered with three different methods: unhinted, with TrueType bytecodes, with the automatic hinter.

    As one can see, there are still some issues (weird metrics/advances and some composite glyphs do not load well), but the results are encouraging :-)

  • Started to rewrite the FreeType 2 Tutorial. The first part is available here, and shows how one can do rotated text rendering in 10 lines of code with the new API.

Seems I'm going to write tons of documentation in the next few days. Oh god...

I still don't know if I'll be using Advogato as my diary for a long time, but let's make try :-)

I've hacked FreeType 2 as usual today. I've done the following:

  • I used to think that FreeType 2 should be binary compatible with version 1.x, but I've changed my mind, now that the APIs are sooo different. Morever, both versions can be used on the same system with no namespace collision, so why bother ??

  • Changed a few things in the renderer module(s). Client applications don't need to set the renderer themselves, as it is now automatically selected, making the API simpler. I also ditched the old 5-gray-levels renderer, it was beginning to make my eyes cry, and was only required for 1.x compatibility..

  • Now that a really bad non-technical problem has been solved (!!!), I'm able to work on the auto- hinter again. I've started modifying it in order to reflect the latest big internal changes that occured after beta 7.

    I also want to rewrite its outline optimiser (the current one is really too crummy) and a few things on it, but I'll probably release it as is instead of holding it for updates..

  • Started hacking the CFF font driver in order to support CID-keyed fonts properly and a few other things..

I've recently had a look at the new CEF font format used by the Adobe SVG Viewer. As described by Raph it's based on CFF and Type 2. More precisely, it's a SFNT font file that encapsultates three tables:

  • A "CFF" table, containing a normal CFF/Type 2 font

  • A "cmap" table, used to provide a charmap for the font (Adobe seems to have understood why they're important, at last !!)

  • A "GPOS" table, which is probably used to support kerning only, though I haven't looked at it in details for now.

Given that we already support normal OpenType/CFF fonts, it now seems very probable that FreeType 2 will support CEF fonts directly when it's released ;-)

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!