ディレクトリ 検索
Scalable Vector Graphics (SVG) 1.1 (Second Edition) 1 Introduction 1.1 About SVG 1.2 SVG MIME type 1.3 SVG Namespace 1.4 Compatibility with Other Standards Efforts 1.5 Terminology 1.6 Definitions 2 Concepts 2.1 Explaining the name: SVG 2.2 Important SVG concepts 2.3 Options for using SVG in Web pages 3 Rendering Model 3.1 Introduction 3.2 The painters model 3.3 Rendering Order 3.4 How groups are rendered 3.5 How elements are rendered 3.6 Types of graphics elements 3.6.1 Painting shapes and text 3.6.2 Painting raster images 3.7 Filtering painted regions 3.8 Clipping 3.9 Parent Compositing 4 Basic Data Types and Interfaces 4.1 Syntax 4.2 Basic data types 4.3 Real number precision 4.4 Recognized color keyword names 4.5 Basic DOM interfaces 4.5.1 Interface SVGElement 4.5.2 Interface SVGAnimatedBoolean 4.5.3 Interface SVGAnimatedString 4.5.4 Interface SVGStringList 4.5.5 Interface SVGAnimatedEnumeration 4.5.6 Interface SVGAnimatedInteger 4.5.7 Interface SVGNumber 4.5.8 Interface SVGAnimatedNumber 4.5.9 Interface SVGNumberList 4.5.10 Interface SVGAnimatedNumberList 4.5.11 Interface SVGLength 4.5.12 Interface SVGAnimatedLength 4.5.13 Interface SVGLengthList 4.5.14 Interface SVGAnimatedLengthList 4.5.15 Interface SVGAngle 4.5.16 Interface SVGAnimatedAngle 4.5.17 Interface SVGColor 4.5.18 Interface SVGICCColor 4.5.19 Interface SVGRect 4.5.20 Interface SVGAnimatedRect 4.5.21 Interface SVGUnitTypes 4.5.22 Interface SVGStylable 4.5.23 Interface SVGLocatable 4.5.24 Interface SVGTransformable 4.5.25 Interface SVGTests 4.5.26 Interface SVGLangSpace 4.5.27 Interface SVGExternalResourcesRequired 4.5.28 Interface SVGFitToViewBox 4.5.29 Interface SVGZoomAndPan 4.5.30 Interface SVGViewSpec 4.5.31 Interface SVGURIReference 4.5.32 Interface SVGCSSRule 4.5.33 Interface SVGRenderingIntent 5 Document Structure 5.1 Defining an SVG document fragment: the 憇vg?element 5.1.1 Overview 5.1.2 The 憇vg?element 5.2 Grouping: the 慻?element 5.2.1 Overview 5.2.2 The 慻?element 5.3 Defining content for reuse 5.3.1 Overview 5.3.2 The 慸efs?element 5.4 The 慸esc?and 憈itle?elements 5.5 The 憇ymbol?element 5.6 The 憉se?element 5.7 The 慽mage?element 5.8 Conditional processing 5.8.1 Conditional processing overview 5.8.2 The 憇witch?element 5.8.3 The 憆equiredFeatures?attribute 5.8.4 The 憆equiredExtensions?attribute 5.8.5 The 憇ystemLanguage?attribute 5.8.6 Applicability of test attributes 5.9 Specifying whether external resources are required for proper rendering 5.10 Common attributes 5.10.1 Attributes common to all elements: 慽d?and 憍ml:base? 5.10.2 The 憍ml:lang?and 憍ml:space?attributes 5.11 DOM interfaces 5.11.1 Interface SVGDocument 5.11.2 Interface SVGSVGElement 5.11.3 Interface SVGGElement 5.11.4 Interface SVGDefsElement 5.11.5 Interface SVGDescElement 5.11.6 Interface SVGTitleElement 5.11.7 Interface SVGSymbolElement 5.11.8 Interface SVGUseElement 5.11.9 Interface SVGElementInstance 5.11.10 Interface SVGElementInstanceList 5.11.11 Interface SVGImageElement 5.11.12 Interface SVGSwitchElement 5.11.13 Interface GetSVGDocument 6 Styling 6.1 SVG's styling properties 6.2 Usage scenarios for styling 6.3 Alternative ways to specify styling properties 6.4 Specifying properties using the presentation attributes 6.5 Styling with XSL 6.6 Styling with CSS 6.7 Case sensitivity of property names and values 6.8 Facilities from CSS and XSL used by SVG 6.9 Referencing external style sheets 6.10 The 憇tyle?element 6.11 The 慶lass?attribute 6.12 The 憇tyle?attribute 6.13 Specifying the default style sheet language 6.14 Property inheritance 6.15 The scope/range of styles 6.16 User agent style sheet 6.17 Aural style sheets 6.18 DOM interfaces 6.18.1 Interface SVGStyleElement 7 Coordinate Systems 7.1 Introduction 7.2 The initial viewport 7.3 The initial coordinate system 7.4 Coordinate system transformations 7.5 Nested transformations 7.6 The 憈ransform?attribute 7.7 The 憊iewBox?attribute 7.8 The 憄reserveAspectRatio?attribute 7.9 Establishing a new viewport 7.10 Units 7.11 Object bounding box units 7.12 Intrinsic sizing properties of the viewport of SVG content 7.13 Geographic coordinate systems 7.14 The 憇vg:transform?attribute 7.15 DOM interfaces 7.15.1 Interface SVGPoint 7.15.2 Interface SVGPointList 7.15.3 Interface SVGMatrix 7.15.4 Interface SVGTransform 7.15.5 Interface SVGTransformList 7.15.6 Interface SVGAnimatedTransformList 7.15.7 Interface SVGPreserveAspectRatio 7.15.8 Interface SVGAnimatedPreserveAspectRatio 8 Paths 8.1 Introduction 8.2 The 憄ath?element 8.3 Path data 8.3.1 General information about path data 8.3.2 The "moveto" commands 8.3.3 The "closepath" command 8.3.4 The "lineto" commands 8.3.5 The curve commands 8.3.6 The cubic B閦ier curve commands 8.3.7 The quadratic B閦ier curve commands 8.3.8 The elliptical arc curve commands 8.3.9 The grammar for path data 8.4 Distance along a path 8.5 DOM interfaces 8.5.1 Interface SVGPathSeg 8.5.2 Interface SVGPathSegClosePath 8.5.3 Interface SVGPathSegMovetoAbs 8.5.4 Interface SVGPathSegMovetoRel 8.5.5 Interface SVGPathSegLinetoAbs 8.5.6 Interface SVGPathSegLinetoRel 8.5.7 Interface SVGPathSegCurvetoCubicAbs 8.5.8 Interface SVGPathSegCurvetoCubicRel 8.5.9 Interface SVGPathSegCurvetoQuadraticAbs 8.5.10 Interface SVGPathSegCurvetoQuadraticRel 8.5.11 Interface SVGPathSegArcAbs 8.5.12 Interface SVGPathSegArcRel 8.5.13 Interface SVGPathSegLinetoHorizontalAbs 8.5.14 Interface SVGPathSegLinetoHorizontalRel 8.5.15 Interface SVGPathSegLinetoVerticalAbs 8.5.16 Interface SVGPathSegLinetoVerticalRel 8.5.17 Interface SVGPathSegCurvetoCubicSmoothAbs 8.5.18 Interface SVGPathSegCurvetoCubicSmoothRel 8.5.19 Interface SVGPathSegCurvetoQuadraticSmoothAbs 8.5.20 Interface SVGPathSegCurvetoQuadraticSmoothRel 8.5.21 Interface SVGPathSegList 8.5.22 Interface SVGAnimatedPathData 8.5.23 Interface SVGPathElement 9 Basic Shapes 9.1 Introduction 9.2 The 憆ect?element 9.3 The 慶ircle?element 9.4 The 慹llipse?element 9.5 The 憀ine?element 9.6 The 憄olyline?element 9.7 The 憄olygon?element 9.7.1 The grammar for points specifications in 憄olyline?and 憄olygon?elements 9.8 DOM interfaces 9.8.1 Interface SVGRectElement 9.8.2 Interface SVGCircleElement 9.8.3 Interface SVGEllipseElement 9.8.4 Interface SVGLineElement 9.8.5 Interface SVGAnimatedPoints 9.8.6 Interface SVGPolylineElement 9.8.7 Interface SVGPolygonElement 10 Text 10.1 Introduction 10.2 Characters and their corresponding glyphs 10.3 Fonts 10.4 The 憈ext?element 10.5 The 憈span?element 10.6 The 憈ref?element 10.7 Text layout 10.7.1 Text layout introduction 10.7.2 Setting the inline-progression-direction 10.7.3 Glyph orientation within a text run 10.7.4 Relationship with bidirectionality 10.8 Text rendering order 10.9 Alignment properties 10.9.1 Text alignment properties 10.9.2 Baseline alignment properties 10.10 Font selection properties 10.11 Spacing properties 10.12 Text decoration 10.13 Text on a path 10.13.1 Introduction to text on a path 10.13.2 The 憈extPath?element 10.13.3 Text on a path layout rules 10.14 Alternate glyphs 10.14.1 The 慳ltGlyph?element 10.14.2 The 慳ltGlyphDef? 慳ltGlyphItem?and 慻lyphRef?elements 10.15 White space handling 10.16 Text selection and clipboard operations 10.17 DOM interfaces 10.17.1 Interface SVGTextContentElement 10.17.2 Interface SVGTextPositioningElement 10.17.3 Interface SVGTextElement 10.17.4 Interface SVGTSpanElement 10.17.5 Interface SVGTRefElement 10.17.6 Interface SVGTextPathElement 10.17.7 Interface SVGAltGlyphElement 10.17.8 Interface SVGAltGlyphDefElement 10.17.9 Interface SVGAltGlyphItemElement 10.17.10 Interface SVGGlyphRefElement 11 Painting: Filling 11.1 Introduction 11.2 Specifying paint 11.3 Fill Properties 11.4 Stroke Properties 11.5 Controlling visibility 11.6 Markers 11.6.1 Introduction 11.6.2 The 憁arker?element 11.6.3 Marker properties 11.6.4 Details on how markers are rendered 11.7 Rendering properties 11.7.1 Color interpolation properties: 慶olor-interpolation?and 慶olor-interpolation-filters? 11.7.2 The 慶olor-rendering?property 11.7.3 The 憇hape-rendering?property 11.7.4 The 憈ext-rendering?property 11.7.5 The 慽mage-rendering?property 11.8 Inheritance of painting properties 11.9 DOM interfaces 11.9.1 Interface SVGPaint 11.9.2 Interface SVGMarkerElement 12 Color 12.1 Introduction 12.2 The 慶olor?property 12.3 Color profile descriptions 12.3.1 Overview of color profile descriptions 12.3.2 Alternative ways of defining a color profile description 12.3.3 The 慶olor-profile?element 12.3.4 The CSS @color-profile rule 12.3.5 The 慶olor-profile?property 12.4 DOM interfaces 12.4.1 Interface SVGColorProfileElement 12.4.2 Interface SVGColorProfileRule 13 Gradients and Patterns 13.1 Introduction 13.2 Gradients 13.2.1 Introduction 13.2.2 Linear gradients 13.2.3 Radial gradients 13.2.4 Gradient stops 13.3 Patterns 13.4 DOM interfaces 13.4.1 Interface SVGGradientElement 13.4.2 Interface SVGLinearGradientElement 13.4.3 Interface SVGRadialGradientElement 13.4.4 Interface SVGStopElement 13.4.5 Interface SVGPatternElement 14 Clipping 14.1 Introduction 14.2 Simple alpha compositing 14.3 Clipping paths 14.3.1 Introduction 14.3.2 The initial clipping path 14.3.3 The 憃verflow?and 慶lip?properties 14.3.4 Clip to viewport vs. clip to 憊iewBox? 14.3.5 Establishing a new clipping path: the 慶lipPath?element 14.3.6 Clipping paths 14.4 Masking 14.5 Object and group opacity: the 憃pacity?property 14.6 DOM interfaces 14.6.1 Interface SVGClipPathElement 14.6.2 Interface SVGMaskElement 15 Filter Effects 15.1 Introduction 15.2 An example 15.3 The 慺ilter?element 15.4 The 慺ilter?property 15.5 Filter effects region 15.6 Accessing the background image 15.7 Filter primitives overview 15.7.1 Overview 15.7.2 Common attributes 15.7.3 Filter primitive subregion 15.8 Light source elements and properties 15.8.1 Introduction 15.8.2 Light source 慺eDistantLight? 15.8.3 Light source 慺ePointLight? 15.8.4 Light source 慺eSpotLight? 15.8.5 The 憀ighting-color?property 15.9 Filter primitive 慺eBlend? 15.10 Filter primitive 慺eColorMatrix? 15.11 Filter primitive 慺eComponentTransfer? 15.12 Filter primitive 慺eComposite? 15.13 Filter primitive 慺eConvolveMatrix? 15.14 Filter primitive 慺eDiffuseLighting? 15.15 Filter primitive 慺eDisplacementMap? 15.16 Filter primitive 慺eFlood? 15.17 Filter primitive 慺eGaussianBlur? 15.18 Filter primitive 慺eImage? 15.19 Filter primitive 慺eMerge? 15.20 Filter primitive 慺eMorphology? 15.21 Filter primitive 慺eOffset? 15.22 Filter primitive 慺eSpecularLighting? 15.23 Filter primitive 慺eTile? 15.24 Filter primitive 慺eTurbulence? 15.25 DOM interfaces 15.25.1 Interface SVGFilterElement 15.25.2 Interface SVGFilterPrimitiveStandardAttributes 15.25.3 Interface SVGFEBlendElement 15.25.4 Interface SVGFEColorMatrixElement 15.25.5 Interface SVGFEComponentTransferElement 15.25.6 Interface SVGComponentTransferFunctionElement 15.25.7 Interface SVGFEFuncRElement 15.25.8 Interface SVGFEFuncGElement 15.25.9 Interface SVGFEFuncBElement 15.25.10 Interface SVGFEFuncAElement 15.25.11 Interface SVGFECompositeElement 15.25.12 Interface SVGFEConvolveMatrixElement 15.25.13 Interface SVGFEDiffuseLightingElement 15.25.14 Interface SVGFEDistantLightElement 15.25.15 Interface SVGFEPointLightElement 15.25.16 Interface SVGFESpotLightElement 15.25.17 Interface SVGFEDisplacementMapElement 15.25.18 Interface SVGFEFloodElement 15.25.19 Interface SVGFEGaussianBlurElement 15.25.20 Interface SVGFEImageElement 15.25.21 Interface SVGFEMergeElement 15.25.22 Interface SVGFEMergeNodeElement 15.25.23 Interface SVGFEMorphologyElement 15.25.24 Interface SVGFEOffsetElement 15.25.25 Interface SVGFESpecularLightingElement 15.25.26 Interface SVGFETileElement 15.25.27 Interface SVGFETurbulenceElement 16 Interactivity 16.1 Introduction 16.2 Complete list of supported events 16.3 User interface events 16.4 Pointer events 16.5 Hit-testing and processing order for user interface events 16.5.1 Hit-testing 16.5.2 Event processing 16.6 The 憄ointer-events?property 16.7 Magnification and panning 16.8 Cursors 16.8.1 Introduction to cursors 16.8.2 The 慶ursor?property 16.8.3 The 慶ursor?element 16.9 DOM interfaces 16.9.1 Interface SVGCursorElement 17 Linking 17.1 References 17.1.1 Overview 17.1.2 IRIs and URIs 17.1.3 Syntactic forms: IRI and FuncIRI 17.1.4 Processing of IRI references 17.1.5 IRI reference attributes 17.2 Links out of SVG content: the 慳?element 17.3 Linking into SVG content: IRI fragments and SVG views 17.3.1 Introduction: IRI fragments and SVG views 17.3.2 SVG fragment identifiers 17.3.3 Predefined views: the 憊iew?element 17.3.4 Highlighting views 17.4 DOM interfaces 17.4.1 Interface SVGAElement 17.4.2 Interface SVGViewElement 18 Scripting 18.1 Specifying the scripting language 18.1.1 Specifying the default scripting language 18.1.2 Local declaration of a scripting language 18.2 The 憇cript?element 18.3 Event handling 18.4 Event attributes 18.4.1 Event attribute for the SVGLoad event 18.4.2 Event attributes on graphics and container elements 18.4.3 Document-level event attributes 18.4.4 Animation event attributes 18.5 DOM interfaces 18.5.1 Interface SVGScriptElement 18.5.2 Interface SVGZoomEvent 19 Animation 19.1 Introduction 19.2 Animation elements 19.2.1 Overview 19.2.2 Relationship to SMIL Animation 19.2.3 Animation elements example 19.2.4 Attributes to identify the target element for an animation 19.2.5 Attributes to identify the target attribute or property for an animation 19.2.6 Animation with namespaces 19.2.7 Paced animation and complex types 19.2.8 Attributes to control the timing of the animation 19.2.8.1 Clock values 19.2.9 Attributes that define animation values over time 19.2.10 Attributes that control whether animations are additive 19.2.11 Inheritance 19.2.12 The 慳nimate?element 19.2.13 The 憇et?element 19.2.14 The 慳nimateMotion?element 19.2.15 The 慳nimateColor?element 19.2.16 The 慳nimateTransform?element 19.2.17 Elements 19.3 Animation using the SVG DOM 19.4 DOM interfaces 19.4.1 Interface ElementTimeControl 19.4.2 Interface TimeEvent 19.4.3 Interface SVGAnimationElement 19.4.4 Interface SVGAnimateElement 19.4.5 Interface SVGSetElement 19.4.6 Interface SVGAnimateMotionElement 19.4.7 Interface SVGMPathElement 19.4.8 Interface SVGAnimateColorElement 19.4.9 Interface SVGAnimateTransformElement 20 Fonts 20.1 Introduction 20.2 Overview of SVG fonts 20.3 The 慺ont?element 20.4 The 慻lyph?element 20.5 The 憁issing-glyph?element 20.6 Glyph selection rules 20.7 The 慼kern?and 憊kern?elements 20.8 Describing a font 20.8.1 Overview of font descriptions 20.8.2 Alternative ways for providing a font description 20.8.3 The 慺ont-face?element 20.8.4 The 慺ont-face-src?element 20.8.5 The 慺ont-face-uri?and 慺ont-face-format?elements 20.8.6 The 慺ont-face-name?element 20.9 DOM interfaces 20.9.1 Interface SVGFontElement 20.9.2 Interface SVGGlyphElement 20.9.3 Interface SVGMissingGlyphElement 20.9.4 Interface SVGHKernElement 20.9.5 Interface SVGVKernElement 20.9.6 Interface SVGFontFaceElement 20.9.7 Interface SVGFontFaceSrcElement 20.9.8 Interface SVGFontFaceUriElement 20.9.9 Interface SVGFontFaceFormatElement 20.9.10 Interface SVGFontFaceNameElement 21 Metadata 21.1 Introduction 21.2 The 憁etadata?element 21.3 An example 21.4 DOM interfaces 21.4.1 Interface SVGMetadataElement 22 Backwards Compatibility 23 Extensibility 23.1 Foreign namespaces and private data 23.2 Embedding foreign object types 23.3 The 慺oreignObject?element 23.4 An example 23.5 Adding private elements and attributes to the DTD 23.6 DOM interfaces 23.6.1 Interface SVGForeignObjectElement Appendix A: Document Type Definition A.1 Introduction A.2 Modularization A.2.1 Element and attribute collections A.2.2 Profiling the SVG specification A.2.3 Practical considerations A.3 SVG 1.1 module definitions and DTD implementations A.3.1 Modular Framework Module A.3.2 Datatypes Module A.3.3 Qualified Name Module A.3.4 Core Attribute Module A.3.5 Container Attribute Module A.3.6 Viewport Attribute Module A.3.7 Paint Attribute Module A.3.8 Basic Paint Attribute Module A.3.9 Paint Opacity Attribute Module A.3.10 Graphics Attribute Module A.3.11 Basic Graphics Attribute Module A.3.12 Document Events Attribute Module A.3.13 Graphical Element Events Attribute Module A.3.14 Animation Events Attribute Module A.3.15 XLink Attribute Module A.3.16 External Resources Attribute Module A.3.17 Structure Module A.3.18 Basic Structure Module A.3.19 Conditional Processing Module A.3.20 Image Module A.3.21 Style Module A.3.22 Shape Module A.3.23 Text Module A.3.24 Basic Text Module A.3.25 Marker Module A.3.26 Color Profile Module A.3.27 Gradient Module A.3.28 Pattern Module A.3.29 Clip Module A.3.30 Basic Clip Module A.3.31 Mask Module A.3.32 Filter Module A.3.33 Basic Filter Module A.3.34 Cursor Module A.3.35 Hyperlinking Module A.3.36 View Module A.3.37 Scripting Module A.3.38 Animation Module A.3.39 Font Module A.3.40 Basic Font Module A.3.41 Extensibility Module A.4 SVG 1.1 Document Type Definition A.4.1 SVG 1.1 DTD Driver A.4.2 SVG 1.1 Document Model A.4.3 SVG 1.1 Attribute Collection Appendix B: SVG Document Object Model (DOM) B.1 SVG DOM overview B.1.1 SVG DOM object initialization B.2 Elements in the SVG DOM B.3 Naming conventions B.4 Exception SVGException B.5 Feature strings for the hasFeature method call B.6 Relationship with DOM Level 2 Events B.7 Relationship with DOM Level 2 CSS B.7.1 Introduction B.7.2 User agents that do not support styling with CSS B.7.3 User agents that support styling with CSS B.7.4 Extended interfaces B.8 Read only nodes in the DOM B.9 Invalid values Appendix C: IDL Definitions Appendix D: Java Language Binding D.1 The Java language binding D.2 Using SVG with the Java language Appendix E: ECMAScript Language Binding E.1 Exceptions E.2 Constants E.3 Types E.4 Objects Appendix F: Implementation Requirements F.1 Introduction F.2 Error processing F.3 Version control F.4 Clamping values which are restricted to a particular range F.5 憄ath?element implementation notes F.6 Elliptical arc implementation notes F.6.1 Elliptical arc syntax F.6.2 Out-of-range parameters F.6.3 Parameterization alternatives F.6.4 Conversion from center to endpoint parameterization F.6.5 Conversion from endpoint to center parameterization F.6.6 Correction of out-of-range radii F.7 Text selection implementation notes F.8 Printing implementation notes Appendix G: Conformance Criteria G.1 Introduction G.2 Conforming SVG Document Fragments G.3 Conforming SVG Stand-Alone Files G.4 Conforming SVG Generators G.5 Conforming SVG Servers G.6 Conforming SVG DOM Subtree G.7 Conforming SVG Interpreters G.8 Conforming SVG Viewers Appendix H: Accessibility Support H.1 WAI Accessibility Guidelines H.2 SVG Content Accessibility Guidelines Appendix I: Internationalization Support I.1 Introduction I.2 Internationalization and SVG I.3 SVG Internationalization Guidelines Appendix J: Minimizing SVG File Sizes Appendix K: References K.1 Normative references K.2 Informative references Appendix L: Element Index Appendix M: Attribute Index M.1 Regular attributes M.2 Presentation attributes Appendix N: Property Index Appendix O: Feature Strings O.1 Introduction O.2 SVG 1.1 feature strings O.3 SVG 1.0 feature strings Appendix P: Media Type Registration for image/svg+xml P.1 Introduction P.2 Registration of media type image/svg+xml Appendix Q: Changes Check Update
テキスト

