109 posts with category “Tech”

Upgrading Ubuntu through a Mirror

I’d begun my upgrade to Jaunty last night around 7pm, and woke up this morning to find that the package downloads had hardly made any progress. This because the main Ubuntu servers are being hammered due to Jaunty’s release yesterday morning.

I followed one tutorial that should have set me up to download (and upload, I assume) all the packages through a peer-to-peer protocol, but that didn’t seem to help at all. It did make me more comfortable editing my /etc/apt/sources.list file, however, so I thought I’d try sticking some mirrors in there, rather than using the generic us.archive.ubuntu.com servers.

I found this list of mirrors, and noticed that there was one at MIT, only several blocks away from my apartment. I went into sources.list

sudo gedit /etc/apt/sources.list

…and did a search/replace on all instances of us.archive.ubuntu.com/ubuntu/ with ubuntu.media.mit.edu/ubuntu/. Re-ran the upgrade through update-manager, and I was downloading at blazing speeds that completed in just about five minutes.

If you’re having a rough time getting your upgrade to complete, find a nearby server from this list and stick it into your sources.list file.

Looking forward to using 9.04!

Leave a Comment

Ubuntu, Font Hinting, & You: A Cautionary Tale

This post was written regarding Ubuntu 8.10, Intrepid Ibex.

This isn’t the first time I’ve encountered hinting; I’ve seen it before in GIMP, even when I was using it in Windows, this font rendering option that was inexplicably on by default, and resulted in horrible kerning and misshapen letterforms. I don’t claim to know a lot about the technicalities of hinting, but everything I do understand about it agrees that it is meant to improve the shapes of letters. If this is the case, somebody is doing something very, very wrong. I haven’t seen a hinted font that looked anything other than sickly and disheveled.

I’ve complained before about the typography in Ubuntu, but my contention then was with the fonts that were in use by default, not with the way they were rendered. What I didn’t realize at the time is that the rendering is the bulk of the problem.

applicationsmenuI found this image on the Ubuntu site, and I am still in disbelief that they choose to represent themselves with font rendering like this. Look at that capital ‘A’ and ‘V’; look at the way that lower-case ‘l’ towers over its neighbors, nothing more than a single-pixel-width vertical line; look at the kerning in the ‘Rem’ of ‘Remove’ – it’s no wonder Ubuntu has about a 2% worldwide market share. They expect people to want to look at that every day of their lives? I know these are relatively subtle details, but their effects are subliminal and, I believe, psychologically hazardous.

~/.fonts.conf

Of course, when it comes to Linux, for every problem there are a few dozen solutions – or one very, very complicated solution. GNOME, the default desktop for Ubuntu, arrives with a “Font Rendering Details” dialog box in its appearance settings, to placate the mouth-breathing philistines who need a GUI to get things done. And it doesn’t really help much. I knew I’d have to get my hands dirty in ~/.fonts.conf, this XML file that is capable (and only capable) of incredibly fine-tuned font tweaking.

[Fonts are] the #1 reason why Linux hasn’t seen any significant adoption on the desktop/laptop yet. Robert Scoble

The trouble, as is the case with most Google results you get when looking for help with Linux, is that there is a glut of quick fixes, blocks of code directed towards one specific person and their specific system, that they are then told to paste into a file or save into a directory, with little to no explanation about why this solution is going to work. Or there’s the technical documentation that isn’t geared towards users. There’s no middle ground (unless you count the occasional, skeletal wiki that hasn’t been updated since 2004).

Only after looking at countless ~/.fonts.conf examples was I able to glean what was going on inside them. The full power of this file allows you to target with amazing precision any variant or size of any font your system might display and give it its own unique properties; but there are really only three(ish) of these properties that you need to know about, and I am going to explain them here.

antialias

Anti-aliasing is the trick that makes your pixels not look like pixels. You’ve noticed this when you’ve seen poorly resized images with jagged edges – they’re not properly anti-aliased. Similarly, if fonts are not anti-aliased, they look like black Tetris pieces on a white background. Anti-aliasing is going on all the time without you knowing about it, and you’d really have to make an effort not to have it, but it’s worth putting in your ~/.fonts.conf file for good measure. You’ll want to apply it to all fonts on your system, so the syntax would be:

<match target="font">
 <edit name="antialias" mode="assign">
  <bool>true</bool>
 </edit>
</match>

You can probably figure out what these things mean, but I will link to a complete manual for ~/.fonts.conf syntax at the end of this post.

rgba

This one is a matter of personal preference, I guess. I don’t see how anybody of sound mind could stand to have pink, beige, and turquoise pixels sprinkled around the edges of their letters – the result of “sub-pixel rendering” – but I guess the argument is that it allows them to be sharper. Whatever.

