Subscribe: McEs, A Hacker Life
Added By: Feedage Forager Feedage Grade B rated
Language: English
board  custom  fontconfig  fonts  free  gnome  great  guadec  margin margin  margin  new  pango  software  summit  time  work  year 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: McEs, A Hacker Life

McEs, A Hacker Life

Behdad Esfahbod's daily notes on GNOME, Pango, Fedora, Persian Computing, Bob Dylan, and Dan Bern!

Updated: 2015-05-06T03:10:23.610-04:00


How to use custom application fonts with Pango


I am at the Libre Graphics Meeting in Toronto this week, which means that I got to talk to GIMP and Inkscape developers after many years, and was reminded that Pango still does not make it easy to use custom (aka. application) fonts, and it still does not allow turning OpenType features on or off.  So I decided to give Pango some love.OpenType features is bug 738505.  Akira and Matthias wrote the initial patch, but there are certain complexities in handling the attributes that needs to be fixed before this can go in.  I'll see if I can get myself to do that tomorrow.Custom fonts is a different issue.  And by custom fonts I mean when an application wants to use a font file that it ships, but is not installed in the system or user font directories.  Most of the times when people have this request, they also don't want any system fonts, ie, they only want their custom fonts.  A font viewer is a basic example of this that we never had a good solution for.Webfonts, and other embedded fonts, are another use case.  Eg, a document might bundle fonts that it uses.  Many times, the document would want to refer to the font using font family name, so in that case you want the font to be added to the system fonts and go through the font matching process.Back in 2006 when we considered pangocairo the only backend we care about, I proposed that we add pangocairo API to use a certain cairo_face_t.  The thinking was that by doing it in the pangocairo layer, we don't have to do it in individual platform backends (pangofc, pangowin32, pangoatsui / pangocoretext).  That, however, never happened, because I was too lazy to implement it, but also because it was actually a lot of tricky work, to make the generic pangofc layer understand this custom object...I have since changed my mind on how this should be done.  Over the years different groups asked how they do this, I've had suggested different variations of the same solution: custom Fontconfig config; and Win32 / CoreText APIs on other platforms.  Ie, do it at font host layer, not Pango layer.  It's a legitimate approach, if not most convenient.Here is one way to do it, using fontconfig API:Before calling into Pango, do this:Create a new fontconfig configuration object using FcConfigCreate() and make it current using FcConfigSetCurrent(); this ensures that default configuration and fonts are not loaded,Add fonts to it using FcConfigAppFontAddFile() or FcConfigAppFontAddDir(),Use Pango as you otherwise would.This way Pango will only see your fonts.  If you want to add your fonts but also see the system fonts, you can skip the first step.  That will make your custom fonts visible to all Pango users within the process, including Gtk+ and its font selection dialog.  If, instead, you want to limit it to a particular document, we need something more involved; we talk about further down.Recently I needed to do something similar in Noto's test suite, which is written in Python.  Since we currently don't have fontconfig Python bindings, I either would have had to be bothered to do a ctypes binding of the few functions I needed, or find an even simpler solution.  Which is:Before calling into Pango, do this:Set the FONTCONFIG_FILE environment variable to point to your custom fonts.conf XML,Add your custom font directory to the above-mentioned XML.That's it.  Here's are the two steps for Noto: 1 and 2.Now, this sounds easy, and works for very limited usecases.  But for it to be useful in apps like The GIMP or Inkscape, there are a few issues that need to be handled.  And I'm writing this post to raise enough interest from Akira, Matthias, Khaled, and others, to help fix these so we can have a great custom-font experience.  Writing a tutorial when these are all fixed would be great, but for now, this post is documentation enough!First, the custom XML currently has to have a cachedir element or fontconfig warns.  That's annoying to say the least.  Filed here.  For now, you can use [...]



GLyphy is an experiment in high-quality glyph rendering using OpenGL ES2 shaders.  It's a project of mine at Google that I never really publicly announced.

I worked on it mostly in 2011 and 2012.  The work was then stalled when I refocused on HarfBuzz, but also because there were no immediate target platform for it.  That has changed recently as mobile GPUs have caught up and can run GLyphy fairly well now.  So I'll be spending more time on it this year.

