tag:blogger.com,1999:blog-54003082024-03-07T05:05:14.304-05:00McEs, A Hacker LifeBehdad Esfahbod's daily notes on GNOME, Pango, Fedora, Persian Computing, Bob Dylan, and Dan Bern!behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.comBlogger482125tag:blogger.com,1999:blog-5400308.post-67817619875366999602015-05-01T19:15:00.003-04:002015-05-06T03:10:23.637-04:00How to use custom application fonts with PangoI am at the <a href="http://libregraphicsmeeting.org/2015/">Libre Graphics Meeting</a> 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.<br />
<br />
OpenType features is <a href="https://bugzilla.gnome.org/show_bug.cgi?id=738505">bug 738505</a>. 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.<br />
<br />
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 <i>only</i> want their custom fonts. A font viewer is a basic example of this that we never had a good solution for.<br />
<br />
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.<br />
<br />
Back in 2006 when we considered pangocairo the only backend we care about, I <a href="https://bugzilla.gnome.org/show_bug.cgi?id=347237">proposed</a> 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...<br />
<br />
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.<br />
<br />
Here is one way to do it, using fontconfig API:<br />
<br />
Before calling into Pango, do this:<br />
<ul>
<li>Create a new fontconfig configuration object using FcConfigCreate() and make it current using FcConfigSetCurrent(); this ensures that default configuration and fonts are <i>not</i> loaded,</li>
<li>Add fonts to it using FcConfigAppFontAddFile() or FcConfigAppFontAddDir(),</li>
<li>Use Pango as you otherwise would.</li>
</ul>
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.<br />
<br />
Recently I needed to do something similar in <a href="https://code.google.com/p/noto">Noto</a>'s test suite, which is written in Python. Since we currently <a href="https://bugs.freedesktop.org/show_bug.cgi?id=90274">don't have</a> 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:<br />
<br />
Before calling into Pango, do this:<br />
<ul>
<li>Set the FONTCONFIG_FILE environment variable to point to your custom fonts.conf XML,</li>
<li>Add your custom font directory to the above-mentioned XML.</li>
</ul>
That's it. Here's are the two steps for Noto: <a href="https://code.google.com/p/noto/source/diff?spec=svn6f19dc224e34630ea69eadfd094eae7f26383954&r=6f19dc224e34630ea69eadfd094eae7f26383954&format=side&path=/nototools/create_image.py">1</a> and <a href="https://code.google.com/p/noto/source/browse/nototools/fonts.conf?spec=svn931c1d54311e4e17865d70c03a66373e5c58568f&r=931c1d54311e4e17865d70c03a66373e5c58568f">2</a>.<br />
<br />
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!<br />
<br />
First, the custom XML currently has to have a cachedir element or fontconfig warns. That's annoying to say the least. Filed <a href="https://bugs.freedesktop.org/show_bug.cgi?id=90148">here</a>. For now, you can use "<cachedir prefix="xdg">fontconfig</cachedir>" and that should work with recent-enough versions of fontconfig that understand the prefix="xdg". Older version will ignore it and try to create a fontconfig directory under the current directory and use as cache, so beware of that.<br />
<br />
Python / JS / etc bindings for fontconfig will be useful if we are pushing in this direction. Filed <a href="https://bugs.freedesktop.org/show_bug.cgi?id=90274">here</a>.<br />
<br />
Another problem with the suggested setups above is that it works for non-GTK use-cases, like a game, test suite, etc. But in most usecases, you definitely don't want your menus and other GUI elements to use the custom fonts. In the case of a document editor or graphics editor, you might want to add custom fonts per document. You can do that by using a separate PangoFcFontMap instance for each custom need. I <a href="https://bugzilla.gnome.org/show_bug.cgi?id=347237#c25">outlined that</a> like this before:<br />
<ol>
<li>FcConfigCreate() </li>
<li>FcConfigAppFontAddFile()</li>
<li>pango_cairo_font_map_new_for_font_type()</li>
<li>Use that PangoFontMap to create your context, etc.</li>
<li>Every time you want to use Pango with that context, FcConfigSetCurrent the above config. Then reset it back to whatever it was before.</li>
</ol>
This will allow you to use Pango with custom-only fonts in parts of the application. If you also want the system fonts to be visible in this private font map, you can use the obscurely named FcInitLoadConfigAndFonts() instead of FcConfigCreate().<br />
<br />
That's not awfully bad. Except that the last step is very cumbersome and a recipe for disaster. That step can be avoided if we have API to attach a custom FcConfig to a PangoFcFontMap. Owen and I talked about it years ago and I filed a <a href="https://bugzilla.gnome.org/show_bug.cgi?id=547671">bug</a>, but never happened... until yesterday.<br />
<br />
I <a href="https://bugzilla.gnome.org/show_bug.cgi?id=547671">added</a> pango_fc_font_map_set_config() yesterday, and just <a href="https://bugzilla.gnome.org/show_bug.cgi?id=748767">added</a> pango_fc_font_map_config_changed(). So you can attach your private FcConfig to a private PangoFcFontMap, inform the font map every time you change the FcConfig (eg, add more fonts to it), and you should be able to use that font map to create layouts and use normally, without switching FcConfig's all the time. However, remember: I wrote the code, but I didn't test it. So a brave first user is wanted.<br />
<br />
Then there's the set of issues with Fontconfig; the fact that to add font or configuration to an FcConfig, you need to have those in files, and can't add from memory blobs. Fixing that should be fairly easy, and I filed those last year. Would be great if we can fix them soon. Here's <a href="https://bugs.freedesktop.org/show_bug.cgi?id=78450">one</a> for font blobs, and <a href="https://bugs.freedesktop.org/show_bug.cgi?id=78452">another</a> for configuration XML.<br />
<br />
Another issue with using custom fonts is that every time you add a custom font, Fontconfig has to scan it. Ie, you get no benefit from the Fontconfig font cache. This can be <i>really</i> slow for huge fonts. And became five times slower when the Adobe CFF rasterizer was integrated in FreeType. I tried a few different approaches to speed it up. Removing the (prematurely added) FC_HASH helped. But there's more that can be done. That bug is <a href="https://bugs.freedesktop.org/show_bug.cgi?id=64766">here</a>.<br />
<br />
Now, here's the one remaining issue that I don't have a full answer for: by sidestepping the default fontconfig configuration, you will miss some essential features. Right now those are: synthetic italics, synthetic bold, and scaling of bitmap fonts. The reason is that these are encoded in configuration files instead of in the library. That sounds slightly over-engineered, and I like to improve it, but as of right now, that is the way it is. You also will lose system-wide and user's configuration.<br />
<br />
Sometimes that's not a problem. For example, in the Noto test suite, we <i>don't</i> want any system or user configuration or any synthetic emboldening or italics, so the FcConfigCreate() approach suites those kinds of scenarios perfectly well. Same about the preview part of a font-viewer, or other use cases where being system-independent is a goal. But in other situations it might not be desirable.<br />
<br />
I can, of course, suggest that anyone creating a custom FcConfig to add the essential configuration to it; Eg. <a href="https://github.com/behdad/fontconfig/blob/4a6f5efd5f6a468e1872d58e589bcf30ba88e2fd/conf.d/10-scale-bitmap-fonts.conf">bitmap scaling</a>, <a href="https://github.com/behdad/fontconfig/blob/4a6f5efd5f6a468e1872d58e589bcf30ba88e2fd/conf.d/90-synthetic.conf">synthetic bold and italic</a>, <a href="https://github.com/behdad/fontconfig/blob/4a6f5efd5f6a468e1872d58e589bcf30ba88e2fd/fonts.conf.in#L32">essential aliases</a>, <a href="https://github.com/behdad/fontconfig/blob/4a6f5efd5f6a468e1872d58e589bcf30ba88e2fd/conf.d/50-user.conf">user's configuration</a>. But that still leaves out generic aliases, system config, etc. And I don't like that approach, because that spreads our default configuration all around Fontconfig clients and will create a mess that we would have to clean up every time we change how we do configuration. It's a leaky abstraction.<br />
<br />
Quite fortunately, there's an almost-perfect solution for that. The obscure FcInitLoadConfig() function creates a new FcConfig and loads the default configuration files, but does <i>not</i> load any fonts referred to from those configuration files. As such, you can go ahead and add your own fonts to it, but still benefit from the configuration. Don't complain, if the configuration does undesirable font aliasing or other stuff. I'm hugely relieved that this might do exactly what we need. I have not tested this, so if you test, please kindly let me know how it works. I cannot think of obvious undesirable behaviors from this approach.<br />
<br />
So, to wrap up, assuming you would use Pango to be released soon, this is how you do custom fonts with PangoCairoFc:<br />
<ol>
<li>Create a custom FcConfig:<br /><ul>
<li>Use FcConfigCreate() if you don't want any system / user fonts or configuration whatsoever, neither you want any synthetic or other manipulations,</li>
<li>Use FcInitLoadConfig() if you want system / user configuration, but no system / user fonts,</li>
<li> Use FcInitLoadConfigAndFonts() if you want system / user configuration <i>and</i> fonts visible in your private font map,</li>
</ul>
</li>
<li>Call FcConfigParseAndLoad() to add any custom configuration you want to add. Such configuration can add custom font directories, or you can use next step,</li>
<li>Call FcConfigAppFontAddFile() or FcConfigAppFontAddDir() to add custom fonts,</li>
<li>Call pango_cairo_font_map_new_for_font_type(CAIRO_FONT_TYPE_FT), to create a private PangoCairoFcFontMap, which is a subclass of PangoFcFontMap, which is a subclass of PangoFontMap,</li>
<li>Call pango_fc_font_map_set_config() to attach your custom FcConfig to your private PangoFcFontMap,</li>
<li>Call pango_fc_font_map_config_changed() whenever you add new fonts to your custom FcConfig,</li>
<li>Use that PangoFontMap to create your context, etc, and use normally.</li>
</ol>
You can optimize the logic to use the default font map if there are no custom fonts involved, and do the above otherwise.<br />
<br />
This can trivially be adapted to the PangoFT2 backend by the way.<br />
<br />
If your application has its own font dialog, then you can implement that using the private font map as well, and things should work. But if you use the GTK+ font dialog, currently you can't attach your private font map to the font dialog instance. I <a href="https://bugzilla.gnome.org/show_bug.cgi?id=748771">filed</a> a request for that.<br />
<br />
While there, let me address the issue of having or not having to restart applications when new fonts are installed. As I covered in my <a href="http://behdad.org/text/">State of Text Rendering</a> in 2009 and presented at the Gran Canaria Desktop Summit, <a href="http://behdad.org/text/#online-font-addition-removal">online font addition/removal</a> should Just Work in GNOME. I implemented that in 2008. Indeed, it does in simple applications. They are a bit slow (~4 seconds before new font shows up), so I <a href="https://bugzilla.gnome.org/show_bug.cgi?id=748776">filed</a> a bug to shorten the delay. However, a lot is <i>not</i> working: <br />
<ul>
<li>I implemented this in the GTK+ font-chooser dialog in 2009, to update online as fonts were added / removed. But font-chooser was rewrote in 2011 and is completely broken now. So I filed a <a href="https://bugzilla.gnome.org/show_bug.cgi?id=748782">new</a> bug (UPDATE: this is fixed now),</li>
<li>I wasn't loud enough in making this feature heard or document how custom font dialog widgets can implement this. Take a look at <a href="https://github.com/GNOME/gtk/search?q=gtk_font_selection_reload_fonts&type=Code">this</a> deprecated font dialog implementation in GTK+. Or watch the <a href="https://bugzilla.gnome.org/show_bug.cgi?id=748782">new bug</a> for discussion and how this will evolve,</li>
<li>To implement this for non-GTK+-based applications, you need to catch the XSETTINGS signal yourself and respond; <a href="https://github.com/GNOME/gtk/search?q=Fontconfig%2FTimestamp&type=Code">search</a> for Fontconfig/Timestamp in GTK+ source,</li>
<li>If you create private fontmaps and FcConfig's that include system / user configs or fonts (ie, you used FcInitLoadConfig() or FcInitLoadConfigAndFonts()), then you also need something similar to the above code in GTK+, that is, catch the signal, recreate your FcConfig (and add your custom fonts to it again), and attach the new FcConfig to your PangoFcFontMap.</li>
</ul>
As for <a href="https://bugzilla.gnome.org/show_bug.cgi?id=347237">pangocairo API to use a cairo_font_face_t</a>, I still think that would be useful, but much less so than before. Also, it won't be very useful until cairo adds API to create a cairo_font_face_t from a font file or memory blob. Right now the only way to do that is to write code for the FreeType, Win32, and ATSUI / CoreText font backends of cairo separately.<br />
<br />
Even if you try to do that, you will hit a very well-known problem with AddFontMemResourceEx(); which is: if you try to add a custom font with a family name that matches that of an existing font on the system, when you try to use the font, you might end up using the version installed on the system. Ie. you can add fonts to the system, but you can't reliably address them. The hack that Firefox, HarfBuzz, and others use to work around this is to modify the font data before calling AddFontMemResourceEx() to set a unique font family name on it, so they can be sure there will be no collision. <a href="https://github.com/behdad/harfbuzz/search?q=_hb_rename_font&type=Code">Here</a>'s the HarfBuzz code for that.<br />
<br />
Anyway, I hope this write up helps developers, after confusing them, implement custom fonts in their applications, and motivate others to help me fix remaining issues and generate examples and better documentation.<br />
<br />
While writing this, I ended up doing some bug triage and closing obsolete issues around Pango, Fontconfig, and cairo, which is always nice :D.<br />
<br />
Anyway, this alone makes me really happy that I attended LGM. The <a href="http://libregraphicsmeeting.org/2015/announcing-the-harfbuzz-documentation-sprint/">HarfBuzz Documentation Sprint</a> was also very productive, but takes a couple more weeks to get to a stage that we can show off what we produced.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com3tag:blogger.com,1999:blog-5400308.post-78335847114728130022014-01-14T02:59:00.002-05:002014-01-14T03:00:34.280-05:00GLyphy<a href="http://glyphy.org/">GLyphy</a> 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.<br />
<br />
I worked on it mostly in 2011 and 2012. The work was then stalled when I refocused on <a href="http://harfbuzz.org/">HarfBuzz</a>, 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.<br />
<br />
Last week at <a href="http://linux.conf.au/">linux.conf.au</a> I presented GLyphy which was recorded. The video is <a href="https://vimeo.com/83732058">here</a>. And there's a <a href="http://groups.google.com/group/glyphy">mailing list</a> for it. The source for the slides are <a href="http://github.com/behdad/slippy">here</a>.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com0tag:blogger.com,1999:blog-5400308.post-32801236503077832292014-01-05T10:20:00.000-05:002014-01-05T11:21:18.757-05:00linux.conf.auIn 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.<br />
<br />
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.<br />
<br />
Last night I arrived in Perth, Australia, home to the last major conference I wanted to speak at.<br />
<br />
Today, at registration, I saw Keith, so went to say hi. He asked:<br />
<br />
- You here to talk about your crazy glyph rendering stuff?<br />
- Yes, have you seen it?<br />
- Oh yeah, it's insane!<br />
<br />
Then I headed to the first-timers' session run by Rusty.<br />
<br />
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.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com0Perth WA, Australia-31.9530044 115.85746930000005-33.6770629 113.27568230000004 -30.2289459 118.43925630000005tag:blogger.com,1999:blog-5400308.post-83850110534961439132013-06-23T02:24:00.001-04:002013-06-23T02:24:40.771-04:00Iran Presidential Election 2013 Vote Count per CountyJust finished downloading the 125 pages of vote counts from the Ministry of Internal Affairs <a href="http://result-p.moi.ir/Portal/Home/Default.aspx?CategoryID=Home">portal</a>, massaged them into usable data and put into a public <a href="https://docs.google.com/spreadsheet/ccc?key=0An_fQkxDZZXXdGJwdXpSQnpkNUVoVDF5OG9SWEdVZWc#gid=1">spreadsheet</a>. 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 <a href="http://www-personal.umich.edu/~wmebane/">Mebane</a> run with it...behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com1tag:blogger.com,1999:blog-5400308.post-47842431849933313992012-11-22T17:08:00.000-05:002013-07-18T15:01:12.693-04:00High-DPI, Subpixel Text Positioning, Hinting<p align="center" style="font-style: italic">What happens when an unstoppable bullet hits an impenetrable wall?</p>
<p>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!</p><p><b><a href="http://goo.gl/teiOz">High-DPI, Subpixel Text Positioning, Hinting</a></b></p>
<p><b>Update (July 18, 2013):</b> 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. :(behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com5tag:blogger.com,1999:blog-5400308.post-48348516123589134832011-11-02T14:43:00.000-04:002011-11-02T14:43:55.920-04:00"Behdad's Calendar" now available at taghvim.infoSince <a href="http://behdad.org/"><code>behdad.org</code></a> is blocked in Iran these days, I went ahead and made my Iranian calendar thingy available at <a href="http://taghvim.info/"><code>taghvim.info</code></a>. Let me know if it doesn't work.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com3tag:blogger.com,1999:blog-5400308.post-78428663154519224932011-10-08T15:58:00.008-04:002011-10-10T12:42:18.042-04:00In Montréal for “Boston” SummitAfter 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 <a href="http://flyporter.com/">Porter</a> flight to Montréal, took the <a href="http://www.stm.info/english/info/a-747.htm">747</a> downtown, took the 165 up to Queen Mary, walked up the hill to <a href="http://www.polymtl.ca/en/">Polytechnique</a> to arrive at the GNOME <a href="https://live.gnome.org/Montreal2011">“Boston” Summit</a>. Found Matthias, Owen, Ryan, and Andreas in the hallway, shook hands and received hugs, and felt right at home!<br /><br />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 <a href="http://blogs.gnome.org/marina/2011/10/08/my-ada-lovelace-day-heroines/">blogging</a> Ada Lovelace Day last night at 3am. Which of course reminded me that it was <a href="http://findingada.com/">Finding Ada</a> 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:<br /><br /><img style="float:right" src="http://planet.gnome.org/heads/marina.png" /><a style="font-weight: bold;" href="http://blogs.gnome.org/marina/">Marina Zhurakhinskaya</a> 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.<br /><br /><img style="float:right" src="http://planet.gnome.org/heads/stormy.png" /><a style="font-weight: bold;" href="http://stormyscorner.com/">Stormy Peters</a> 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!<br /><br /><img style="float:right" src="http://planet.gnome.org/heads/karen.png" /><a style="font-weight: bold;" href="http://punkrocklawyer.com/">Karen Sandler</a> 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 <a href="http://idle.slashdot.org/story/11/04/15/133206/Couple-Sends-Record-Player-Wedding-Invitations">wedding invitation</a> until today. Waiting to run into her here to learn more :-D.<br /><br /><img style="float:right" src="https://lh6.googleusercontent.com/-H0pCXRiHnGk/AAAAAAAAAAI/AAAAAAAAAEQ/mliOdWbumE4/photo.jpg?sz=200" /><span style="font-weight: bold;"><a href="https://plus.google.com/109678970602476998949/posts">Rosanna Yuen</a></span> is hard to find on Planet GNOME, and that's a shame. Many may not know her, she's sometimes better recognized as <code>zana</code>. 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.<br /><br /><img style="float:right" src="http://planet.gnome.org/heads/logos/opw2011.png">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: <b><a href="http://psconboard.blogspot.com/">Pat</a></b>, <b><a href="http://kittykat3756.wordpress.com/">Kat</a></b>, <b><a href="http://fordmeg.blogspot.com/">Meg</a></b>, and <b><a href="http://justabovethetagclouds.blogspot.com/">Nohemi</a></b>: you girls rock! I hope I blog about you for the years to come!<br /><br />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!<br /><br />I want to close by a picture of my favorite GNOME artist with the coolest hair style:<br /><p style="align:center"><img src="http://behdad.org/blog/mces/image/andreas-meg-montreal.jpg"><p><br />[Woah, long post! Been a while since I last did that...]behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com0tag:blogger.com,1999:blog-5400308.post-47131134216218616382011-09-28T00:54:00.003-04:002011-09-28T01:05:02.919-04:00Events of significance for Sep 26 and Sep 271982: I was born.<br /><br />1998: Google was <a href="http://www.blogger.com/%3Ehttp://www.pcworld.com/article/240660/doodle_celebrates_googles_13th_birthday_here_are_13_milestones.html">born</a>.<br /><br />2011: My <a href="http://behdad.org/">personal website</a> was filtered in Iran.<br /><br />2011: <a href="https://plus.google.com/103402108616868673938/posts">Roozbeh</a> joined Google.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com0tag:blogger.com,1999:blog-5400308.post-90083144734653493672011-08-11T04:45:00.002-04:002011-08-11T06:34:15.985-04:00Can 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!
<br />
<br />kthxbye :)
<br />behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com0tag:blogger.com,1999:blog-5400308.post-67377021159370694172011-08-07T08:24:00.003-04:002011-08-07T08:26:48.094-04:00Arrived at the Desktop SummitJust got to the <a href="http://desktopsummit.org/">Desktop Summit</a> in Berlin. It's lovely seeing everyone after two years.<br /><br />I'm running <a href="http://www.freedesktop.org/wiki/TextLayout2011">Text Layout Summit</a> August 9th to 12th, so come find me for some font and text chat!behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com2tag:blogger.com,1999:blog-5400308.post-75164566565034621522011-05-26T18:46:00.006-04:002011-05-26T19:00:41.712-04:00Contributor AgreementsIt should be clear by now that I've gave up on blogging. Couple things I found worth writing down for da Nets today:<br /><br />By way of GNOME Foundation Board of Directors election discussion I read the this LWN <a href="http://lwn.net/Articles/442782/">piece</a> titled "Mark Shuttleworth on companies and free software". A couple remarks on it:<br /> <br /><ul><li>I have a lot of respect for Mark and all, but, is that really what he believes?</li><li>Mark would make a great Republican politician!</li><li>"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?<br /></li></ul><br />In other, more this-worldly, news, <a href="https://toronto.bixi.com/">Bixi</a> arrived in Toronto. It has become my favorite mode of transportation in downtown core.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com0tag:blogger.com,1999:blog-5400308.post-78342095499851894672011-04-06T16:19:00.002-04:002011-04-06T16:23:56.670-04:00GNOME 3.0GNOME 3.0 released.<br />Slashdot effect observed.<br />No Slashdot post in sight.<br />Great job, everyone!behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com0tag:blogger.com,1999:blog-5400308.post-64788356197938886812010-11-11T13:40:00.002-05:002010-11-11T13:55:21.925-05:00CSS3 font goodnessHere's a nice blogpost from John Dagget of Firefox fame about the upcoming Firefox 4 supporting CSS3 OpenType font-feature support:<br /><br /><a href="http://hacks.mozilla.org/2010/11/firefox-4-font-feature-support/">Firefox 4: OpenType font feature support</a><br /><br />This is a direct result of the <a href="http://harfbuzz.org/">HarfBuzz</a> code I've been working on for the past year or so. Exciting stuff for the web.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com8tag:blogger.com,1999:blog-5400308.post-19959080654215500602010-10-22T15:33:00.002-04:002010-10-22T15:41:51.639-04:00A Digital Media Primer for GeeksThis is a few weeks old, but so good I still wanted to share. Brought to you by xiph.org and Red Hat and featuring my old colleage, Monty, of xiph.org and Red Hat fame: <a href="http://www.xiph.org/video/vid1.shtml">A Digital Media Primer for Geeks</a>. Looking forward to the followup episodes.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com0tag:blogger.com,1999:blog-5400308.post-73620222575012792372010-10-01T21:21:00.003-04:002010-10-01T21:42:53.406-04:00Dear Lazyweb: Netflix on Bravia in CanadaDear LazyWeb,<br /><br />With the recent launch of <a href="http://www.netflix.ca/">Netflix in Canada</a>, here comes the question I've been unable to answer so far:<br /><br />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.<br /><br />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.<br /><br />kthxbye<br />bbehdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com5tag:blogger.com,1999:blog-5400308.post-28506803838419857262010-07-28T04:19:00.003-04:002010-07-28T04:22:47.268-04:00Missing GUADECMy 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 :-(.<br /><br />Hope you all have your best GUADEC so far. Wish I was there.<br /><br /><a href="http://guadec.org/"><img src="http://guadec.org/img/header-logo.png"></a>behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com0tag:blogger.com,1999:blog-5400308.post-90572953623404675562010-06-30T16:39:00.002-04:002010-06-30T23:52:12.742-04:00JuneJune 18th was my last day at Red Hat.<br /><br />I spent last week road-tripping to Eastern Canada with my friends.<br /><br />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.<br /><br />Unfortunately the setup also means that I have to skip this year's GUADEC as I can't get a visa on time :(.<br /><br />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.<br /><br />That's all for June.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com15tag:blogger.com,1999:blog-5400308.post-82240294123132393962010-05-11T12:55:00.003-04:002010-05-11T13:05:52.668-04:00Dan Bern Live in Los AngelesIf you ever enjoyed a <a href="http://danbern.com/">Dan Bern</a> song, or generally appreciate good folk-rock music, check out his new album <a href="http://danbern.com/discography.html#liveinlosangeles">Dan Bern Live in Los Angeles</a> in which he performs with the <a href="http://en.wikipedia.org/wiki/Common_Rotation">Common Rotation</a> and <a href="http://en.wikipedia.org/wiki/Mike_Viola">Mike Viola</a>.<br /><br />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.<br /><br />Anyway, extremely enjoyable album, highly recommended. Makes a great gift too. He's still touring the US, <a href="http://danbern.com/tour.html">check it out</a>. Unfortunately no Toronto :-(.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com0tag:blogger.com,1999:blog-5400308.post-66951736655037978752010-04-23T19:39:00.002-04:002010-04-23T19:42:53.202-04:00Create a font in less than three minutes with Glyphtracer and FontForgeJussi Pakkanen posted the following to the Fontforge list today:<br /><br /><blockquote>Hi all<br /><br />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.<br /><br />To make things clear, here's a video showing how you can create a font from scratch in about two minutes:<br /><a href="http://www.youtube.com/watch?v=T7x6mtptDAY">http://www.youtube.com/watch?v=T7x6mtptDAY</a><br /><br />Glyphtracer's home page is <a href="http://launchpad.net/glyphtracer">https://launchpad.net/glyphtracer</a>. The program is written entirely in PyQT4 and is currently Linux only.</blockquote><br /><br />Cool stuff!behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com3tag:blogger.com,1999:blog-5400308.post-63323732229750188842010-04-01T03:20:00.002-04:002010-04-01T03:26:55.120-04:00Parsing CSS-style margin attributesSounds silly, but I found the following construct handy:<br /><br /><pre><br /> int margin_t, margin_r, margin_b, margin_l;<br /> switch (sscanf (optarg, "%d %d %d %d",<br /> &margin_t, &margin_r,<br /> &margin_b, &margin_l))<br /> {<br /> case 0: err;<br /> case 1: margin_r = margin_t;<br /> case 2: margin_b = margin_t;<br /> case 3: margin_l = margin_r;<br /> }<br /></pre>behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com2tag:blogger.com,1999:blog-5400308.post-33485241240752258992010-03-20T11:53:00.000-04:002010-03-20T12:03:40.224-04:00Happy NowrouzHappy <a href="http://en.wikipedia.org/wiki/Nowrouz">Nowrouz</a> to all my Iranian friends. Wishing you all the best in the year to come.<br /><br />Last year was the most eventful year of my life. Looking forward to the next one.<br /><br />(I don't have any artistic talent, so no cards from me ;)).behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com2tag:blogger.com,1999:blog-5400308.post-69485154186824715342010-03-13T00:24:00.003-05:002010-03-13T00:30:52.774-05:00RebootI 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.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com0tag:blogger.com,1999:blog-5400308.post-33818793359901373822010-03-12T15:56:00.002-05:002010-03-12T18:17:11.106-05:00Stepping down from the GNOME Foundation boardWhen 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.<br /><br />The board has decided to appoint <a href="http://www.silwenae.org/blog">Paul Cutler</a> 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.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com5tag:blogger.com,1999:blog-5400308.post-50266102157866124332009-12-17T05:59:00.003-05:002009-12-17T06:18:51.599-05:00Europe, here I come!I wrote my last exam on Tue night and We afternoon headed to the airport to get to Spain for the <a href="http://live.gnome.org/WebKitGtk/Hackfest2009">WebKitGtk hackfest</a> at the Igalia offices. At this time, stuck in Frankfurt airport after missing my connection.<br /><br />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.<br /><br />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.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com7tag:blogger.com,1999:blog-5400308.post-7845100484501657942009-12-11T06:24:00.003-05:002010-01-25T14:46:21.923-05:00Lazyweb: Conference organizing/scheduling softwareDear Lazyweb:<br /><br />What are the best Free Software conference orginizing / scheduling pieces of software?<br /><br />We are looking for things more sophisticated than Drupal's conference module. Two years ago we used <a href="http://expectnation.com/">expectnation</a>, a kickass hosted service that <a href="http://times.usefulinc.com/">Edd Dumbill</a> 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.<br /><br />So, please leave comments and share your experience. Thanks in advance.behdadhttp://www.blogger.com/profile/15683613908300939375noreply@blogger.com15