Anybody out there in blogging land use the Mikachan font?
I grew very fond of it, and used it for my Last.FM banner script ( See the generated image if you’re curious ). However, mikachan-font-9.1 recently because available in portage, and like a good little Bleeding Edge user, I updated. And as a result, all of the text just disappeared from the Last.FM banner.
Upon investigating the problem further, I noticed that there are no longer TTF files in the package.
Instead, there are “TTC” files.
$ equery f mikachan-font
[ Searching for packages matching mikachan-font… ]
* Contents of media-fonts/mikachan-font-9.1:
I’ve thought about simply masking version 9.1 and stepping back down to 8.9, but I’m sure I would be missing characters or something like that. ( Like I said, I’m a bleeding edge kind of guy ;). )
The problem is, I use the imagettftext() function in PHP in order to render the text on my image.
The path to the TrueType font you wish to use.
Depending on which version of the GD library PHP is using, when fontfile does not begin with a leading / then .ttf will be appended to the filename and the library will attempt to search for that filename along a library-defined font path.
And now that there are .ttc files, PHP can no longer make use of them.
Is there a sane solution? Should I make .ttf symlinks? Are .ttc files any different?
I’d love to read the Mikachan website and figure it out for myself, but I don’t know Japanese!
After doing a bit more research, a TTC could be one of two things. A Compressed TTF, or a Collection of TTF fonts. With a filename like ‘mikachanall.ttc’, I’m wiling to opt for the latter.
My searches for a TTF extractor/decompressor from a TTC are coming up empty. Anybody out there in the community know of a solution?
MY BEST BUDDY EVER io_error (also here on wp.com) helped me in IRC to get the TTC decompressor working.
The source does work, but you have to pass a special g++ flag:
g++ -fno-for-scope -DINTEL -o ttc2ttf ttc2ttf.cpp
And then we have a fully compiled binary (zomg!). After that, you just give ‘er a run and point it at the TTC file you want to extract the TTF files from:
The nuisance is that the TTF files come out named like: “ttcfont0.ttf , ttcfont1.ttf , ttcfont2.ttf”, so the names of the fonts in the collection are not preserved. In short, SCREW THAT.
I decided (finally), that it’d just be easier to downgrade mikachan back to 8.9-r1. I did, and life is good. And my Last.FM Image is slick again.
I poked around at Gentoo’s Bugzilla on the matter, and finally found the cause of all these issues.
“Someone” asked for a version bump to a version built for WINDOWS, NOT LINUX (-_-), and a developer complied.
So, we have a Windows Mikachan-font version in Gentoo’s Portage. Great! I went ahead and filed a bug asking for a revert in bug 148097. No word there yet.
echo "=media-fonts/mikachan-font-9.1" >> /etc/portage/package.mask
Ran it, and moved on with life.