SVG 1.1 (Second Edition) – 16 August 2011Top ⋅ Contents ⋅ Previous ⋅ Next ⋅ Elements ⋅ Attributes ⋅ Properties

20 Fonts

Contents

  • 20.1 Introduction
  • 20.2 Overview of SVG fonts
  • 20.3 The ‘font’ element
  • 20.4 The ‘glyph’ element
  • 20.5 The ‘missing-glyph’ element
  • 20.6 Glyph selection rules
  • 20.7 The ‘hkern’ and ‘vkern’ elements
  • 20.8 Describing a font
    • 20.8.1 Overview of font descriptions
    • 20.8.2 Alternative ways for providing a font description
    • 20.8.3 The ‘font-face’ element
    • 20.8.4 The ‘font-face-src’ element
    • 20.8.5 The ‘font-face-uri’ and ‘font-face-format’ elements
    • 20.8.6 The ‘font-face-name’ element
  • 20.9 DOM interfaces
    • 20.9.1 Interface SVGFontElement
    • 20.9.2 Interface SVGGlyphElement
    • 20.9.3 Interface SVGMissingGlyphElement
    • 20.9.4 Interface SVGHKernElement
    • 20.9.5 Interface SVGVKernElement
    • 20.9.6 Interface SVGFontFaceElement
    • 20.9.7 Interface SVGFontFaceSrcElement
    • 20.9.8 Interface SVGFontFaceUriElement
    • 20.9.9 Interface SVGFontFaceFormatElement
    • 20.9.10 Interface SVGFontFaceNameElement

