@font-face on Android

@font-face on Android

Since the Koolu Android beta for OpenMoko FreeRunner, and NITDroid for Nokia N810 both have broken @font-face support, and I am behind on my studies and can not wait for these things to be fixed, I bought a HTC Dream/T-Mobile G1 handset on eBay for £205. After a bit of hacking, I have got rid of the Tivoisation - got full root access - and @font-face works great! See the photos.

It arrived this weekend, reset to factory settings, and so when it was turned on it required registration with Google using a Google Account. The kindly eBay seller included a T-Mobile PAYG SIM with 8p credit, so I had to top that up to £10.08, and then it registered fine. Well, at the cost of £1, which is the per-day cost of unlimited 3G data on T-Mobile PAYG; 11p for the first 14kb and then 89p for anything more than that, and because Android assumes an unlimited data plan (like the iPhone) then each day you turn the phone on, it rings out 11p (and perhaps more if you get a lot of email…) There are no free software data-connection-blockers.

It is possible to register using the wifi, but I had the RC8 version, so the RC7 “hidden root console” feature of the registration program had been removed.

Fortunately, its possible to downgrade the G1 to enable root access, thanks to the XDA-Developers Wiki (and the nicely photographed Gizmodo page about rooting a G1 is good to read too, as it this short summary.)

First run these two commands to get Android nicely detected on GNU/Linux:

echo 'SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"' | sudo tee /etc/udev/rules.d/50-android.rules;
sudo chmod a+rx /etc/udev/rules.d/50-android.rules;

Then connect phone to computer via USB, on phone bring down status menu from top of screen and click USB message and click “mount”. It should then be mounted automatically by GNU/Linux. Then download the 43Mb file and copy it to the SD card. Use “df -h” to see what /dev file the card has, in my case, /dev/sde

df -h;
wget http://koushikdutta.blurryfox.com/G1/DREAMIMG-RC7.zip;
unzip  DREAMIMG-RC7.zip;
umount /dev/sde;
sudo mkfs.vfat -Iv /dev/sde;
sudo mount /dev/sde /mnt;
cp DREAIMG.NBH /mnt/;
sudo umount /mnt;

Turn the G1 off, plug it into the charger, then hold Camera button and turn on. The bootloader mode start, with instructions to flash the phone with the update on the SD card. The scrollbar went across to 100% for me, and then paused there for ages, and then the text menu has “OK” appear for each line, and then it said to restart the phone. To do this, hit the trackball button and then press Call, Menu and End simultaneously.

When the phone boots up normally, to see the special root console, tap the desktop and type

    [enter] [enter] reboot [enter]

Ignore the address book that pops up; the phone will magically reboot :-)

Next up is to install a unrestricted boot loader to “de-tivoize” the phone, so it can be upgraded with any OS image.

Plug in the USB cable and let GNU/Linux mount the SDCard. Then grab and copy these files to the disk:

wget http://koushikdutta.blurryfox.com/G1RootWalkthrough/recovery.img;
wget http://koushikdutta.blurryfox.com/G1RootWalkthrough/HardSPL/update.zip;
cp recovery.img update.zip /media/disk/;
mv update.zip hardspl-update.zip;
mv recovery.zip rc29-recovery.zip;

Then eject the SD Disk, and reboot the phone. Then when it starts, tap the desktop and type

    [enter] [enter] telnetd [enter]

Then set up the Wifi, go to the market, and search for telnet, and install it. Then connect to “localhost” server and see the root prompt, “#” and then type these 5 commands:

mount -o remount,rw /dev/block/mtdblock3 /system;
cd /system;
cat /sdcard/recovery.img > recovery.img;
flash_image recovery recovery.img;

When the phone boots, shut down again, and then start up holding the Home button along with Power. Press Alt-L to see the menu, then Alt-S to apply the update, then Home and Back to reboot. The phone boots a couple times and comes up normally.

Now that’s done, the task is to find a nice version of Android to run. The JesusFreke releases seem well regarded on the forums, and I must keep an eye out for new releases on the android-dls.com forum - remember that the RC33 is for the USA and the RC8 is UK. Plug in the computer USB cable:

rm /media/disk/*;
wget http://jf.odiness.com/v1.41/JFv1.41_RC8.zip;
mv JFv1.41_RC8.zip JFv1.41_RC8-update.zip;
cp JFv1.41_RC8-update.zip /media/disk/update.zip;

Then turn off the phone, turn on holding home + power, see the yellow arrow icon, and then press alt+l to see the menu and alt+s to install the new OS.

When it boots, you’ll find a multitouch-zooming webbrowser and a Terminal application in which you can ‘su’ to get root access.

With this installed you can then install and use a “tethering” tool to connect to the net via 3G and then set up the phone’s wifi as a basestation for laptops and other computers to access the net over wifi. Installing programs is done with the “adb” tool:

wget http://people.openmoko.org/sean_mcneil/adb;
chmod +x adb;
wget http://android-wifi-tether.googlecode.com/files/signed_andTether_0_90.apk;
./adb install signed_andTether_0_90.apk;

Here are the free software Android tools I’ve installed so far:


Also, note that the above doesn’t unlock the SIM, so the handset is restricted to use on the T-Mobile network only. To unlock it, one needs to put in a different network SIM card and enter an unlocking code. modmygphone.com/unlock is the cheapest I could see, providing unlock codes for USD$20; unlock-tmobileg1.com was next at USD$25. There are some rumours going around that this is discriminated against by network operators or Google, but they seem unsubstantiated. To use these services, just read the IMEA from under the battery, or via the Menu, Settings, About, Status page. I got mine after about 2 hours on a Saturday afternoon, and it worked perfectly. However, once the phone is SIM-unlocked, and using a different network, it needs to know the APN settings to access the net. UPDATE: mymodgphone has a worldwide list, but its settings were incorrect, and the correct ones are very simple.

To connect a unlocked G1 Android phone to Orange Internet, just enter these 4 settings from “Home Menu, Settings, Wireless Controls, Mobile Networks, Access Point Names, menu key, add new button”:

APN: orangeinternet

port:9201 MCC:234 MNC:33

Note that MMS won’t work, but I’ve used that about 3 times in my life, ever.

There are a lot of great android resources out there, so the wikis tend to have the best stuff from forums all collated together. in one place. Nice ones are android-dls.com/wiki/ and androidwiki.com

Creative Commons License
The @font-face on Android by David Crossland, except the quotations and unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.


2 Responses to “@font-face on Android”

  1. Jean-Baptiste on March 7th, 2009 18:42

    Hello! What’s the typeface used in the screenshot?

  2. David Crossland on March 8th, 2009 23:34

    They are Ray Larabie proprietary fonts, I don’t know the names. The page is http://www.alistapart.com/d/cssatten/poen.html which is linked to from http://www.alistapart.com/articles/cssatten

Leave a Reply