HTML and CSS Reference
Similar to (X)HTML documents, CSS can also be applied in SVG documents so the @font-face rule can be used
for SVG texts too . Listing 9-14 shows an example.
Listing 9-14. An Example for Using the @fontface CSS Rule in SVG
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
<svg xmlns=" http://www.w3.org/2000/svg " version="1.1">
<text x="20" y="40" style=" font-family: Calluna , serif; font-size: 1.2em; stroke: #0f0;
fill: #0f0;">SVG text with Web Fonts</text>
Embedding External Content
The majority of web sites contain not only formatted texts but also graphics and multimedia content, audio and video
clips, and Flash animations. In contrast to formatted text content described by markup languages in text files, this type of
content is retrieved from binary files. Although the format and features of such binary files are not standardized for web
publishing, their optimization has a huge impact on overall appearance, look and feel, file size, and download time.
Bitmap graphics (also known as raster images), which are stored in a mapped array of bits and represent a grid of
pixels, are common web site components. On the Web, bitmap file formats are used mainly for storing photographs
and other images that are not line art. There are several image file features to be optimized for web publishing,
such as pixel density, color depth, and resolution. You should choose the file format according to the content and the
The Golden Rule of image processing and retouching for the Web is that whatever will be modified, the original
master file should not be overwritten (even if it has a large file size). For example, a title in a compound image created
on multiple layers in Photoshop cannot be modified later if you don't preserve the .psd file. Similarly, a heavily
retouched or compressed photograph cannot be restored to its original state (which might be useful sometimes) if you
haven't saved the original file.
■ the following sections describe the major features and possibilities; however, a detailed description of image
processing is beyond the scope of this topic.