20.1 Introduction

Reliable delivery of fonts is a requirement for SVG. Designers need to create SVG content with arbitrary fonts and know that the same graphical result will appear when the content is viewed by all end users, even when end users do not have the necessary fonts installed on their computers. This parallels the print world, where the designer uses a given font when authoring a drawing for print, and the graphical content appears exactly the same in the printed version as it appeared on the designer's authoring system.

SVG utilizes the WebFonts facility defined in CSS2 ([CSS2], section 15.1) as a key mechanism for reliable delivery of font data to end users. In a common scenario, SVG authoring applications generate compressed, subsetted WebFonts for all text elements used by a given SVG document fragment. Typically, the WebFonts are saved in a location relative to the referencing document.

One disadvantage to the WebFont facility to date is that specifications such as CSS2 do not require support of particular font formats. The result is that different implementations support different Web font formats, thereby making it difficult for Web site creators to post a single Web site using WebFonts that work across all user agents.

To provide a common font format for SVG that is guaranteed to be supported by all conforming SVG viewers, SVG provides a facility to define fonts in SVG. This facility is called SVG fonts.

SVG fonts can improve the semantic richness of graphics that represent text. For example, many company logos consist of the company name drawn artistically. In some cases, accessibility may be enhanced by expressing the logo as a series of glyphs in an SVG font and then rendering the logo as a ‘text’ element which references this font.

20.2 Overview of SVG fonts

An SVG font is a font defined using SVG's ‘font’ element.