Last week at I presented GLyphy which was recorded.  The video is here.  And there's a mailing list for it.  The source for the slides are here.


In the Summer of 2003 I visited Ottawa for a Computer Science workshop.  Before getting there I also noticed that there's Ottawa Linux Symposium going on after my workshop, so I made it there, and stayed at Carlton's Leeds College.  It was my first Linux conference.  I knew no one.  I met Keith Packard for the first time.  The closing keynote was by Rusty Russel, and left me energized about the community.

Since then Free Software conferences have taken me to Montreal, Barcelona, Glasgow, Wolverhampton, Birmingham, Canary Islands, Austin, Boston, San Francisco, Istanbul, Wroclaw, Vienna, Berlin, and Amsterdam,  among others.  I got to become part of a fantastic community.

Last night I arrived in Perth, Australia, home to the last major conference I wanted to speak at.

Today, at registration, I saw Keith, so went to say hi.  He asked:

  - You here to talk about your crazy glyph rendering stuff?
  - Yes, have you seen it?
  - Oh yeah, it's insane!

Then I headed to the first-timers' session run by Rusty.

Walking last night at University of Western Australia's Trinity college campus made me realize how much I had missed the Free Software conference scene, and made me feel great being here.  That, and the southern-hemisphere night sky.

Iran Presidential Election 2013 Vote Count per County


Just finished downloading the 125 pages of vote counts from the Ministry of Internal Affairs portal, massaged them into usable data and put into a public spreadsheet. Will add extra sheets for analysis in the coming days. Feel free to clone, do your own analysis, and share back with me to integrate. May Mebane run with it...

High-DPI, Subpixel Text Positioning, Hinting


What happens when an unstoppable bullet hits an impenetrable wall?

A while back I wrote a document about the interactions of high-density displays and font rendering options.  I just went ahead and made it public, so, enjoy!

High-DPI, Subpixel Text Positioning, Hinting

Update (July 18, 2013): It was brought to my attention that the document had disappeared. I have no idea how that happened, but I've uploaded it again. It also means that the URL has changed. :(

"Behdad's Calendar" now available at


Since is blocked in Iran these days, I went ahead and made my Iranian calendar thingy available at  Let me know if it doesn't work.

In Montréal for “Boston” Summit


After a crazy Oktoberfest party in Kitchener last night, I woke up at 6:45 this morning, drove back to Toronto, took the ferry to the Island, took a Porter flight to Montréal, took the 747 downtown, took the 165 up to Queen Mary, walked up the hill to Polytechnique to arrive at the GNOME “Boston” Summit. Found Matthias, Owen, Ryan, and Andreas in the hallway, shook hands and received hugs, and felt right at home!Inside, saw Colin and Marina among a few other familiar faces and many new ones. Marina explained that the reason she looks so sleepy is that she was blogging Ada Lovelace Day last night at 3am. Which of course reminded me that it was Finding Ada yesterday. So I thought I hereby list my own pick of women that I have had the pleasure to work with, and who, in my opinion, have made a lasting contribution to GNOME. Now I don't have to preach these awesome women to this crowd, so I'll just summarize my own experience with them in a two lines. In no particular order:Marina Zhurakhinskaya has been critical to the Women Outreach Program success and happening in recent years, so for that alone she deserves a special mention. That's independent of she being part of the every-awesome GNOME Shell team. Plus, she's so nice and great to hangout with in person.Stormy Peters wrote in her job application for the GNOME Executive Director as part of her responsibilities to be the "mom". And she delivered! It was a pleasure being on the board when she was in charge. Plus, she's so energetic she brightens everyone around her whereever she goes!Karen Sandler is awesome in spite of being a lawyer! I have not had the opportunity to work with her in her new role, but at the Software Freedom Law Center, she was a great resource to the GNOME board, and much easier to get hold of than, well, other Free Software lawyers. Now, I did not actually know about her DJ hobby (check her website!) and wedding invitation until today. Waiting to run into her here to learn more :-D.Rosanna Yuen is hard to find on Planet GNOME, and that's a shame. Many may not know her, she's sometimes better recognized as zana. Fortunately she's been making more regular appearance at GUADEC. Anyway, it's hard to imagine anything in the Board / Foundation level getting happened without her back-office work. She moves the money, she keeps the book, she knows what happened in the board five years ago! Plus, sometimes researches and books the venue for Boston Summit too.At GUADEC this year, and at the Summit today I had the opportunity to meet a few young ladies rather new to the GNOME family: Pat, Kat, Meg, and Nohemi: you girls rock! I hope I blog about you for the years to come!Went for lunch with Marina and Owen, had a great Thai chicken green curry, and talked food. I was thinking about a small project to hack on while at the summit and I thought I pickup rewrapping lines in vte / gnome-terminal upon width change. It's a well-defined well-contained problem, I have a design in mind, and one of the most common requests against vte. I passed my design past Owen, we agreed that it should work, and I hope that's what I'm going to hack on. Stay tuned!I want to close by a picture of my favorite GNOME artist with the coolest hair style:[Woah, long post! Been a while since I last did that...][...]

