May
18
2009
Major FontLabel update
Posted by: Kevin Ballard in Cocoa, iPhone, tags: FontLabel, iPhone, iPhone SDK, Obj-C, ProgrammingLast week I pushed out a major rewrite of FontLabel. This new version includes a category modeled after UIStringDrawing that enables you to draw text in custom fonts in your own drawRect:
methods. It also includes accurate font metrics and uses more of the built-in UILabel properties. Contributions are welcome!
I had to add this line ( if (table == NULL) return; ) when using fonts that use the magic number 29 otherwise I had a crash.
static void freeFontTable(fontTable *table) {
if (table == NULL) return;
CFRelease(table->cmapTable);
free(table);
}
Ah hah, good catch. I don’t have any fonts that use the magic number 29 any more. I’ll see if I can’t get that put into the official repo today.