The purpose of SVG fonts is to allow for delivery of glyph outlines in display-only environments. SVG fonts that accompany Web pages must be supported only in browsing and viewing situations. Graphics editing applications or file translation tools must not attempt to convert SVG fonts into system fonts. The intent is that SVG files be interchangeable between two content creators, but not the SVG fonts that might accompany these SVG files. Instead, each content creator will need to license the given font before being able to successfully edit the SVG file. The ‘font-face-name’ element indicates the name of licensed font to use for editing.

SVG fonts contain unhinted font outlines. Because of this, on many implementations there will be limitations regarding the quality and legibility of text in small font sizes. For increased quality and legibility in small font sizes, content creators may want to use an alternate font technology, such as fonts that ship with operating systems or an alternate WebFont format.

Because SVG fonts are expressed using SVG elements and attributes, in some cases the SVG font will take up more space than if the font were expressed in a different WebFont format which was especially designed for compact expression of font data. For the fastest delivery of Web pages, content creators may want to use an alternate font technology.

A key value of SVG fonts is guaranteed availability in SVG user agents. In some situations, it might be appropriate for an SVG font to be the first choice for rendering some text. In other situations, the SVG font might be an alternate, back-up font in case the first choice font (perhaps a hinted system font) is not available to a given user.

The characteristics and attributes of SVG fonts correspond closely to the font characteristics and parameters described in the Fonts chapter of the Cascading Style Sheets (CSS) level 2 specification ([CSS2], chapter 15). In this model, various font metrics, such as advance values and baseline locations, and the glyph outlines themselves, are expressed in units that are relative to an abstract square whose height is the intended distance between lines of type in the same type size. This square is called the em square and it is the design grid on which the glyph outlines are defined. The value of the ‘units-per-em’ attribute on the ‘font-face’ element specifies how many units the em square is divided into. Common values for other font types are, for example, 250 (Intellifont), 1000 (Type 1) and 2048 (TrueType, TrueType GX and Open-Type). Unlike standard graphics in SVG, where the initial coordinate system has the y-axis pointing downward (see The initial coordinate system), the design grid for SVG fonts, along with the initial coordinate system for the glyphs, has the y-axis pointing upward for consistency with accepted industry practice for many popular font formats.

SVG fonts and their associated glyphs do not specify bounding box information. Because the glyph outlines are expressed as SVG graphics elements, the implementation has the option to render the glyphs either using standard graphics calls or by using special-purpose font rendering technology, in which case any necessary maximum bounding box and overhang calculations can be performed from analysis of the graphics elements contained within the glyph outlines.

An SVG font can be either embedded within the same document that uses the font or saved as part of an external resource.

Here is an example of how you might embed an SVG font inside of an SVG document.

<?xml version="1.0" standalone="yes"?>
<svg width="400px" height="300px" version="1.1"
  xmlns = 'http://www.w3.org/2000/svg'>
  <defs>
    <font id="Font1" horiz-adv-x="1000">
      <font-face font-family="Super Sans" font-weight="bold" font-style="normal"
          units-per-em="1000" cap-height="600" x-height="400"
          ascent="700" descent="300"
          alphabetic="0" mathematical="350" ideographic="400" hanging="500">
        <font-face-src>
          <font-face-name name="Super Sans Bold"/>
        </font-face-src>
      </font-face>
      <missing-glyph><path d="M0,0h200v200h-200z"/></missing-glyph>
      <glyph unicode="!" horiz-adv-x="300"><!-- Outline of exclam. pt. glyph --></glyph>
      <glyph unicode="@"><!-- Outline of @ glyph --></glyph>
      <!-- more glyphs -->
    </font>
  </defs>
  <text x="100" y="100" 
           style="font-family: 'Super Sans', Helvetica, sans-serif;
                  font-weight: bold; font-style: normal">Text 
    using embedded font</text>
</svg>

Here is an example of how you might use the CSS @font-face facility ([CSS2], section 15.3.1) to reference an SVG font which is saved in an external file. First referenced SVG font file:

<?xml version="1.0" standalone="yes"?>
<svg width="100%" height="100%" version="1.1"
 xmlns = 'http://www.w3.org/2000/svg'>
  <defs>
    <font id="Font2" horiz-adv-x="1000">
      <font-face font-family="Super Sans" font-weight="normal" font-style="italic"
          units-per-em="1000" cap-height="600" x-height="400"
          ascent="700" descent="300"
          alphabetic="0" mathematical="350" ideographic="400" hanging="500">
        <font-face-src>
          <font-face-name name="Super Sans Italic"/>
        </font-face-src>
      </font-face>
      <missing-glyph><path d="M0,0h200v200h-200z"/></missing-glyph>
      <glyph unicode="!" horiz-adv-x="300"><!-- Outline of exclam. pt. glyph --></glyph>
      <glyph unicode="@"><!-- Outline of @ glyph --></glyph>
      <!-- more glyphs -->
    </font>
  </defs>
</svg>

The SVG file which uses/references the above SVG font

<?xml version="1.0" standalone="yes"?>
<svg width="400px" height="300px" version="1.1"
 xmlns = 'http://www.w3.org/2000/svg'>  
  <defs>
    <style type="text/css">
      <![CDATA[
        @font-face {
          font-family: 'Super Sans'; 
          font-weight: normal;
          font-style: italic;
          src: url("myfont.svg#Font2") format("svg")
        }
      ]]>
   </style>
  </defs>
  <text x="100" y="100"
           style="font-family: 'Super Sans'; font-weight:normal;
                  font-style: italic">Text using referenced font</text>
</svg>

20.3 The ‘font’ element

The ‘font’ element defines an SVG font.

‘font’
Categories:
None
Content model:
Any number of the following elements, in any order:
  • descriptive elements‘desc’, ‘metadata’, ‘title’
  • ‘font-face’
  • ‘glyph’
  • ‘hkern’
  • ‘missing-glyph’
  • ‘vkern’
Attributes:
  • core attributes‘id’, ‘xml:base’, ‘xml:lang’, ‘xml:space’
  • presentation attributes‘alignment-baseline’, ‘baseline-shift’, ‘clip’, ‘clip-path’, ‘clip-rule’, ‘color’, ‘color-interpolation’, ‘color-interpolation-filters’, ‘color-profile’, ‘color-rendering’, ‘cursor’, ‘direction’, ‘display’, ‘dominant-baseline’, ‘enable-background’, ‘fill’, ‘fill-opacity’, ‘fill-rule’, ‘filter’, ‘flood-color’, ‘flood-opacity’, ‘font-family’, ‘font-size’, ‘font-size-adjust’, ‘font-stretch’, ‘font-style’, ‘font-variant’, ‘font-weight’, ‘glyph-orientation-horizontal’, ‘glyph-orientation-vertical’, ‘image-rendering’, ‘kerning’, ‘letter-spacing’, ‘lighting-color’, ‘marker-end’, ‘marker-mid’, ‘marker-start’, ‘mask’, ‘opacity’, ‘overflow’, ‘pointer-events’, ‘shape-rendering’, ‘stop-color’, ‘stop-opacity’, ‘stroke’, ‘stroke-dasharray’, ‘stroke-dashoffset’, ‘stroke-linecap’, ‘stroke-linejoin’, ‘stroke-miterlimit’, ‘stroke-opacity’, ‘stroke-width’, ‘text-anchor’, ‘text-decoration’, ‘text-rendering’, ‘unicode-bidi’, ‘visibility’, ‘word-spacing’, ‘writing-mode’
  • ‘class’
  • ‘style’
  • ‘externalResourcesRequired’
  • ‘horiz-origin-x’
  • ‘horiz-origin-y’
  • ‘horiz-adv-x’
  • ‘vert-origin-x’
  • ‘vert-origin-y’
  • ‘vert-adv-y’
DOM Interfaces:
  • SVGFontElement

Attribute definitions:

horiz-origin-x = "<number>"
The X-coordinate in the font coordinate system of the origin of a glyph to be used when drawing horizontally oriented text. (Note that the origin applies to all glyphs in the font.)
If the attribute is not specified, the effect is as if a value of '0' were specified.
Animatable: no.
horiz-origin-y = "<number>"
The Y-coordinate in the font coordinate system of the origin of a glyph to be used when drawing horizontally oriented text. (Note that the origin applies to all glyphs in the font.)
If the attribute is not specified, the effect is as if a value of '0' were specified.
Animatable: no.
horiz-adv-x = "<number>"
The default horizontal advance after rendering a glyph in horizontal orientation. Glyph widths are required to be non-negative, even if the glyph is typically rendered right-to-left, as in Hebrew and Arabic scripts.
Animatable: no.
vert-origin-x = "<number>"
The default X-coordinate in the font coordinate system of the origin of a glyph to be used when drawing vertically oriented text.
If the attribute is not specified, the effect is as if the attribute were set to half of the effective value of attribute ‘horiz-adv-x’.
Animatable: no.
vert-origin-y = "<number>"
The default Y-coordinate in the font coordinate system of the origin of a glyph to be used when drawing vertically oriented text.
If the attribute is not specified, the effect is as if the attribute were set to the position specified by the font's ‘ascent’ attribute.
Animatable: no.
vert-adv-y = "<number>"
The default vertical advance after rendering a glyph in vertical orientation.
If the attribute is not specified, the effect is as if a value equivalent of one em were specified (see ‘units-per-em’).
Animatable: no.

