Category Archives: Tech

Embed Fonts in Websites

Here’s an easy and effective way to add some excitement to a website, embed some custom fonts, so they can be displayed in the browser even if they are not installed on the visitor’s computer. There are 2 ways to do this; use a Web Font Embedding Service (see http://www.smashingmagazine.com/2010/10/20/review-of-popular-web-font-embedding-services/ ), or manually add them using the CSS3 @font-face rule. I will explain how to do the second option.

First find a font that is not restricted by copyrights, and legal to use and embed on your website. I like http://www.dafont.com/ , it has many free open source fonts, and you may make a donation to the designer. Firefox, Chrome, Safari, and Opera support fonts of type .ttf (True Type Fonts) and .otf (OpenType Fonts), so start with one of these formats. Try to use a fairly efficient font, like less than 200kb.

Microsoft Internet Explorer is still the most widely used browser on the Web (39%), and it does not support .ttf nor .otf for @font-face embedding, it requires .eot (Embedded OpenType). Fortunately, there are easy ways to create them. A simple converter can be found at http://www.kirsle.net/wizards/ttf2eot.cgi . It only converts .ttf, and has no options. Another more versatile option is http://www.fontsquirrel.com/tools/webfont-generator . It can convert .ttf and .otf, and has several options to customize the output files for advanced users. There are other converter sites, I’ve used these 2, they’re fast and easy to use.

Once you have your font formats, upload them to your server. Then you need to use the @font-face rule in the CSS;

@font-face
{
font-family: Font1; /* any name you like */
src: url(‘Font1.ttf’),
url(‘Font1.eot’) format(“opentype”); /* IE */
}

[Of course src needs to point to the correct location of the font files.]

Then you could create a class to reference the font in many places;
.font1{font-family: Font1;}

The only thing left to do is design with the font by specifying the class;

<div class=”font1″>My embedded font!</div>

That’s it, easy huh?

Mozilla’s WebAPI & B2G: more good zen

Mozilla, creators of popular free open source software (such as Firefox web browser and Thunderbird e-mail client), are working on two new projects aimed at uniting the way we access some of the various internet applications out there. WebAPI is intended to make Web-based applications compete better with native apps. B2G (Boot to Gecko) is being developed as a complete, standalone operating system for the open Web with attention on mobile devices.

WebAPI
Developers today need to create apps for many platforms (Apple iOS, Google Android, Blackberry, Symbian, Windows Phone). Mozilla wants to simplify that by offering the alternate choice of creating one ‘WebApp’ instead. This would be access thru the browser with basic HTML5 code. They would interact with a phone’s dialer, address book, contacts list, and camera. Two other companies have been developing similar technology, Opera and Adobe. WebAPI is part of W3C’s Augmented Reality Community Group, and complies with the development and further W3C standardization of open API’s. Web programming is expanding fast due to: JavaScript’s performance, mobile device browser capabilities and internet 3G & 4G speeds, and cloud computing.

B2G
B2G is competing with Google Chrome OS a bit, but they are also both efforts at making advanced apps (not only basic) run smoothly on the Web. Both OS are trying to use Android’s “intents”, which allows an App to grab something from another App, like YouTubeApp pulling a video from the phone’s gallery. B2G will uniquely boot from Android drivers, and be released in “real-time,” new features added immediately, making a rapid release cycle. Mozilla has many challenges ahead (especially security and data usage), but it seems to going in a positive direction. Even Microsoft (who may lose market share with WebApps) is developing browser IE10 to be WebApp friendly. That must be a good sign.

HUAWEI ASCEND M860 cellphone, with carrier MetroPCS

So I finally jumped into the smartphone craze in April, with the MetroPCS HUAWEI ASCEND M860. No it’s not the best, fastest Android cell phone out there, but for me this is a big improvement over my Motorola VE440. I had been thinking about getting a smartphone for a while, then my wife’s old Samsung flip phone started to die, so she got my Motorola (just fine with her, it’s better anyway). We’re both with MetroPCS, so switching phones was easy. So I’m a ‘late adopter’, usually, but ‘better late than never’ (BLTN), right? Anyhow, I am thrilled with this amazing little piece of technology! The Android interface is very intuitive, and navigating through the apps is simple enough. It has taken some reading and learning to get familiar with the device’s many capabilities. Setting up the email service was easy, especially with Google, since it’s their Operating System. The first thing that pleasantly impressed me was the touchscreen keyboard, with its auto-complete feature. I just start typing a word, and it brings up suggestions, which I can scroll to see more, and tap to fill in that word, very cool. It loads with the Swype keyboard, but I prefer the stock Android keyboard, and there are others that can be installed (see http://www.androidcentral.com/android-centrals-keyboard-roundup ).

The cool thing about this little green R2D2 is he’s open source, unlike Apple’s proprietary iOS. Android Market has over 200,000 apps with 57% free, Apple App Store has 28% free. The ASCEND comes preloaded with several apps, a web browser, email, text messanger, calender, music player, many MetroPCS apps, and of course many Google apps (Gmail, Contacts, Maps, Market, Search), and YouTube. There are apps I haven’t used yet. Some of the apps I have installed are Facebook, Speed Test, Weather Channel, TuneIn Radio, USA Today, and Speedx game. Facebook and YouTube are excellent. Since the ASCEND shoots video, I can upload directly thru these apps. It has three video quality settings, 30m low & hi, and a 10m ‘YouTube’ setting. You can see one of my cat Luna at http://www.youtube.com/user/swimsify#p/u/0/5JTN7KyaHH8 . It also takes up to 3.2 megapixels still photos, the quality is ok, but it doesn’t have a flash.

ASCEND
ASCEND

ASCEND comes with Android OS 2.1. I upgraded mine to 2.2, but MetroPCS made it a bit tricky. It is worth the effort. I like the look of 2.2, with white text on black backgrounds, and selections a brite orange. The ASCEND comes with a 2GB microSD card, and a Stereo headset with microphone (with mute/pause button). The CPU clocks at 528 MHz, which is about half the speed of the newer, pricier cell phones. My MetroPCS deal is about $50 total (after tax & fees), and includes unlimited talk, text and data, nationwide (although their network coverage is limited compared to the big carriers). One major drawback to the ASCEND is the data speed 1x, which is like the old dial-up speeds, around 50 kps upload & down. That’s ok for emailing, but not much else. Fortunately it has Wifi! Compare this to average download speeds of 3G at 1 Mbps and 4G at 4 Mbps. Looking forward to getting a 4G, when I get ‘a round 2 it.’ For now, the HUAWEI ASCEND at $100 (after $30 mail in rebate), is a pretty good deal, and a fun and productive device.