News for hackers. Stuff that matters.
Re:UTF-8 – "The most elegant hack" by gonnakillme on Saturday September 28, 2013 @11:19PM (#6463975)
One way to think about text encoding is that it provides a nice way to represent indexes into a big array of glyphs: "unicode". Fonts map (some) of these indexes to graphic representations and provide "font hinting" -- clues as to how different letters should be rendered at different sizes -- and kerning information.

Usually your desktop environment is the thing that handles all of this, providing widgets for other programs to combine to create GUIs. I can't find it right now, but you can probably find e.g. GNOME/GTK's implementation.

(Re: Textmate: code is typically rendered in monospace font -- where every glyph has the same size -- so that it has the same alignment in every font with every renderer.)

Re:UTF-8 – "The most elegant hack" by iv_08 on Sunday September 29, 2013 @07:56AM (#6464914)
GTK+ uses Pango [1], which uses the FreeType [2] backend on Linux. There's also a pure Go implementation of FreeType. Here's the entry point for those who are interested in reading the code: http://code.google.com/p/freetype-go/source/browse/freetype/...

[1] http://www.pango.org

[2] http://www.freetype.org

Re:UTF-8 – "The most elegant hack" by MarcusBrutus on Sunday September 29, 2013 @09:59AM (#6465193)
I think the terminology you use is not right. Unicode maps integers to graphemes (not glyphs) and vice-versa (i.e. it's a 1-1 mapping). Fonts map graphemes to glyphs.
Re:UTF-8 – "The most elegant hack" by ygra on Monday September 30, 2013 @01:57AM (#6468019)
This is even more wrong. Unicode maps integers to abstract characters. Fonts map characters to glyphs and layout engines map glyphs to graphemes. Keep in mind that graphemes can be composed of multiple parts, e.g. ligratures or combining characters.