Each ‘font’ element must have a ‘font-face’ child element which describes various characteristics of the font.

20.4 The ‘glyph’ element

The ‘glyph’ element defines the graphics for a given glyph. The coordinate system for the glyph is defined by the various attributes in the ‘font’ element.

The graphics that make up the ‘glyph’ can be a single path data specification within the ‘d’ attribute, arbitrary SVG as content within the ‘glyph’, or both. These two alternatives are processed differently (see below).

‘glyph’
Categories:
Container element
Content model:
Any number of the following elements, in any order:
  • animation elements‘animate’, ‘animateColor’, ‘animateMotion’, ‘animateTransform’, ‘set’
  • descriptive elements‘desc’, ‘metadata’, ‘title’
  • shape elements‘circle’, ‘ellipse’, ‘line’, ‘path’, ‘polygon’, ‘polyline’, ‘rect’
  • structural elements‘defs’, ‘g’, ‘svg’, ‘symbol’, ‘use’
  • gradient elements‘linearGradient’, ‘radialGradient’
  • ‘a’
  • ‘altGlyphDef’
  • ‘clipPath’
  • ‘color-profile’
  • ‘cursor’
  • ‘filter’
  • ‘font’
  • ‘font-face’
  • ‘foreignObject’
  • ‘image’
  • ‘marker’
  • ‘mask’
  • ‘pattern’
  • ‘script’
  • ‘style’
  • ‘switch’
  • ‘text’
  • ‘view’
Attributes:
  • core attributes‘id’, ‘xml:base’, ‘xml:lang’, ‘xml:space’
  • presentation attributes‘alignment-baseline’, ‘baseline-shift’, ‘clip’, ‘clip-path’, ‘clip-rule’, ‘color’, ‘color-interpolation’, ‘color-interpolation-filters’, ‘color-profile’, ‘color-rendering’, ‘cursor’, ‘direction’, ‘display’, ‘dominant-baseline’, ‘enable-background’, ‘fill’, ‘fill-opacity’, ‘fill-rule’, ‘filter’, ‘flood-color’, ‘flood-opacity’, ‘font-family’, ‘font-size’, ‘font-size-adjust’, ‘font-stretch’, ‘font-style’, ‘font-variant’, ‘font-weight’, ‘glyph-orientation-horizontal’, ‘glyph-orientation-vertical’, ‘image-rendering’, ‘kerning’, ‘letter-spacing’, ‘lighting-color’, ‘marker-end’, ‘marker-mid’, ‘marker-start’, ‘mask’, ‘opacity’, ‘overflow’, ‘pointer-events’, ‘shape-rendering’, ‘stop-color’, ‘stop-opacity’, ‘stroke’, ‘stroke-dasharray’, ‘stroke-dashoffset’, ‘stroke-linecap’, ‘stroke-linejoin’, ‘stroke-miterlimit’, ‘stroke-opacity’, ‘stroke-width’, ‘text-anchor’, ‘text-decoration’, ‘text-rendering’, ‘unicode-bidi’, ‘visibility’, ‘word-spacing’, ‘writing-mode’
  • ‘class’
  • ‘style’
  • ‘d’
  • ‘horiz-adv-x’
  • ‘vert-origin-x’
  • ‘vert-origin-y’
  • ‘vert-adv-y’
  • ‘unicode’
  • ‘glyph-name’
  • ‘orientation’
  • ‘arabic-form’
  • ‘lang’
DOM Interfaces:
  • SVGGlyphElement

Attribute definitions:

unicode = "<string>"
One or more Unicode characters indicating the sequence of Unicode characters which corresponds to this glyph. If a character is provided, then this glyph corresponds to the given Unicode character. If multiple characters are provided, then this glyph corresponds to the given sequence of Unicode characters. One use of a sequence of characters is ligatures. For example, if unicode="ffl", then the given glyph will be used to render the sequence of characters "f", "f", and "l".

It is often useful to refer to characters using XML character references expressed in hexadecimal notation or decimal notation. For example, unicode="ffl" could be expressed as XML character references in hexadecimal notation as unicode="&#x66;&#x66;&#x6c;" or in decimal notation as unicode="&#102;&#102;&#108;".

The ‘unicode’ attribute contributes to the process for deciding which glyph(s) are used to represent which character(s). See glyph selection rules. If the ‘unicode’ attribute is not provided for a given ‘glyph’, then the only way to use this glyph is via an ‘altGlyph’ reference.
Animatable: no.
glyph-name = "<name> [, <name> ]* "
A name for the glyph. It is recommended that glyph names be unique within a font. The glyph names can be used in situations where Unicode character numbers do not provide sufficient information to access the correct glyph, such as when there are multiple glyphs per Unicode character. The glyph names can be referenced in kerning definitions.
Animatable: no.
d = "path data"
The definition of the outline of a glyph, using the same syntax as for the ‘d’ attribute on a ‘path’ element. See Path data.
See below for a discussion of this attribute.
Animatable: no.
orientation = "h | v"
Indicates that the given glyph is only to be used for a particular inline-progression-direction (i.e., horizontal or vertical). If the attribute is not specified, then the glyph can be used in all cases (i.e., both horizontal and vertical inline-progression-direction).
Animatable: no.
arabic-form = "initial | medial | terminal | isolated"
For Arabic glyphs, indicates which of the four possible forms this glyph represents.
Animatable: no.
lang = "%LanguageCodes;"
The attribute value is a comma-separated list of language names as defined in BCP 47 [BCP47]. The glyph can be used if the ‘xml:lang’ attribute exactly matches one of the languages given in the value of this parameter, or if the ‘xml:lang’ attribute exactly equals a prefix of one of the languages given in the value of this parameter such that the first tag character following the prefix is "-".
Animatable: no.
horiz-adv-x = "<number>"
The horizontal advance after rendering the glyph in horizontal orientation. If the attribute is not specified, the effect is as if the attribute were set to the value of the font's ‘horiz-adv-x’ attribute.
Glyph widths are required to be non-negative, even if the glyph is typically rendered right-to-left, as in Hebrew and Arabic scripts.
Animatable: no.
vert-origin-x = "<number>"
The X-coordinate in the font coordinate system of the origin of the glyph to be used when drawing vertically oriented text.
If the attribute is not specified, the effect is as if the attribute were set to the value of the font's ‘vert-origin-x’ attribute.
Animatable: no.
vert-origin-y = "<number>"
The Y-coordinate in the font coordinate system of the origin of a glyph to be used when drawing vertically oriented text.
If the attribute is not specified, the effect is as if the attribute were set to the value of the font's ‘vert-origin-y’ attribute.
Animatable: no.
vert-adv-y = "<number>"
The vertical advance after rendering a glyph in vertical orientation.
If the attribute is not specified, the effect is as if the attribute were set to the value of the font's ‘vert-adv-y’ attribute.
Animatable: no.

The graphics for the ‘glyph’ can be specified using either the ‘d’ attribute or arbitrary SVG as content within the ‘glyph’.

If the ‘d’ attribute is specified, then the path data within this attribute is processed as follows:

  • Any relative coordinates within the path data specification are converted into equivalent absolute coordinates
  • Each of these absolute coordinates is transformed from the font coordinate system into the ‘text’ element's current coordinate system such that the origin of the font coordinate system is properly positioned and rotated to align with the current text position and orientation for the glyph, and scaled so that the correct ‘font-size’ is achieved.
  • The resulting, transformed path specification is rendered as if it were a ‘path’ element, using the styling properties that apply to the characters which correspond to the given glyph, and ignoring any styling properties specified on the ‘font’ element or the ‘glyph’ element.

If the ‘glyph’ has child elements, then those child elements are rendered in a manner similar to how the ‘use’ element renders a referenced symbol. The rendering effect is as if the contents of the referenced ‘glyph’ element were deeply cloned into a separate non-exposed DOM tree. Because the cloned DOM tree is non-exposed, the SVG DOM does not show the cloned instance.

For user agents that support Styling with CSS, the conceptual deep cloning of the referenced ‘glyph’ element into a non-exposed DOM tree also copies any property values resulting from the CSS cascade ([CSS2], chapter 6) on the referenced ‘glyph’ and its contents, and also applies any property values on the ‘font’ element. CSS2 selectors can be applied to the original (i.e., referenced) elements because they are part of the formal document structure. CSS2 selectors cannot be applied to the (conceptually) cloned DOM tree because its contents are not part of the formal document structure.

Property inheritance, however, works as if the referenced ‘glyph’ had been textually included as a deeply cloned child within the document tree. The referenced ‘glyph’ inherits properties from the element that contains the characters that correspond to the ‘glyph’. The ‘glyph’ does not inherit properties from the ‘font’ element's original parents.

