Archive for January, 2012

With the launch of Adobe Edge Preview 4 we are excited to bring you the new web fonts feature! The web fonts tool in Edge is extremely versatile by letting you use your font service of choice to display web fonts and custom font stacks in your composition. We’ll go over some how-to steps to get you started with some popular web font services.

Some history

It’s a myth that @font-face has only been in use since the introduction of CSS3. @font-face support has been around since IE4! Currently web fonts are supported by the following browsers:
IE4+
Safari 3.1+
Opera 10+
Chrome 4+
Firefox 3.5+

Modern browsers have gone their separate way as far as font support goes. For this reason it’s good for your @font-face declaration to contain several fallback font files.

Internet Explorer only supports EOT
Mozilla browsers support OTF and TTF
Safari and Opera support OTF, TTF and SVG
Chrome supports TTF and SVG.
Mobile browsers like Safari on the iPad and iPhone require SVG.

A typical CSS file with an @font-face declaration will have something similar to the following:

If you’re having problems with displaying web fonts, check first to make sure you have all available font types. For example if your web font only has an EOT and TTF file, your font won’t display on an iDevice.

How to Embed Web Fonts Using Local CSS

In this example, you will be using a local CSS file containing the @font-face declaration. In this instance you will need the CSS file and your web font files (preferrably in the same directory.)

Step 1:
If you do not already have a CSS file with an @font-face declaration or your web font files, go to fontsquirrel.com to generate a font kit using an existing font.

Step 2:
Move the font and the generated CSS file to the directory of your Edge composition. Your files should look similar to this.

Legal Considerations

Added January 30, 2012Most fonts come with an EULA that specifies how the font can be used. For example you can purchase a font to use for print, but the EULA can say you are not allowed to embed that font for web use. In the past few years a lot of font foundries and font services have been picking up on the trend of web based fonts and writing EULAs that specifically target web use (how many sites can be embedded, how many views, etc.) For the purposes of the Web Font tool in Edge, the onus of liability is left up to the user to know what their limitations of the font file are. There simply isn’t a feasible way for Edge to determine if the EULA for the font is valid or not, especially since Edge only handles the CSS stylesheet for the font and not the file itself.

These are just some of the options you have for using web fonts in Edge, and by following the steps you can apply the same method to use other font services. Happy typesetting!

It gives us great pleasure to introduce Edge Preview 4 today, available on Adobe Labs. As you know, it’s been a while since we launched Preview 3 at MAX last October, and we think Preview 4 is worth the wait. Major new features have been added, as well as usability improvements and fit and finish details that you’ve been asking for. Here’s a quick summary:

Define a font fallback list for users who don’t have the font in your composition.

Element Display:
Control how long an element is displayed, so they only appear when needed. By default, elements are always on, even if they’re off the stage. They can be configured to be “off” (equivalent to display=”none”), removing them from the HTML rendering tree and reducing resources. Check out the complete list of updates here.

Also check out this new video with Adobe Fellow Mark Anders, who’ll show you how to use the new features in Preview 4.

Working with HTML, CSS and JavaScript and getting it successfully deployed on the web can be a daunting task. For those new to the technology, it can be extremely frustrating and in some cases it can be a show-stopper. We’ve had a lot of folks try Edge Preview 3 and some of them have run into issues getting their content running and deployed to the web. On the Edge team we do a lot of debugging as we resolve various defects in the product. The following are a few useful techniques you can use to figure out why an Edge composition is not running or deploying as expected.

Browser Compatibility

One thing to understand up front is that Edge content only works on modern browsers. In Preview 3 that means IE9+, Firefox 4+, the latest Safari and Chrome on the desktop – the latest iOS and Android Webkit browsers on mobile. We are working on better down-level browser support, but until that is added you would have to do extra work outside Edge to provide an alternate down-level experience.

Recovering Your Work from JavaScript Errors

There have been a handful folks reporting that their composition fails to open after a save. It is a scary thing to see the blank page come up after spending hours creating a composition. Folks will be running into fewer of these kinds of issues as the product matures, but in the meanwhile a little debugging goes a long way; it is generally pretty easy to recover your work.

First, a little context. Edge runs your composition in a Webkit-based stage. The data that makes up your composition is stored in a JavaScript structure that is interpreted within the stage and subsequently understood by Edge. If there is a syntax error in that JavaScript structure then Edge sees nothing and opens a blank page. In Preview 4 Edge will alert you of this condition and will not open the file. These types of errors not only prevent Edge from opening the composition, they prevent it from playing properly in the browser.

JavaScript syntax errors are pretty easy to fix. The first step is to figure out where it is broken. There are a number of ways to find JavaScript errors, the following should get you started with Dreamweaver or a WebKit browser (Chrome or Safari).

Dreamweaver

If you have Dreamweaver it will flag the error when you open the offending JavaScript file (xyz_edge.js is a good one to start with).

1. Open the HTML file in Dreamweaver.

2. Select the xyz_edge.js file in the related file list. If you don’t see xyz_edge.js in the related files list, select "Live View" which causes Dreamweaver to rescan the related files.

3. Observe the error on Line 18. The quote is double-escaped and makes it impossible for Edge to read the file.

4. Fix the error and the warning goes away. In the example above the string is “double-escaped” which means there is an extra ‘\’.

Browser-Based Tools

You can also view errors in your browser by opening the JavaScript console. The following screenshots were taken using Google Chrome, but the same or similar steps can be taken to see errors in Safari or Firefox w/Firebug.

1. Open your page in the browser.

2. Right-click and choose “Inspect Element”

2.5 Or…

Note: On Safari you have to enable Developer tools before you will see the option to Inspect Element

3. Refresh the page. This is not strictly necessary, but in some cases the Developer Tools don’t see all the JavaScript files that were loaded.

4. Make sure the Console tab is selected, you should see any errors displayed.

5. Click the file + line number (to the right of the error)

Hosting, Deployment and Related Problems

There are many options for hosting HTML content. Depending on how your host is set up, you have been given a way to upload content to the server. To get an Edge composition to work you have to deploy the HTML source as well as the JavaScript, CSS and related image files.

Not only do the files need to be deployed, they also need to end up where the composition expects them. You must copy the /images folder and the /edge_includes folders to your web server. Note: the site management in Dreamweaver and other site management tools may not "see" the images and scripts that an Edge composition requires, so be sure you select and transfer all of the required resources (upload/put the folders and their contents in addition to the HTML file).

The easiest way to determine whether you are having a problem with resource deployment is to use the inspector in Chrome or Safari or Firebug in Firefox to see what files are being requested and whether they are found or not.

The Network tab is most useful for this type of investigation. You should see requests for several edge_includes/XXX.js files, the request for your composition’s xyz_edge.js file followed by requests for any images used by your composition.

The above screenshot shows a 404 (not found) error. That means the file “Adobe_logo.svg” was not found.

In the xyz_edge.js file that file is referenced via a relative path.

In order for the Adobe_logo.svg file to be found, there must be a folder named “images” that is a peer of the xyz.html file and the images folder must contain Adobe_logo.svg.

Hosting SVG

In order for some web browsers to understand SVG images properly, they need to be served in a particular manner by your web server. If this is not setup properly then the SVG will not display.