Trust me when I say that things look best if you tell ~/.fonts.conf to disable sub-pixel rendering, which is done like so:

<match target="font">
 <edit name="rgba" mode="assign">
  <const>none</const>
 </edit>
</match>

If you happen to be schizophrenic, or colorblind or whatever, then yes, fine, you can turn on sub-pixel rendering by changing none to rgb, to reflect the composition of your monitor’s subpixels (which are almost certainly in the order Red-Green-Blue, from left to right). Have fun scratching your eyeballs out.

rgba=rgb

rgba=rgb

rgba=none

rgba=none

Admittedly it would be nice if there were some antialiasstyle property you could set to antialiasslight or something, to lighten up those gray pixels a little bit.

hinting / autohint / hintstyle

Put it on my tombstone: Turn Off Hinting. I’m begging you. If somebody tries to tell you that this is a matter of preference, they are lying to you, and are not your friend, and are probably banging your girlfriend. If you leave hinting on, Georgia will not look like Georgia, Lucida will not look like Lucida, and Nimbus will not look like Helvetica.

hintstyle=hintnone

hintstyle=hintnone

hinting=true, autohint=true

hinting=true, autohint=true

Here is how you Turn Off Hinting®:

<match target="font">
 <edit name="hinting" mode="assign">
  <bool>false</bool>
 </edit>
 <edit name="autohint" mode="assign">
  <bool>false</bool>
 </edit>
 <edit name="hintstyle" mode="assign">
  <const>hintnone</const>
 </edit>
</match>

Alternatively, if you positively demand more “crispness” from your fonts, even at the expense of aesthetics, you might want to give slight hinting a try. From the above code, change hinting and autohint to true, and hintstyle to hintslight:

hintstyle=hintslight

hintstyle=hintslight

That’s it, roughly speaking. It’s my understanding that some specific fonts do look better if specifically targeted and adjusted with maybe slight hinting. But that’s for another day. If you do as I’ve instructed, things will be so much better for you. Leave a comment if you want my PayPal address.

This post would not have been possible without the help of these sites:

  • ArchWiki: I know nothing about Arch Linux, but this wiki page has a lot of good info.
  • fontconfig.org: the most complete and recent ~/.fonts.conf reference I’ve found.
  • Ubuntu Wiki: contains an example of a very comprehensive (if dated) ~/.fonts.conf file. Study it and learn how to do other stuff.
  • The Masterplan: another sample ~/.fonts.conf file, and the only other one that I know of that turns off hinting and subpixel rendering.

34 Responses

Google using inline CSS?

With only one font-family? And it’s Arial? The nerve!

<td class=bubble rowspan=2 style="font-family:arial;text-align:left;font-weight:bold;padding:5 0"><b>Celebrating 5 years of Gmail</b></td>

I don’t have Arial installed, so this shows up as my default serif, because they don’t even bother to include the generic ‘sans-serif’ font-family.

Leave a Comment

How to Change the Clock Theme in GNOME Do

gnome-do-clockAs far as I can tell, there are no additional “themes” out there. But I did find the SVG files the clock uses in

/usr/share/gnome-do/ClockTheme

It would be easy enough to replace these; ideally I guess there would be a section in the GNOME Do wiki to upload clock theme packages. The hands of the clock are another matter, generated by Do itself. As it is, I’ve never created an SVG in my life, so I’m stuck with a numberless clock for now.

2 Responses

Macbook Wheel Predictive Sentence Technology

The aardvark admitted its fault.
The aardvark admitted it was wrong.
The aardvark asked for an aardvark.
The aardvark asked for a dagger.
The aardvark asked for health.
The aardvark asked for a ride.
The absinthe arrived by airmail.
The abortion went well.
The actor asked for an aardvark.
The actor asked for abstinence.
The actor asked for redemption.
The advertisement was effective.
The agile aardvark arrived by airmail.
The agile aardvark bathed with beauties.
The agriculture was cultivated by the coral.
The aggravated driver beeped on his horn.
The aggravated rooster scratched the dirt.
The Althusserian scholar gave his copy of Lacan’s “Ecrits” to the
abortion doctor.
The amiable Althusserian scholar asked the aardvark for absinthe.
The amiable crocodile brushed his teeth with a toothbrush.
The amiable doctor performed the operation admirably.
The annex was covered with asbestos.
The annex was crawling with beetles.
The apple was airmailed by the doctor.
The apple was consumed by the amiable crocodile.
The apple was inquiring about the amiable crocodile’s friend.
The aquamarine lifevest was not used.
The aquamarine lifevest was unpopular.
The armchair was uncomfortable.
The armchair was favored by the amiable housecat.
The ass asked for a better absinthe.
The ass brayed at the moon.
The assumptive doctor did not accept our personal check.
The assumptive agricultural expert eyed our absinthe suspiciously.
The attractive peanut farmer graded the term paper.
The attractive rooster preened its feathers to attract absinthe.
The auxiliary generator has malfunctioned!
The awning covered the agile aardvark during the amiable rainstorm.
The awning was too tall to touch.
The babbling baby asked the aardvark for some absinthe.
The babbling baby baked brownies with the amiable crocodile.
The babbling baby basked in its mother’s affection.
The babbling baby bounced the ball at the babbling brook.