In the generated content, for each instance of a given ‘glyph’, a ‘g’ is created which carries with it all property values resulting from the CSS cascade on the ‘font’ element for the referenced ‘glyph’. Within this ‘g’ is another ‘g’ which carries with it all property values resulting from the CSS cascade on the ‘glyph’ element. The original contents of the ‘glyph’ element are deep-cloned within the inner ‘g’ element.

If the ‘glyph’ has both a ‘d’ attribute and child elements, the ‘d’ attribute is rendered first, and then the child elements.

In general, the ‘d’ attribute renders in the same manner as system fonts. For example, a dashed pattern will usually look the same if applied to a system font or to an SVG font which defines its glyphs using the ‘d’ attribute. Many implementations will be able to render glyphs defined with the ‘d’ attribute quickly and will be able to use a font cache for further performance gains.

Defining a glyph by including child elements within the ‘glyph’ gives greater flexibility but more complexity. Different fill and stroke techniques can be used on different parts of the glyphs. For example, the base of an "i" could be red, and the dot could be blue. This approach has an inherent complexity with units. Any properties specified on a text elements which represents a length, such as the ‘stroke-width’ property, might produce surprising results since the length value will be processed in the coordinate system of the glyph.

20.5 The ‘missing-glyph’ element

The ‘missing-glyph’ element defines the graphics to use if there is an attempt to draw a glyph from a given font and the given glyph has not been defined. The attributes on the ‘missing-glyph’ element have the same meaning as the corresponding attributes on the ‘glyph’ element.

‘missing-glyph’
Categories:
Container element
Content model:
Any number of the following elements, in any order:
  • animation elements‘animate’, ‘animateColor’, ‘animateMotion’, ‘animateTransform’, ‘set’
  • descriptive elements‘desc’, ‘metadata’, ‘title’
  • shape elements‘circle’, ‘ellipse’, ‘line’, ‘path’, ‘polygon’, ‘polyline’, ‘rect’
  • structural elements‘defs’, ‘g’, ‘svg’, ‘symbol’, ‘use’
  • gradient elements‘linearGradient’, ‘radialGradient’
  • ‘a’
  • ‘altGlyphDef’
  • ‘clipPath’
  • ‘color-profile’
  • ‘cursor’
  • ‘filter’
  • ‘font’
  • ‘font-face’
  • ‘foreignObject’
  • ‘image’
  • ‘marker’
  • ‘mask’
  • ‘pattern’
  • ‘script’
  • ‘style’
  • ‘switch’
  • ‘text’
  • ‘view’
Attributes:
  • core attributes‘id’, ‘xml:base’, ‘xml:lang’, ‘xml:space’
  • presentation attributes‘alignment-baseline’, ‘baseline-shift’, ‘clip’, ‘clip-path’, ‘clip-rule’, ‘color’, ‘color-interpolation’, ‘color-interpolation-filters’, ‘color-profile’, ‘color-rendering’, ‘cursor’, ‘direction’, ‘display’, ‘dominant-baseline’, ‘enable-background’, ‘fill’, ‘fill-opacity’, ‘fill-rule’, ‘filter’, ‘flood-color’, ‘flood-opacity’, ‘font-family’, ‘font-size’, ‘font-size-adjust’, ‘font-stretch’, ‘font-style’, ‘font-variant’, ‘font-weight’, ‘glyph-orientation-horizontal’, ‘glyph-orientation-vertical’, ‘image-rendering’, ‘kerning’, ‘letter-spacing’, ‘lighting-color’, ‘marker-end’, ‘marker-mid’, ‘marker-start’, ‘mask’, ‘opacity’, ‘overflow’, ‘pointer-events’, ‘shape-rendering’, ‘stop-color’, ‘stop-opacity’, ‘stroke’, ‘stroke-dasharray’, ‘stroke-dashoffset’, ‘stroke-linecap’, ‘stroke-linejoin’, ‘stroke-miterlimit’, ‘stroke-opacity’, ‘stroke-width’, ‘text-anchor’, ‘text-decoration’, ‘text-rendering’, ‘unicode-bidi’, ‘visibility’, ‘word-spacing’, ‘writing-mode’
  • ‘class’
  • ‘style’
  • ‘d’
  • ‘horiz-adv-x’
  • ‘vert-origin-x’
  • ‘vert-origin-y’
  • ‘vert-adv-y’
DOM Interfaces:
  • SVGMissingGlyphElement

20.6 Glyph selection rules

When determining the glyph(s) to draw a given character sequence, the ‘font’ element is searched from its first ‘glyph’ element to its last in logical order to see if the upcoming sequence of Unicode characters to be rendered matches the sequence of Unicode characters specified in the ‘unicode’ attribute for the given ‘glyph’ element. The first successful match is used. Thus, the "ffl" ligature needs to be defined in the font before the "f" glyph; otherwise, the "ffl" will never be selected.

Note that any occurrences of ‘altGlyph’ take precedence over the above glyph selection rules within an SVG font.

20.7 The ‘hkern’ and ‘vkern’ elements

The ‘hkern’ and ‘vkern’ elements define kerning pairs for horizontally-oriented and vertically-oriented pairs of glyphs, respectively.

Kern pairs identify pairs of glyphs within a single font whose inter-glyph spacing is adjusted when the pair of glyphs are rendered next to each other. In addition to the requirement that the pair of glyphs are from the same font, SVG font kerning happens only when the two glyphs correspond to characters which have the same values for properties ‘font-family’, ‘font-size’, ‘font-style’, ‘font-weight’, ‘font-variant’, ‘font-stretch’, ‘font-size-adjust’ and ‘font’.

An example of a kerning pair are the letters "Va", where the typographic result might look better if the letters "V" and the "a" were rendered slightly closer together.

Right-to-left and bidirectional text in SVG is laid out in a two-step process, which is described in Relationship with bidirectionality. If SVG fonts are used, before kerning is applied, characters are re-ordered into left-to-right (or top-to-bottom, for vertical text) visual rendering order. Kerning from SVG fonts is then applied on pairs of glyphs which are rendered contiguously. The first glyph in the kerning pair is the left (or top) glyph in visual rendering order. The second glyph in the kerning pair is the right (or bottom) glyph in the pair.

For convenience to font designers and to minimize file sizes, a single ‘hkern’ and ‘vkern’ can define a single kerning adjustment value between one set of glyphs (e.g., a range of Unicode characters) and another set of glyphs (e.g., another range of Unicode characters).

The ‘hkern’ element defines kerning pairs and adjustment values in the horizontal advance value when drawing pairs of glyphs which the two glyphs are contiguous and are both rendered horizontally (i.e., side-by-side). The spacing between characters is reduced by the kerning adjustment. (Negative kerning adjustments increase the spacing between characters.)

The ‘vkern’ element defines kerning pairs and adjustment values in the vertical advance value when drawing pairs of glyphs together when stacked vertically. The spacing between characters is reduced by the kerning adjustment.

‘hkern’
Categories:
None
Content model:
Empty.
Attributes:
  • core attributes‘id’, ‘xml:base’, ‘xml:lang’, ‘xml:space’
  • ‘u1’
  • ‘g1’
  • ‘u2’
  • ‘g2’
  • ‘k’
DOM Interfaces:
  • SVGHKernElement
‘vkern’
Categories:
None
Content model:
Empty.
Attributes:
  • core attributes‘id’, ‘xml:base’, ‘xml:lang’, ‘xml:space’
  • ‘u1’
  • ‘g1’
  • ‘u2’
  • ‘g2’
  • ‘k’
DOM Interfaces:
  • SVGVKernElement

Attribute definitions:

u1 = "[<character> | <urange> ] [, [<character> | <urange>] ]* "
A sequence (comma-separated) of Unicode characters (refer to the description of the ‘unicode’ attribute to the ‘glyph’ element for a description of how to express individual Unicode characters) and/or ranges of Unicode characters (see description of ranges of Unicode characters in CSS2; [CSS2], section 15.3.3) which identify a set of possible first glyphs in the kerning pair. If a given Unicode character within the set has multiple corresponding ‘glyph’ elements (i.e., there are multiple ‘glyph’ elements with the same ‘unicode’ attribute value, but different ‘glyph-name’ values), then all such glyphs are included in the set. Comma is the separator character; thus, to kern a comma, specify the comma as part of a range of Unicode characters or as a glyph name using the ‘g1’ attribute. The total set of possible first glyphs in the kerning pair is the union of glyphs specified by the ‘u1’ and ‘g1’ attributes.
Animatable: no.
g1 = "<name> [, <name> ]* "
A sequence (comma-separated) of glyph names (i.e., values that match ‘glyph-name’ attributes on ‘glyph’ elements) which identify a set of possible first glyphs in the kerning pair. All glyphs with the given glyph name are included in the set. The total set of possible first glyphs in the kerning pair is the union of glyphs specified by the ‘u1’ and ‘g1’ attributes.
Animatable: no.
u2 = "[<character> | <urange>] [, [<character> | <urange>] ]* "
Same as the ‘u1’ attribute, except that ‘u2’ specifies possible second glyphs in the kerning pair.
Animatable: no.
g2 = "<name> [, <name> ]* "
Same as the ‘g1’ attribute, except that ‘g2’ specifies possible second glyphs in the kerning pair.
Animatable: no.
k = "<number>"
The amount to decrease the spacing between the two glyphs in the kerning pair. The value is in the font coordinate system. This attribute is required.
Animatable: no.