Events of significance for Sep 26 and Sep 27


1982: I was born.

1998: Google was born.

2011: My personal website was filtered in Iran.

2011: Roozbeh joined Google.

Can I has intel tablet?


So I missed the intel party it seems. I assume the tablets are GLES2-ready and have a fair pixel density. If that is the case, I can make good use of one for OpenGL-based text rendering I'm experimenting with. If there are leftovers at the summit, I'd happily take one!

kthxbye :)

Arrived at the Desktop Summit


Just got to the Desktop Summit in Berlin. It's lovely seeing everyone after two years.

I'm running Text Layout Summit August 9th to 12th, so come find me for some font and text chat!

Contributor Agreements


It should be clear by now that I've gave up on blogging. Couple things I found worth writing down for da Nets today:

By way of GNOME Foundation Board of Directors election discussion I read the this LWN piece titled "Mark Shuttleworth on companies and free software". A couple remarks on it:

  • I have a lot of respect for Mark and all, but, is that really what he believes?
  • Mark would make a great Republican politician!
  • "Project Harmony", that name has worked in the past. Twice. One resulted in Free Qt, the other in Free Java. What would it do this time?

In other, more this-worldly, news, Bixi arrived in Toronto. It has become my favorite mode of transportation in downtown core.



GNOME 3.0 released.
Slashdot effect observed.
No Slashdot post in sight.
Great job, everyone!

CSS3 font goodness


Here's a nice blogpost from John Dagget of Firefox fame about the upcoming Firefox 4 supporting CSS3 OpenType font-feature support:

Firefox 4: OpenType font feature support

This is a direct result of the HarfBuzz code I've been working on for the past year or so. Exciting stuff for the web.

A Digital Media Primer for Geeks


This is a few weeks old, but so good I still wanted to share. Brought to you by and Red Hat and featuring my old colleage, Monty, of and Red Hat fame: A Digital Media Primer for Geeks. Looking forward to the followup episodes.

Dear Lazyweb: Netflix on Bravia in Canada


Dear LazyWeb,

With the recent launch of Netflix in Canada, here comes the question I've been unable to answer so far:

How do I use Netflix on my Bravia-enabled Sony TV or Blu-ray player? The net suggests that both should be able to play, yet it's not in the menus by default, and the internet gods have not been that helpful so far.

My current understanding is that the Canadian version of the Sony Bravia products doesn't have the Netflix channel and all I can do is to wait for a firmware update. Will be glad to be proven wrong.


Missing GUADEC


