Google Chrome supports @font-face

With custom typefaces being all the rage in web development right now, I seem to come across at least one person every day who complains about the lack of font-embedding support in Google’s Chrome browser.

Chrome, being built on the WebKit rendering engine, which already has support for @font-face, likewise also already supports embedding fonts. The reason font embedding doesn't work 'out of the box' in Chrome is because it was disabled, citing a potential security vulnerability.

Chrome, with web fonts enabled, rendering a custom font in an A List Apart article

Screenshot of Google Chrome rendering a custom font inside a sample HTML page, from the A List Apart article "CSS @ Ten: The Next Big Thing"

Despite being disabled by default, the feature is still fully functional, and can be enabled easily. To enable web fonts, run the Chrome executable with the 'enable-remote-fonts' switch. For example, in Windows [XP] your shortcut will probably look something like this:

"C:\Documents and Settings\USER\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --enable-remote-fonts

Obviously you'll have to modify the path to suit your particular installation, but if you're modifying an existing shortcut or link to chrome that part should already be done for you. The important bit, in Windows shortcuts at least, is that the switch (the bit after the double-hyphen) goes outside the double quotes which enclose the path and filename.

If you're a linux or unix user, switches should be second nature to you. And if you're an OS X user, you're on your own. I have no idea how that works.

Update (2009.09.28 21:05):

Paul Irish wrote "Chrome and @font-face: It’s coming!" on his blog. He mentioned that in OS X, simply use Terminal to launch Chrome:

/Applications/Chromium.app/Contents/MacOS/Chromium --enable-remote-fonts

2 Responses to “Google Chrome supports @font-face”

  • Abdul-Majid Bhurgri 2010.04.25 15:04

    I have tried using your advice but my website does not show fonts properly. When I reload the page (F5), for a fleeting second the embedded fonts show, and then it reverts to system fonts.

    I will be grateful if you could assist me. Thanks.

  • Justin Ryan 2010.05.11 01:04

    @Abdul-Majid Bhurgri

    The latest releases of Chrome include @font-face support, and it is enabled by default, so the above mentioned switches are no longer necessary.

    If your fonts still do not display properly, there is likely a problem with your code, or some JavaScript is overriding your font settings.

Leave a Reply

Common formatting HTML allowed (when in doubt use code, if it fails, I'll edit appropriately).
Always close tags.