At least one each of ‘u1’ or ‘g1’ and at least one of ‘u2’ or ‘g2’ must be provided.

20.8 Describing a font

20.8.1 Overview of font descriptions

A font description provides the bridge between an author's font specification and the font data, which is the data needed to format text and to render the abstract glyphs to which the characters map — the actual scalable outlines or bitmaps. Fonts are referenced by properties, such as the ‘font-family’ property.

Each specified font description is added to the font database and so that it can be used to select the relevant font data. The font description contains descriptors such as the location of the font data on the Web, and characterizations of that font data. The font descriptors are also needed to match the font properties to particular font data. The level of detail of a font description can vary from just the name of the font up to a list of glyph widths.

For more about font descriptions, refer to the Fonts chapter in the CSS2 specification ([CSS2], chapter 15).

20.8.2 Alternative ways for providing a font description

Font descriptions can be specified in either of the following ways:

  • a ‘font-face’ element
  • an @font-face rule ([CSS2], section 15.3.1) within a CSS style sheet (only applicable for user agents which support using CSS to style the SVG content)

20.8.3 The ‘font-face’ element

The ‘font-face’ element corresponds directly to the @font-face facility in CSS2 ([CSS2], section 15.3.1). It can be used to describe the characteristics of any font, SVG font or otherwise.

When used to describe the characteristics of an SVG font contained within the same document, it is recommended that the ‘font-face’ element be a child of the ‘font’ element it is describing so that the ‘font’ element can be self-contained and fully-described. In this case, any ‘font-face-src’ elements within the ‘font-face’ element are ignored as it is assumed that the ‘font-face’ element is describing the characteristics of its parent ‘font’ element.

‘font-face’
Categories:
None
Content model:
Any number of descriptive elements and at most one ‘font-face-src’ element, in any order.
Attributes:
  • core attributes‘id’, ‘xml:base’, ‘xml:lang’, ‘xml:space’
  • ‘font-family’
  • ‘font-style’
  • ‘font-variant’
  • ‘font-weight’
  • ‘font-stretch’
  • ‘font-size’
  • ‘unicode-range’
  • ‘units-per-em’
  • ‘panose-1’
  • ‘stemv’
  • ‘stemh’
  • ‘slope’
  • ‘cap-height’
  • ‘x-height’
  • ‘accent-height’
  • ‘ascent’
  • ‘descent’
  • ‘widths’
  • ‘bbox’
  • ‘ideographic’
  • ‘alphabetic’
  • ‘mathematical’
  • ‘hanging’
  • ‘v-ideographic’
  • ‘v-alphabetic’
  • ‘v-mathematical’
  • ‘v-hanging’
  • ‘underline-position’
  • ‘underline-thickness’
  • ‘strikethrough-position’
  • ‘strikethrough-thickness’
  • ‘overline-position’
  • ‘overline-thickness’
DOM Interfaces:
  • SVGFontFaceElement

Attribute definitions:

font-family = "<string>"
Same syntax and semantics as the ‘font-family’ descriptor within an @font-face rule.
Animatable: no.
font-style = "all | [ normal | italic | oblique] [, [normal | italic | oblique]]*"
Same syntax and semantics as the ‘font-style’ descriptor within an @font-face rule. The style of a font. Takes on the same values as the ‘font-style’ property, except that a comma-separated list is permitted.
If the attribute is not specified, the effect is as if a value of 'all' were specified.
Animatable: no.
font-variant = "[normal | small-caps] [,[normal | small-caps]]*"
Same syntax and semantics as the ‘font-variant’ descriptor within an @font-face rule. Indication of whether this face is the small-caps variant of a font. Takes on the same values as the ‘font-variant’ property, except that a comma-separated list is permitted.
If the attribute is not specified, the effect is as if a value of 'normal' were specified.
Animatable: no.
font-weight = "all | [normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900] [, [normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900]]*"
Same syntax and semantics as the ‘font-weight’ descriptor within an @font-face rule.
The weight of a face relative to others in the same font family. Takes on the same values as the ‘font-weight’ property with three exceptions:
  • relative keywords (bolder, lighter) are not permitted
  • a comma-separated list of values is permitted, for fonts that contain multiple weights
  • an additional keyword, 'all', is permitted, which means that the font will match for all possible weights; either because it contains multiple weights, or because that face only has a single weight.
If the attribute is not specified, the effect is as if a value of 'all' were specified.
Animatable: no.
font-stretch = "all | [ normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded] [, [ normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded] ]*"
Same syntax and semantics as the ‘font-stretch’ descriptor within an @font-face rule. Indication of the condensed or expanded nature of the face relative to others in the same font family. Takes on the same values as the ‘font-stretch’ property except that:
  • relative keywords (wider, narrower) are not permitted
  • a comma-separated list is permitted
  • the keyword 'all' is permitted
If the attribute is not specified, the effect is as if a value of 'normal' were specified.
Animatable: no.
font-size = "<string>"
Same syntax and semantics as the ‘font-size’ descriptor within an @font-face rule.
Animatable: no.
unicode-range = "<urange> [, <urange>]*"
Same syntax and semantics as the ‘unicode-range’ descriptor within an @font-face rule. The range of ISO 10646 characters [UNICODE] possibly covered by the glyphs in the font. Except for any additional information provided in this specification, the normative definition of the attribute is in CSS2 ([CSS2], section 15.3.3).
If the attribute is not specified, the effect is as if a value of 'U+0-10FFFF' were specified.
Animatable: no.
units-per-em = "<number>"
Same syntax and semantics as the ‘units-per-em’ descriptor within an @font-face rule. The number of coordinate units on the em square, the size of the design grid on which glyphs are laid out.
This value is almost always necessary as nearly every other attribute requires the definition of a design grid.
If the attribute is not specified, the effect is as if a value of '1000' were specified.
Animatable: no.
panose-1 = "[<integer>]{10}"
Same syntax and semantics as the ‘panose-1’ descriptor within an @font-face rule. The Panose-1 number, consisting of ten decimal integers, separated by whitespace. Except for any additional information provided in this specification, the normative definition of the attribute is in CSS2 ([CSS2], section 15.3.6).
If the attribute is not specified, the effect is as if a value of '0 0 0 0 0 0 0 0 0 0' were specified.
Animatable: no.
stemv = "<number>"
Same syntax and semantics as the ‘stemv’ descriptor within an @font-face rule.
Animatable: no.
stemh = "<number>"
Same syntax and semantics as the ‘stemh’ descriptor within an @font-face rule.
Animatable: no.
slope = "<number>"
Same syntax and semantics as the ‘slope’ descriptor within an @font-face rule. The vertical stroke angle of the font. Except for any additional information provided in this specification, the normative definition of the attribute is in CSS2 ([CSS2], section 15.3.6).
If the attribute is not specified, the effect is as if a value of '0' were specified.
Animatable: no.
cap-height = "<number>"
Same syntax and semantics as the ‘cap-height’ descriptor within an @font-face rule. The height of uppercase glyphs in the font within the font coordinate system.
Animatable: no.
x-height = "<number>"
Same syntax and semantics as the ‘x-height’ descriptor within an @font-face rule. The height of lowercase glyphs in the font within the font coordinate system.
Animatable: no.
accent-height = "<number>"
The distance from the origin to the top of accent characters, measured by a distance within the font coordinate system.
If the attribute is not specified, the effect is as if the attribute were set to the value of the ‘ascent’ attribute.
Animatable: no.
ascent = "<number>"
Same syntax and semantics as the ‘ascent’ descriptor within an @font-face rule. The maximum unaccented height of the font within the font coordinate system.
If the attribute is not specified, the effect is as if the attribute were set to the difference between the ‘units-per-em’ value and the ‘vert-origin-y’ value for the corresponding font.
Animatable: no.
descent = "<number>"
Same syntax and semantics as the ‘descent’ descriptor within an @font-face rule. The maximum unaccented depth of the font within the font coordinate system.
If the attribute is not specified, the effect is as if the attribute were set to the ‘vert-origin-y’ value for the corresponding font.
Animatable: no.
widths = "<string>"
Same syntax and semantics as the ‘widths’ descriptor within an @font-face rule.
Animatable: no.
bbox = "<string>"
Same syntax and semantics as the ‘bbox’ descriptor within an @font-face rule.
Animatable: no.
ideographic = "<number>"
For horizontally oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve ideographic baseline alignment. The value is an offset in the font coordinate system.
Animatable: no.
alphabetic = "<number>"
Same syntax and semantics as the ‘baseline’ descriptor within an @font-face rule. For horizontally oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve alphabetic baseline alignment. The value is an offset in the font coordinate system.
Animatable: no.
mathematical = "<number>"
Same syntax and semantics as the ‘mathline’ descriptor within an @font-face rule. For horizontally oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve mathematical baseline alignment. The value is an offset in the font coordinate system.
Animatable: no.
hanging = "<number>"
For horizontally oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve hanging baseline alignment. The value is an offset in the font coordinate system.
Animatable: no.
v-ideographic = "<number>"
For vertically oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve ideographic baseline alignment. The value is an offset in the font coordinate system relative to the glyph-specific ‘vert-origin-x’ attribute.
Animatable: no.
v-alphabetic = "<number>"
For vertically oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve alphabetic baseline alignment. The value is an offset in the font coordinate system relative to the glyph-specific ‘vert-origin-x’ attribute.
Animatable: no.
v-mathematical = "<number>"
For vertically oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve mathematical baseline alignment. The value is an offset in the font coordinate system relative to the glyph-specific ‘vert-origin-x’ attribute.
Animatable: no.
v-hanging = "<number>"
For vertically oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve hanging baseline alignment. The value is an offset in the font coordinate system relative to the glyph-specific ‘vert-origin-x’ attribute.
Animatable: no.
underline-position = "<number>"
The ideal position of an underline within the font coordinate system.
Animatable: no.
underline-thickness = "<number>"
The ideal thickness of an underline, expressed as a length within the font coordinate system.
Animatable: no.
strikethrough-position = "<number>"
The ideal position of a strike-through within the font coordinate system.
Animatable: no.
strikethrough-thickness = "<number>"
The ideal thickness of a strike-through, expressed as a length within the font coordinate system.
Animatable: no.
overline-position = "<number>"
The ideal position of an overline within the font coordinate system.
Animatable: no.
overline-thickness = "<number>"
The ideal thickness of an overline, expressed as a length within the font coordinate system.
Animatable: no.