My friends in the Hague will slowly start the process of resuming from sleep and dealing with hangover, eventually heading for the conference venue as I write this, because, right, it's GUADEC time, and I'm missing out :-(.

Hope you all have your best GUADEC so far. Wish I was there.




June 18th was my last day at Red Hat.

I spent last week road-tripping to Eastern Canada with my friends.

In a couple of weeks I will start working for Google Canada in the Waterloo office. I will be working for a large part on HarfBuzz as part of the Chrome / ChromeOS team.

Unfortunately the setup also means that I have to skip this year's GUADEC as I can't get a visa on time :(.

I will keep my current GNOME duties, namely maintaining the text stack (fribidi, fontconfig, harfbuzz, pango, etc) as well as vte. The break may give me some time hacking on things I couldn't get the time to hack on before even. We'll see.

That's all for June.

Dan Bern Live in Los Angeles


If you ever enjoyed a Dan Bern song, or generally appreciate good folk-rock music, check out his new album Dan Bern Live in Los Angeles in which he performs with the Common Rotation and Mike Viola.

The album includes a couple extremely funny new songs: "Most American Men", "Osama in Obamaland", and a lovely performance of some of his classics. "Beautiful Ride" is from the movie Walk Hard, which he wrote the score for. Also includes the first official release of "The Fifth Beatle". Trivia: his Dylan mockery in The Fifth Beatle is actually legible in the album, unlike previous live performances.

Anyway, extremely enjoyable album, highly recommended. Makes a great gift too. He's still touring the US, check it out. Unfortunately no Toronto :-(.

Create a font in less than three minutes with Glyphtracer and FontForge


Jussi Pakkanen posted the following to the Fontforge list today:

Hi all

I have written a simple program to help creating fonts from images. It is called Glyphtracer. The basic idea is that you give it an image file containing all your glyphs. The program autodetects glyphs in the picture and allows the user to assign each detected glyph with a Unicode code point. These images are then traced to vectors and written to an SFD file. The rest of the work is then done with FontForge.

To make things clear, here's a video showing how you can create a font from scratch in about two minutes:

Glyphtracer's home page is The program is written entirely in PyQT4 and is currently Linux only.

Cool stuff!

Parsing CSS-style margin attributes


Sounds silly, but I found the following construct handy:

int margin_t, margin_r, margin_b, margin_l;
switch (sscanf (optarg, "%d %d %d %d",
&margin_t, &margin_r,
&margin_b, &margin_l))
case 0: err;
case 1: margin_r = margin_t;
case 2: margin_b = margin_t;
case 3: margin_l = margin_r;

Happy Nowrouz


Happy Nowrouz to all my Iranian friends. Wishing you all the best in the year to come.

Last year was the most eventful year of my life. Looking forward to the next one.

(I don't have any artistic talent, so no cards from me ;)).



I didn't blog for almost three months! It has been a hectic few months, I've had so much on my plate I could hardly get anything done. So I spent some time this week unsubscribing from tens of mailing lists, and even more website newsletters, trying to bring my incoming emails considerably down so I can actually get work done. I think I'm there now. I'm still on all the core lists relevant to my work (font & text related lists; and haven't unsub'ed from foundation-list yet) and hope to do a better job pushing harfbuzz as well as maintaining pango, fontconfig, and vte. Anyway, it's easy enough to find my email. Feel free to send me mail or CC me on discussion I should be reading. And I try to do a better job of posting what I'm up to.

Stepping down from the GNOME Foundation board


When I decided to run for the foundation board in 2006, many of the old timers where not running again and there was the feeling that new people are needed on the board. The board work has been very educational and rewarding for me, but given other engagements and all the new, capable, people on the board this year, I think it's time for me to step down so I can focus on hacking.

The board has decided to appoint Paul Cutler to take the seat. Paul has been doing wonders on the marketing team, GNOME Journal, and the sysadmin team. I'm sure this opportunity gives him more ways to contribute to GNOME even more.

Europe, here I come!


I wrote my last exam on Tue night and We afternoon headed to the airport to get to Spain for the WebKitGtk hackfest at the Igalia offices. At this time, stuck in Frankfurt airport after missing my connection.

After the hackfest I'm doing a mini tour of Western Europe, thanks to RailEurope. Mostly visiting friends and family. Currently looking like: Frankfurt -> Kassel -> Paris -> Brussels -> Amsterdam -> Hanover -> Berlin -> (Maybe) Zurich.

Looking forward to meet GNOME guys. And will blog about hackfest progression. Before you ask, my mandate for the event is to port WebKit to use the new HarfBuzz API.

Lazyweb: Conference organizing/scheduling software


Dear Lazyweb:

What are the best Free Software conference orginizing / scheduling pieces of software?

We are looking for things more sophisticated than Drupal's conference module. Two years ago we used expectnation, a kickass hosted service that Edd Dumbill kindly offered to GUADEC free of charge. But we are looking to host our own within the GUADEC infrastructure now that we finally have started looking into building real infrastructure for running GUADEC website on an ongoing basis as opposed to rebuilding it from scratch every year.

So, please leave comments and share your experience. Thanks in advance.