One Response

Typography in Ubuntu 8.10 Intrepid Ibex

One thing I’ll never understand is why Ubuntu ships with such hideous default system fonts, when there are some perfectly great open source fonts built right into it. For instance, UnDotum is a near-exact clone of Franklin Gothic, although strangely a Google search for undotum “franklin gothic” only turns up one page that mentions the two together. It seems to be an arbitrary similarity, as the purpose of UnDotum and other UnFonts is to provide Korean characters. Anyway, it makes a good window title font.

Then there’s Nimbus Sans, which is indistinguishable from Helvetica; DejaVu Sans, which as far as I can tell is a descendant of Frutiger (and, hence, a cousin of [Apple’s] Myriad and [Microsoft’s] Segoe UI), and makes a nice all-around system font; and Libertine, which makes for a great general-purpose body serif. Once you set these as the fonts in GNOME and in Firefox, everything looks scores better — better than Ubuntu’s default look, certainly, and arguably better than Windows.

2 Responses

Alphabetization: Part III

In what I think may be the first truly novel browsing environment developed for Songbird, ♪Photo displays your library as a pile of artist photos pulled from Last.fm. They can be dragged around and rearranged, and their orientation is remembered between Songbird sessions. In my testing it is unusably slow, however it is remarkably exciting to see innovation like this before Songbird is even out of beta. It would be an easy matter to implement a “snap” feature that would cluster similar artists together based on Last.fm data, or to provide an alternate view by album cover rather than artist photo — honestly, who can recognize some of these artist photos?

Anyway, as it’s only a couple weeks old I’m sure it will improve, and it demonstrates just what amazing things can be done with the Songbird platform. Hopefully we’ll see more daring and clever extensions like this when Songbird hits 1.0 next month. I’m considering making it my full-time player in order to collect more statistics (play dates, play counts, added dates, etc.).

One Response

Alphabetization: Part II

First, some good news: Songbird is now in public beta! It’s amazing how stable things have gotten just over the last six months. And, significantly, it now features a Playback History API, which by the looks of things allows developers access to the entire play history of any song in a library, something that is crucial to the kind of deep library scavenging I’ve been pining for.

Since I last wrote, everything I see or read seems to inspire my half-baked ideas about the better ways we can browse our unmanageably large music libraries. After telling a friend about these ideas, he said:

Yeah, it’s actually really frustrating. I intentionally keep the number of artists on my iPod small so I don’t have to sort to find things I’m currently into.

Me too.

Then there are the people who are doing a lot of (real) work towards novel interfaces like the (hypothetical) ones I’m describing; Last.fm’s “Islands of Music” (explained here) demonstrates the kind of artist-similarity topology that would make browsing your library a more pleasant experience; Lee Byron explains in more detail how he developed that Last Graph infovis; necimal releases a Music Recommendations extension for Songbird that promises to use Last.fm’s data to find within your library artists similar to the one playing; and the Aurora project, part of the Mozilla Labs concept browser series, depicts a radical three-dimensional view of files and data with auto-clustering, which, if applied to a music library, would be nothing short of incredible.

I’ve also thrown together a pitiful little mock-up of what Songbird might look like when you start it up with the kind(s) of extensions I’m hoping for:

The two core components depicted are the Start Page and the Timeline View. The Start Page I feel would be seriously valuable, one of the ideas behind all these blatherings of course being that one doesn’t always have a destination in mind when opening their music library. The Start Page would offer a number of convenient “jumping-off” points, pulling you into your library to explore it further — by artist similarity, maybe, or by play history proximity, after just a couple clicks.

The Timeline View is a zoomable timeline, shown here zoomed to a daily view. Zooming out could show you albums played within recent weeks; then months, quarters, etc. These albums might be sorted by Periodical Impact, something I explained in depth here; essentially they would be sorted not by the raw number of times they were played within any given period, but by how distinct they were to that period.

Even these meager ideas are leagues ahead of what’s available, and I’m not even a data analyst. Just imagine how a library’s play history data could be exploited by somebody trained in these things.

One Response