The following elements and attributes correspond to the ‘src’ descriptor within an @font-face rule. (Refer to the descriptions of the @font-face rule and 'src' descriptor in the CSS2 specification ([CSS2], sections 15.3.1 and 15.3.5.)

20.8.4 The ‘font-face-src’ element

The ‘font-face-src’ element, together with the ‘font-face-uri’ and ‘font-face-format’ elements described in the following sections, correspond to the ‘src’ descriptor within an @font-face rule. (Refer to the descriptions of the @font-face rule and 'src' descriptor in the CSS2 specification ([CSS2], sections 15.3.1 and 15.3.5).

A ‘font-face-src’ element contains ‘font-face-uri’ and ‘font-face-name’ elements, which are used for referencing external and local fonts, respectively.

‘font-face-src’
Categories:
None
Content model:
One or more of the following elements, in any order:
  • ‘font-face-name’
  • ‘font-face-uri’
Attributes:
  • core attributes‘id’, ‘xml:base’, ‘xml:lang’, ‘xml:space’
DOM Interfaces:
  • SVGFontFaceSrcElement

20.8.5 The ‘font-face-uri’ and ‘font-face-format’ elements

The ‘font-face-uri’ element is used within a ‘font-face-src’ element to reference a font defined inside or outside of the current SVG document.

When a ‘font-face-uri’ is referencing an SVG font, then that reference must be to an SVG ‘font’ element, therefore requiring the use of a fragment identifier [RFC3986]. The referenced ‘font’ element can be local (i.e., within the same document as the ‘font-face-uri’ element) or remote (i.e., within a different document).

‘font-face-uri’
Categories:
None
Content model:
Any number of the following elements, in any order:
  • ‘font-face-format’
Attributes:
  • core attributes‘id’, ‘xml:base’, ‘xml:lang’, ‘xml:space’
  • xlink attributes‘xlink:href’, ‘xlink:show’, ‘xlink:actuate’, ‘xlink:type’, ‘xlink:role’, ‘xlink:arcrole’, ‘xlink:title’
  • ‘xlink:href’
DOM Interfaces:
  • SVGFontFaceUriElement

Attribute definitions:

xlink:href = "<IRI>"
The ‘xlink:href’ attribute specifies the location of the referenced font.
Animatable: no.

Child ‘font-face-format’ elements of a ‘font-face-uri’ element are used to specify the supported formats of the font referenced by that ‘font-face-uri’ element. They correspond to entries in a format(…) clause of the ‘src’ descriptor in an @font-face rule.

‘font-face-format’
Categories:
None
Content model:
Empty.
Attributes:
  • core attributes‘id’, ‘xml:base’, ‘xml:lang’, ‘xml:space’
  • ‘string’
DOM Interfaces:
  • SVGFontFaceFormatElement

Attribute definitions:

string = "<anything>"
The ‘string’ attribute is a hint to the user agent, and specifies a list of formats that the font referenced by the parent ‘font-face-uri’ element supports. The syntax of the attribute value is a format string as defined in CSS2, such as 'truetype'. Refer to the description of the 'src' descriptor in CSS2 for details on how the format hint is interpreted ([CSS2], section 15.3.5).
Animatable: no.

20.8.6 The ‘font-face-name’ element

The ‘font-face-name’ element is used within a ‘font-face-src’ element to reference a local font by name. It corresponds to a local(…) clause in an @font-face rule ‘src’ descriptor.

‘font-face-name’
Categories:
None
Content model:
Empty.
Attributes:
  • core attributes‘id’, ‘xml:base’, ‘xml:lang’, ‘xml:space’
  • ‘name’
DOM Interfaces:
  • SVGFontFaceNameElement

Attribute definitions:

name = "<anything>"
The ‘name’ attribute specifies the name of a local font. Unlike the syntax allowed between the parentheses of the local(…) clause in an @font-face rule ‘src’ descriptor, the font name specified in this attribute is not surrounded in single or double quotes. Refer to the description of the 'src' descriptor in CSS2 for details on how the font name is interpreted ([CSS2], section 15.3.5).
Animatable: no.

20.9 DOM interfaces

20.9.1 Interface SVGFontElement

The SVGFontElement interface corresponds to the ‘font’ element.

Object-oriented access to the attributes of the ‘font’ element via the SVG DOM is not available.

interface SVGFontElement : SVGElement,
                           SVGExternalResourcesRequired,
                           SVGStylable {
};

20.9.2 Interface SVGGlyphElement

The SVGGlyphElement interface corresponds to the ‘glyph’ element.

Object-oriented access to the attributes of the ‘glyph’ element via the SVG DOM is not available.

interface SVGGlyphElement : SVGElement,
                            SVGStylable {
};

20.9.3 Interface SVGMissingGlyphElement

The SVGMissingGlyphElement interface corresponds to the ‘missing-glyph’ element.

Object-oriented access to the attributes of the ‘missing-glyph’ element via the SVG DOM is not available.

interface SVGMissingGlyphElement : SVGElement,
                                   SVGStylable {
};

20.9.4 Interface SVGHKernElement

The SVGHKernElement interface corresponds to the ‘hkern’ element.

Object-oriented access to the attributes of the ‘hkern’ element via the SVG DOM is not available.

interface SVGHKernElement : SVGElement {
};

20.9.5 Interface SVGVKernElement

The SVGVKernElement interface corresponds to the ‘vkern’ element.

Object-oriented access to the attributes of the ‘vkern’ element via the SVG DOM is not available.

interface SVGVKernElement : SVGElement {
};

20.9.6 Interface SVGFontFaceElement

The SVGFontFaceElement interface corresponds to the ‘font-face’ element.

Object-oriented access to the attributes of the ‘font-face’ element via the SVG DOM is not available.

interface SVGFontFaceElement : SVGElement {
};

20.9.7 Interface SVGFontFaceSrcElement

The SVGFontFaceSrcElement interface corresponds to the ‘font-face-src’ element.

Object-oriented access to the attributes of the ‘font-face-src’ element via the SVG DOM is not available.

interface SVGFontFaceSrcElement : SVGElement {
};

20.9.8 Interface SVGFontFaceUriElement

The SVGFontFaceUriElement interface corresponds to the ‘font-face-uri’ element.

Object-oriented access to the attributes of the ‘font-face-uri’ element via the SVG DOM is not available.

interface SVGFontFaceUriElement : SVGElement {
};

20.9.9 Interface SVGFontFaceFormatElement

The SVGFontFaceFormatElement interface corresponds to the ‘font-face-format’ element.

Object-oriented access to the attributes of the ‘font-face-format’ element via the SVG DOM is not available.

interface SVGFontFaceFormatElement : SVGElement {
};

20.9.10 Interface SVGFontFaceNameElement

The SVGFontFaceNameElement interface corresponds to the ‘font-face-name’ element.

Object-oriented access to the attributes of the ‘font-face-name’ element via the SVG DOM is not available.

interface SVGFontFaceNameElement : SVGElement {
};
SVG 1.1 (Second Edition) – 16 August 2011Top ⋅ Contents ⋅ Previous ⋅ Next ⋅ Elements ⋅ Attributes ⋅ Properties
前の記事: 次の記事: