SVG 文書片の一部として描画されるテキストは 'text' 要素で指定する。描かれる文字は 'text' 要素内に XML 文字データ [XML10] として記述する。
Text that is to be rendered as part of an SVG document fragment is specified using the 'text' element. The characters to be drawn are expressed as XML character data [XML10] inside the 'text' element.
SVG の 'text' 要素は他のグラフィックス要素と同じように描画される。したがって 座標系変換, 塗り, クリッピング, マスク の特色機能は、 パス や 矩形 のような 図形 に対するのものと同じ方法で 'text' 要素にもに適用される。
SVG's 'text' elements are rendered like other graphics elements. Thus, coordinate system transformations, painting, clipping and masking features apply to 'text' elements in the same way as they apply to shapes such as paths and rectangles.
各 'text' 要素ごとに一つの文字列が描画される。 SVG は自動改行やワードラップをしない。複数行にわたるテキストに対しては次のいずれかの方法を用いる:
Each 'text' element causes a single string of text to be rendered. SVG performs no automatic line breaking or word wrapping. To achieve the effect of multiple lines of text, use one of the following methods:
'text' 要素内のテキストは直線的に、あるいは 'path' 要素の外形線に沿って描画させることができる。 SVG は直線上とパス上のテキストのいずれにおいても以下のような多言語テキスト処理をサポートする:
The text strings within 'text' elements can be rendered in a straight line or rendered along the outline of a 'path' element. SVG supports the following international text processing features for both straight line text and text on a path:
(直線上のテキストに対する配置規則は テキストの配置 で述べる。パス上のテキストに対する配置規則は パス上のテキストの配置規則 で述べる。)
(The layout rules for straight line text are described in Text layout. The layout rules for text on a path are described in Text on a path layout rules.)
SVG テキストは XML 文字データ [XML10] としてまとめられているので:
Because SVG text is packaged as XML character data [XML10] :
利用者が嗜好する言語に基づいて異なる文字列に置き換える ことにより複数言語化された SVG 内容が可能である。
Multi-language SVG content is possible by substituting different text strings based on the user's preferred language.
アクセシビリティの理由から、文書に含まれるテキストはその機能を指示する適切な意味内容に基づくマークアップがなされることが推奨される(詳細は SVG アクセシビリティ・ガイドライン を見よ)。
For accessibility reasons, it is recommended that text which is included in a document have appropriate semantic markup to indicate its function. See
SVG accessibility guidelines
for more information.
XML [XML10] において、テキスト内容は特定のユニコード・コードポイント( Unicode code point ) [UNICODE] で定義される XML 文字 の連なりによって表現される。一方で、フォントは グリフ とそれに関連する フォントテーブル などの情報で構成される。 グリフは一つまたはそれ以上の文字(場合によっては文字の一部分)の表示形式である。 各グリフは一連の描画指示命令に従ったある種の識別子(文字列で表現されることもあり、数値で表現されることもある)から構成される。
In XML [XML10] , textual content is defined in terms of a sequence of XML characters, where each character is defined by a particular Unicode code point [UNICODE] . Fonts, on the other hand, consists of a collection of glyphs and other associated information, such as font tables . A glyph is a presentable form of one or more characters (or a part of a character in some cases). Each glyph consists of some sort of identifier (in some cases a string, in other cases a number) along with drawing instructions for rendering that particular glyph.
多くの場合、ユニコード文字(即ちユニコード・コードポイント)とフォントのグリフとの間には1対1の関係がある。例えば、ラテン語系の言語(ラテン という用語は英語などアルファベットがラテン語から派生しているような欧州の言語に用いられる)のためにデザインされたフォントが標準 ASCII 文字(即ち A から Z, a から z, 0 から 9, および ASCII に含まれる種々の句読点など)の各々に対応するグリフを持つことは一般的なことである。したがって大抵の場合、3つのユニコード文字による文字列 "XML" は "X", "M", "L" に対応する3つのグリフ(同順)で描画される。
In many cases, there is a one-to-one mapping of Unicode characters (i.e., Unicode code points) to glyphs in a font. For example, it is common for a font designed for Latin languages (where the term Latin is used for European languages such as English with alphabets similar to and/or derivative to the Latin language) to contain a single glyph for each of the standard ASCII characters (i.e., A-to-Z, a-to-z, 0-to-9, plus the various punctuation characters found in ASCII). Thus, in most situations, the string "XML", which consists of three Unicode characters, would be rendered by the three glyphs corresponding to "X", "M" and "L", respectively.
しかしながら、他の様々な状況下ではユニコード文字とグリフは厳密な1対1対応をしない。 そのような状況を幾つか挙げる:
In various other cases, however, there is not a strict one-to-one mapping of Unicode characters to glyphs. Some of the circumstances when the mapping is not one-to-one:
多くの場合、文字からグリフへの対応アルゴリズムはシステムに依存しており、描画されるテキストは利用者の環境に依存して(通常は少しだけ)異なる可能性がある。 SVG 文書作成者が正確なフォントとグリフの選択を必要とするならば、必要なフォントを(必要なら文書に必要なグリフのみを含めたものに限定して) SVG フォント として SVG 内容に埋めこむか、 SVG 内容と同じウェブ上にある ウェブフォント として与えることが推奨される。
In many situations, the algorithms for mapping from characters to glyphs are system-dependent, resulting in the possibility that the rendering of text might be (usually slightly) different when viewed in different user environments. If the author of SVG content requires precise selection of fonts and glyphs, then the recommendation is that the necessary fonts (potentially subsetted to include only the glyphs needed for the given document) be available either as SVG fonts embedded within the SVG content or as WebFonts posted at the same Web location as the SVG content.
この章を通して、 文字 とは XML [XML10] で定義された文字を指すものとする。
Throughout this chapter, the term character shall be equivalent to the definition of a character in XML [XML10] .
フォントは一連のグリフとそれらを用いて何らかのメディアに文字を表示させるために必要な情報(一つ以上のフォントテーブル)から構成される。一連のグリフとフォントテーブルの組はフォントデータと呼ばれる。フォントテーブルには、文字をグリフに対応させたりグリフの表示領域の大きさと位置を決めるために必要な情報が含まれる。各フォントテーブルは、一つ以上のフォントウェイト( font-weight )やフォントスタイル( font-style )などの、フォント特性( font characteristics )を表す情報で構成される。
A font consists of a collection of glyphs together with the information (the font tables) necessary to use those glyphs to present characters on some medium. The combination of the collection of glyphs and the font tables is called the font data. The font tables include the information necessary to map characters to glyphs, to determine the size of glyph areas and to position the glyph area. Each font table consists of one or more font characteristics, such as the font-weight and font-style.
フォントの幾何的特徴はエム平方( EM box )に基づく座標系で表される。 (エムとはフォントのグリフの高さに相対的な量である - CSS2 em square 参照。) 高さ1エム、幅1エムの矩形はデザイン空間( design space )と呼ばれる。この空間の座標は、1エムを units-per-em (エムあたりの単位数)で細分したものにより与えられる。この細分一つの長さを1単位とする単位をデザイン単位と呼ぶ。 (訳注:デザイン単位という用語は原文のこの箇所では無く、後に現れるものであるが、翻訳表現の都合上ここで定義させていただくことにする。)
The geometric font characteristics are expressed in a coordinate system based on the EM box. (The EM is a relative measure of the height of the glyphs in the font; see CSS2 em square .) The box 1 EM high and 1 EM wide is called the design space. This space is given a geometric coordinates by sub-dividing the EM into a number of units-per-em .
注意: units-per-em すなわち、1エムがデザイン単位でいくつになるかはフォント特性の一つであり、通常は 1000 か 2048 の値をとる。
Note: Units-per-em is a font characteristic. A typical value for units-per-EM is 1000 or 2048.
エム平方の座標系はデザイン空間座標系と呼ばれている。スケーラブルなフォントにおいては、グリフを描くための直線や曲線はこの座標系で表現される。
The coordinate space of the EM box is called the design space coordinate system. For scalable fonts, the curves and lines that are used to draw a glyph are represented using this coordinate system.
注意:大抵の場合、この座標系の点 (0,0) はエム平方の左端に位置しており、左下隅ではない。 通常、ローマ大文字の下端のY座標は0になり、ローマ小文字のディセンダは負の座標値をとる。
Note: Most often, the (0,0) point in this coordinate system is positioned on the left edge of the EM box, but not at the bottom left corner. The Y coordinate of the bottom of a roman capital letter is usually zero. And the descenders on lowercase roman letters have negative coordinate values.
SVG はフォントテーブルが最低限次の3つのフォント特性:アセント, ディセント, 基底線テーブルの組を提供するものとみなす。アセントとは点 (0,0) からエム平方の上端までの距離である。ディセントとは点 (0,0) からエム平方の下端までの距離である。基底線テーブルについては以下で述べる。
SVG assumes that the font tables will provide at least three font characteristics: an ascent, a descent and a set of baseline-tables. The ascent is the distance to the top of the EM box from the (0,0) point of the font; the descent is the distance to the bottom of the EM box from the (0.0) point of the font. The baseline-table is explained below.
注意: OpenType フォントにおいては、横書の場合、アセントとディセントは OS/2 テーブルの sTypoAscender と sTypoDescender エントリで与えられる。縦書の場合、点 (0,0) が左端に位置するので、ディセント(この場合点 (0,0) からグリフの左端までの距離)は通常0であり、アセントは 1 em か、あるいは OpenType ベーステーブル( the OpenType Base table )の表意文字上端基底線の値( the ideographic top baseline value )によって指定される。
Note: Within an OpenType font, for horizontal writing-modes, the ascent and descent are given by the sTypoAscender and sTypoDescender entries in the OS/2 table. For vertical writing-modes, the descent (the distance, in this case from the (0,0) point to the left edge of the glyph) is normally zero because the (0,0) point is on the left edge. The ascent for vertical writing-modes is either 1 em or is specified by the ideographic top baseline value in the OpenType Base table for vertical writing-modes.
横書の場合、スクリプトのグリフは 整列点 ( alignment-point )と呼ばれるグリフごとに定められた特定の点が他のグリフの整列点に揃うよう配列される。異なったスクリプトのグリフ、例えば、西欧, 北インド, 極東地域のスクリプトでは、揃えられる点が互いに異なる。例えば西欧系のグリフは大文字の下端が揃えられ、北インド系のグリフは上端に近い水平方向のストロークの上端が揃えられ、極東系のグリフは中心または下端が揃えられる。 一つのスクリプトにおける一定のフォントサイズの1行のテキストにおいて、行進行方向への整列点の並びによって定まる幾何学的な線のことを基底線( baseline )と呼ぶ。西欧もしくは他のほとんどのアルファベット音節綴りのグリフは「アルファベット」( alphabetic )基底線に、北インド系のグリフは「吊り下げ」( hanging )基底線に、極東系のグリフは「表意文字」( ideographic )基底線に揃えられる。
In horizontal writing-modes, the glyphs of a given script are positioned so that a particular point on each glyph, the alignment-point , is aligned with the alignment-points of the other glyphs in that script. The glyphs of different scripts, for example, Western, Northern Indic and Far-Eastern scripts, are typically aligned at different points on the glyph. For example, Western glyphs are aligned on the bottoms of the capital letters, northern indic glyphs are aligned at the top of a horizontal stroke near the top of the glyphs and far-eastern glyphs are aligned either at the bottom or center of the glyph. Within a script and within a line of text having a single font-size, the sequence of alignment-points defines, in the inline- progression-direction, a geometric line called a baseline. Western and most other alphabetic and syllabic glyphs are aligned to an "alphabetic" baseline, the northern indic glyphs are aligned to a "hanging" baseline and the far-eastern glyphs are aligned to an "ideographic" baseline.
基底線テーブル( baseline-table )はデザイン空間座標系における一つ以上の基底線を指定する。基底線テーブルの機能は、異なったスクリプトが一行に混在されたときに、互いの存在を考慮して揃えることを容易にすることである。 どのような相対的字揃えが望ましいかは、どのスクリプトがその行(またはブロック)で支配的になるかに依存するので、スクリプトそれぞれに対し異なる基底線テーブルが用意されていることがある。更に、縦書と横書では異なる整列位置が必要になる。そのため、フォントには1つ以上の基底線テーブル(典型的には1つ以上の横書用のものと0個以上の縦書用のもの)が用意されていることがある。
A baseline-table specifies the position of one or more baselines in the design space coordinate system. The function of the baseline table is to facilitate the alignment of different scripts with respect to each other when they are mixed on the same text line. Because the desired relative alignments may depend on which script is dominant in a line (or block), there may be a different baseline table for each script. In addition, different alignment positions are needed for horizontal and vertical writing modes. Therefore, the font may have a set of baseline tables: typically, one or more for horizontal writing-modes and zero or more for vertical writing-modes.
(注意:一部のフォントは基底線テーブルを持たない。フォントに基底線テーブルが存在しない場合は近似的な基底線テーブルを得るために経験的方法を用いることが考えられる。)
Note: Some fonts may not have values for the baseline tables. Heuristics are suggested for approximating the baseline tables when a given font does not supply baseline tables.
SVG においては、フォントデータの各グリフが、横書用と縦書用のそれぞれについて、幅, 整列基底線( alignment-baseline ), 整列点を持つものとみなされる(幅と称されてはいるが、縦書の場合は縦方向の距離を表す)。グリフが属するスクリプトはグリフが揃えられる整列基底線を定める。 行進行方向 に対応する整列点の位置はグリフの始端( start-edge )上にある。
SVG further assumes that for each glyph in the font data for a font, there are two width values, two alignment-baselines and two alignment-points, one each for horizontal writing-modes and the other for vertical writing-modes. (Even though it is specified as a width, for vertical writing-modes the width is used in the vertical direction.) The script to which a glyph belongs determines an alignment-baseline to which the glyph is to be aligned. The inline-progression-direction position of the alignment-point is on the start-edge of the glyph.
基底線に関するプロパティは後の 基底線整列プロパティ で述べられる。
Properties related to baselines are described below under Baseline alignment properties.
上記の必要とされるフォント特性に加えて、フォントには、フォーマッターが一連のグリフに対して順序の入れ換え, 結合, 位置決めをするために利用する、置換および位置決め用のテーブルが用意されていることがある。それらの組み合わせはリガチャのような単純なものからインド系のシラブルの様な(大抵は順序組み替えを伴う)複数の子音と母音のグリフが組合わさった複雑なものまである。
In addition to the font characteristics required above, a font may also supply substitution and positioning tables that can be used by a formatter to re-order, combine and position a sequence of glyphs to make one or more composite glyphs. The combination may be as simple as a ligature, or as complex as an indic syllable which combines, usually with some re-ordering, multiple consonants and vowel glyphs.
'text' 要素はテキストからなるグラフィックス要素を定義する。 'text' 要素内の XML [XML10] 文字データ、およびそれらに伴う意味のある属性やプロパティとフォント自身に含まれる文字からグリフへの対応表によって、描画されるグリフが定まる( 文字とグリフの対応関係 を見よ)。 'text' 要素の属性とプロパティは、書字方向, フォント指定, 塗り属性など、文字をどのように正確に描画するかについてを指示する。この章の以下の節ではテキストに特化された関連属性とプロパティ、特に テキスト配置 ( text layout )と 双方向性 ( bidirectionality )について述べる。
The 'text' element defines a graphics element consisting of text. The XML [ XML10] character data within the 'text' element, along with relevant attributes and properties and character-to-glyph mapping tables within the font itself, define the glyphs to be rendered. (See Characters and their corresponding glyphs .) The attributes and properties on the 'text' element indicate such things as the writing direction, font specification and painting attributes which describe how exactly to render the characters. Subsequent sections of this chapter describe the relevant text-specific attributes and properties, particular text layout and bidirectionality .
'text' 要素は他のグラフィックス要素と同じ方法で描画されるので、 座標系変換, 塗り, クリッピング, マスク の仕組は パス や 矩形 のような 図形 に適用されるのと同じ方法で 'text' 要素にも適用される。
Since 'text' elements are rendered using the same rendering methods as other graphics elements, all of the same coordinate system transformations, painting,clipping and masking features that apply to shapes such as paths and rectangles also apply to 'text' elements.
テキストには、グラデーション, パターン, クリッピングパス, マスク, フィルタを適用することができる。これらのうち一つでもテキストに適用されており、かつキーワード objectBoundingBox によってオブジェクト包含ボックスに対し相対的なグラフィックス効果が指定されている場合( オブジェクトの包含ボックスに対して相対的な単位 を見よ)、オブジェクト包含ボックスにおける単位はどんな場合でも - たとえ同じ 'text' 要素内の異なる 'tspan' 要素に異なる効果が適用されていたとしても - 'text' 要素全体に対して相対的なものとして計算される。
It is possible to apply a gradient, pattern, clipping path, mask or filter to text. When one of these facilities is applied to text and keyword objectBoundingBox is used (see Object bounding box units ) to specify a graphical effect relative to the "object bounding box", then the object bounding box units are computed relative to the entire 'text' element in all cases, even when different effects are applied to different 'tspan' elements within the same 'text' element.
'text' 要素の描画はまず( 双方向性 による再配列の後)最初のグリフに対し、初期の 現在のテキスト位置 になされる。初期の現在のテキスト位置は、 'text' 要素の x および y 属性によって確立される(ただし、以下によって調整されることがある: 'text-anchor' プロパティの値, 最初の文字を含む 'textPath' 要素の存在, 最初の文字を含む 'tspan', 'tref', 'altGlyph' 要素のいずれかの x, y, dx, dy 属性)。 文字に対応するグリフ(たち)が描画された後、現在のテキスト位置は次の文字へと更新される。最も単純な場合、新しい現在のテキスト位置は前の現在のテキスト位置にグリフの(横か縦の)アドバンス( advance )値を加えたものである。グリフの配置とグリフ・アドバンスについては テキストの配置 を見よ。
'text' element renders its first glyph (after bidirectionality reordering) at the initial current text position, which is established by the x and y attributes on the 'text' element (with possible adjustments due to the value of the 'text-anchor' property, the presence of a 'textPath' element containing the first character, and/or an x, y, dx or dy attributes on a 'tspan', 'tref' or 'altGlyph' element which contains the first character). After the glyph(s) corresponding to the given character is(are) rendered, the current text position is updated for the next character. In the simplest case, the new current text position is the previous current text position plus the glyphs' advance value (horizontal or vertical). See text layout for a description of glyph placement and glyph advance.
<!ENTITY % SVG.text.extra.content "" > <!ENTITY % SVG.text.element "INCLUDE" > <![%SVG.text.element;[ <!ENTITY % SVG.text.content "( #PCDATA | %SVG.Description.class; | %SVG.Animation.class; %SVG.TextContent.class; %SVG.Hyperlink.class; %SVG.text.extra.content; )*" > <!ELEMENT %SVG.text.qname; %SVG.text.content; > <!-- end of SVG.text.element -->]]> <!ENTITY % SVG.text.attlist "INCLUDE" > <![%SVG.text.attlist;[ <!ATTLIST %SVG.text.qname; %SVG.Core.attrib; %SVG.Conditional.attrib; %SVG.Style.attrib; %SVG.Text.attrib; %SVG.TextContent.attrib; %SVG.Font.attrib; %SVG.Paint.attrib; %SVG.Color.attrib; %SVG.Opacity.attrib; %SVG.Graphics.attrib; %SVG.Clip.attrib; %SVG.Mask.attrib; %SVG.Filter.attrib; %SVG.GraphicalEvents.attrib; %SVG.Cursor.attrib; %SVG.External.attrib; x %Coordinates.datatype; #IMPLIED y %Coordinates.datatype; #IMPLIED dx %Lengths.datatype; #IMPLIED dy %Lengths.datatype; #IMPLIED rotate %Numbers.datatype; #IMPLIED textLength %Length.datatype; #IMPLIED lengthAdjust ( spacing | spacingAndGlyphs ) #IMPLIED transform %TransformList.datatype; #IMPLIED > |
属性定義:
Attribute definitions:
下の Example text01 はテキスト "Hello, out there" を含む。グリフ内部への塗りは青色にされ、 Verdana フォントファミリを用いてキャンバスに描画される。
Example text01 below contains the text string "Hello, out there" which will be rendered onto the canvas using the Verdana font family with the glyphs filled with the color blue.
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="10cm" height="3cm" viewBox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1"> <desc>Example text01 - 青色の 'Hello, out there'</desc> <text x="250" y="150" font-family="Verdana" font-size="55" fill="blue" > Hello, out there </text> <!-- 'rect' 要素によりキャンバスの外形線を表示 --> <rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" /> </svg>
![]() |
'tspan' 要素を 'text' 要素に含めることにより、テキストとフォントのプロパティおよび 現在のテキスト位置 を絶対あるいは相対の座標値で調整できるようになる。
Within a 'text' element, text and font properties and the current text position can be adjusted with absolute or relative coordinate values by including a 'tspan' element.
<!ENTITY % SVG.tspan.extra.content "" > <!ENTITY % SVG.tspan.element "INCLUDE" > <![%SVG.tspan.element;[ <!ENTITY % SVG.tspan.content "( #PCDATA | %SVG.tspan.qname; | %SVG.tref.qname; | %SVG.altGlyph.qname; | %SVG.animate.qname; | %SVG.set.qname; | %SVG.animateColor.qname; | %SVG.Description.class; %SVG.Hyperlink.class; %SVG.tspan.extra.content; )*" > <!ELEMENT %SVG.tspan.qname; %SVG.tspan.content; > <!-- end of SVG.tspan.element -->]]> <!ENTITY % SVG.tspan.attlist "INCLUDE" > <![%SVG.tspan.attlist;[ <!ATTLIST %SVG.tspan.qname; %SVG.Core.attrib; %SVG.Conditional.attrib; %SVG.Style.attrib; %SVG.TextContent.attrib; %SVG.Font.attrib; %SVG.Paint.attrib; %SVG.Color.attrib; %SVG.Opacity.attrib; %SVG.Graphics.attrib; %SVG.Clip.attrib; %SVG.Mask.attrib; %SVG.Filter.attrib; %SVG.GraphicalEvents.attrib; %SVG.Cursor.attrib; %SVG.External.attrib; x %Coordinates.datatype; #IMPLIED y %Coordinates.datatype; #IMPLIED dx %Lengths.datatype; #IMPLIED dy %Lengths.datatype; #IMPLIED rotate %Numbers.datatype; #IMPLIED textLength %Length.datatype; #IMPLIED lengthAdjust ( spacing | spacingAndGlyphs ) #IMPLIED > |
属性定義:
Attribute definitions:
この要素内の各文字に対応するすべてのグリフに適用される
現在のテキスト位置
に対する追加的回転。
コンマまたは空白区切りの
<number>
のリストで与えられた場合、この要素とその全ての子孫要素のそれぞれに対し、最初の
<number>
は最初の文字に対応するグリフへの回転を表し、2番目の
<number>
は2番目の文字に対応するグリフへの回転を表し、以下同様である。
もし与えられた
<number>
が文字数より多い場合、余分な
<number>
は無視される。
The supplemental rotation about the current text position that will be applied to all of the glyphs corresponding to each character within this element.
If a comma- or space-separated list of <number>s is provided, then the first <number> represents the supplemental rotation for the glyphs corresponding to the first character within this element or any of its descendants, the second <number> represents the supplemental rotation for the glyphs that correspond to the second character, and so on.
If more <number>s are provided than there are characters, then the extra <number>s will be ignored.
もし文字数が与えられた
<number>
より多い場合、: (a) 祖先の
'text'
または
'tspan'
要素の
rotate
属性によって追加的回転が指定されていた場合、それらが超過分の文字に適用される(より近い祖先が優先される)。(b) そうでない場合、追加的回転は超過分の文字に適用されない。
もしこの属性が指定されていない場合:(a) 祖先の
'text'
または
'tspan'
要素の
rotate
属性で追加的回転が指定されていれば、それらが文字に適用される(より近い祖先が優先される)。(b) そうでない場合、追加的回転は文字に適用されない。
この追加的回転はグリフが描画されるときの
現在のテキスト位置
に影響しない。また、
パス上のテキスト
や
'glyph-orientation-horizontal'
または
'glyph-orientation-vertical'
によって生じる回転に対し追加的である。
文字数が与えられた
<number>
より多い場合、最後に指定された回転が残りのそれぞれの文字に用いられなければならない。
この属性が指定されていない場合、祖先の
'text'
または
'tspan'
要素から rotate 属性を通して与えられた文字に追加の回転が指定されているならば、それらの文字にその追加の回転が適用される(最も近い祖先のものが優先される)。もし文字数が祖先の rotate 属性で指定された
<number>
より多い場合、最後に指定された回転が残りのそれぞれの文字に用いられなければならない。
If more characters are provided than <number> s, then for each of these extra characters: (a) if an ancestor 'text' or 'tspan' element specifies a supplemental rotation for the given character via a rotate attribute, then the given supplemental rotation is applied to the given character, else (b) no supplemental rotation occurs.
If the attribute is not specified: (a) if an ancestor 'text' or 'tspan' element specifies a supplemental rotation for a given character via a rotate attribute, then the given supplemental rotation is applied to the given character (nearest ancestor has precedence), else (b) no supplemental rotation occurs.
This supplemental rotation has no impact on the rules by which current text position is modified as glyphs get rendered and is supplemental to any rotation due to text on a path and to
'glyph-orientation-horizontal'
or
'glyph-orientation-vertical'.
アニメーション:可 (非加法的。'set' と 'animate' 要素のみ。)
Animatable: yes (non-additive, 'set' and 'animate' elements only).
'tspan' 要素の x, y, dx, dy, rotate 属性は最高品質の印刷において、個々のグリフの正確な位置決めが必要とされるときに役立つ。 これらの属性は文字間の微調整や、テキストの視覚的な改行を得る目的で 現在のテキスト位置 を新しい位置に設定するような大きな位置調整に便利である。複数行の効果を得る 'text' 要素は、各行に対し異なる 'tspan' 要素を定義し、その各々に対し属性 x, y, dx, dy のいくつかを指定することにより可能になる(このような方法の利点は、利用者が複数行にわたる テキスト選択 を行える点にある)。
The x, y, dx, dy and rotate on the 'tspan' element are useful in high-end typography scenarios where individual glyphs require exact placement. These attributes are useful for minor positioning adjustments between characters or for major positioning adjustments, such as moving the current text position to a new location to achieve the visual effect of a new line of text. Multi-line 'text' elements are possible by defining different 'tspan' elements for each line of text, with attributes x, y, dx and/or dy defining the position of each 'tspan' . (An advantage of such an approach is that users will be able to perform multi-line text selection .)
先進的な印刷制御のために極小レベルの位置調整が必要な状況においては、 SVG 内容デザイナにとっての要件として、必要なフォントがすべての文書ビューアで確実に利用可能であること(例えば必要なフォントを SVG フォント形式として、または SVG 内容と同じウェブサイトに存在する ウェブフォント 形式として)、および、ビューアがフォントを意図されたとおりに処理することがある(能力, 特徴, フォント配置の仕組はシステム間で非常にばらつきがある)。もし SVG 内容が、特定の文書表示ソフトウエアシステムで処理される特定のフォントに対応させたものであることを意図した x, y, dx, dy 属性値を含んでおり、上の要件のいずれかが満たされない場合、低品質なテキスト表示になる可能性がある。
In situations where micro-level positioning adjustment are necessary for advanced typographic control, the SVG content designer needs to ensure that the necessary font will be available for all viewers of the document (e.g., package up the necessary font data in the form of an SVG font or an alternative WebFont format which is stored at the same Web site as the SVG content) and that the viewing software will process the font in the expected way (the capabilities, characteristics and font layout mechanisms vary greatly from system to system). If the SVG content contains x, y, dx or dy attribute values which are meant to correspond to a particular font processed by a particular set of viewing software and either of these requirements is not met, then the text might display with poor quality.
属性 x, y, dx, dy, rotate が数値のリストを含む場合、以下の追加規則が適用される:
The following additional rules apply to attributes x, y, dx, dy and rotate when they contain a list of numbers:
<tspan dx="11 12 13 14 15 0 21 22 23 0 31 32 33 34 35 36" >Latin and Hebrew</tspan>ここで単語 "Hebrew" は右から左に描画されるとする。まず、文字データと dx 属性内のリストの対応する値は、テキストが "Latin and werbeH" に、 dx 属性内のリストの値が "11 12 13 14 15 0 21 22 23 0 36 35 34 33 32 31" になるように再配列される。しかる後、文字たちに対応するグリフたちが標準の左から右への配置規則によって位置決めされる。
<tspan dx="11 12 13 14 15 0 21 22 23 0 31 32 33 34 35 36">Latin and Hebrew</tspan>and that the word "Hebrew" will be drawn right-to-left. First, the character data and the corresponding values in the dx list will be reordered, such that the text string will be "Latin and werbeH" and the list of values for the dx attribute will be "11 12 13 14 15 0 21 22 23 0 36 35 34 33 32 31". After this re-ordering, the glyphs corresponding to the characters will be positioned using standard left-to-right layout rules.
The following examples show basic use of the 'tspan' element.
Example tspan01 では、 'tspan' 要素は単語 "not" に対し、太字フォントを用い、内部を赤色で塗ることを指示している。
Example tspan01 uses a 'tspan' element to indicate that the word "not" is to use a bold font and have red fill.
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="10cm" height="3cm" viewBox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1"> <desc>Example tspan01 - tspan による視覚的属性の変更</desc> <g font-family="Verdana" font-size="45" > <text x="200" y="150" fill="blue" > You are <tspan font-weight="bold" fill="red" >not</tspan> a banana. </text> </g> <!-- 'rect' 要素によりキャンバスの外形線を表示 --> <rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" /> </svg>
![]() |
Example tspan02 では、 'tspan' 要素の属性 dx と dy で 'text' 要素の特定のテキストに対する 現在のテキスト位置 を縦横ともに調整している。
Example tspan02 uses the dx and dy attributes on the 'tspan' element to adjust the current text position horizontally and vertically for particular text strings within a 'text' element.
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="10cm" height="3cm" viewBox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1"> <desc>Example tspan02 - tspan の dx と dy 属性による 増分的な位置の調整</desc> <g font-family="Verdana" font-size="45" > <text x="200" y="150" fill="blue" > But you <tspan dx="2em" dy="-50" font-weight="bold" fill="red" > are </tspan> <tspan dy="100"> a peach! </tspan> </text> </g> <!-- 'rect' 要素によりキャンバスの外形線を表示 --> <rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" /> </svg>
![]() |
Example tspan03 では、 'tspan' 要素の属性 x, y で、描画される各グリフに対する 現在のテキスト位置 を絶対位置として設定している。この例では2行のテキストが一つの 'text' 要素に入れられている。2行とも同じ 'text' 要素内にあるので、UAが テキスト選択とクリップボード処理 をサポートしていれば、利用者は2行同時に選択してシステムのクリップボードにコピーすることができる。
Example tspan03 uses the x and y attribute on the 'tspan' element to establish a new absolute current text position for each glyph to be rendered. The example shows two lines of text within a single 'text' element. Because both lines of text are within the same 'text' element, the user will be able to select through both lines of text and copy the text to the system clipboard in user agents that support text selection and clipboard operations,
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="10cm" height="3cm" viewBox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1"> <desc>Example tspan03 - 複数行にわたるテキストやグリフを正確に 位置させるために tspan の x と y 属性を用いる</desc> <g font-family="Verdana" font-size="45" > <text fill="rgb(255,164,0)" > <tspan x="300 350 400 450 500 550 600 650" y="100"> Cute and </tspan> <tspan x="375 425 475 525 575" y="200"> fuzzy </tspan> </text> </g> <!-- 'rect' 要素によりキャンバスの外形線を表示 --> <rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" /> </svg>
![]() |
Example tspan04 に、 'tspan' 要素の 'rotate' 属性を利用するグリフの回転描画を示す。この例は 'rotate' 属性に指定される値の個数より多くの文字からなる単独の文字列を含む 'tspan' 要素を表示する。この場合、 'tspan' の 'rotate' 属性の最後に指定されている値が文字列の残りの文字に適用されなければならない。
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="10cm" height="3cm" viewBox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1"> <desc>Example tspan04 - The number of rotate values is less than the number of characters in the string.</desc> <text font-family="Verdana" font-size="55" fill="blue" > <tspan x="250" y="150" rotate="-30,0,30"> Hello, out there </tspan> </text> <!-- Show outline of canvas using 'rect' element --> <rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" /> </svg>
![]() |
Example tspan05 では 'text' 要素と子要素の 'tspan' に 'rotate' 属性によるグリフの回転描画を指定している。この例は 'rotate' 属性の伝播を例証する。
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" viewBox="0 0 500 120" xmlns="http://www.w3.org/2000/svg" version="1.1"> <desc> Example tspan05 - Propagation of rotation on text using child tspan elemtns. </desc> <text id="parent" font-family="Arial, sans-serif" font-size="32" fill="red" x="40" y="40" rotate="5,15,25,35,45,55"> Not <tspan id="child1" rotate="-10,-20,-30,-40" fill="orange"> all characters <tspan id="child2" rotate="70,60,50,40,30,20,10" fill="yellow"> in <tspan id="child3"> the </tspan> </tspan> <tspan id="child4" fill="orange" x="40" y="90"> text </tspan> have a </tspan> <tspan id="child5" rotate="-10" fill="blue"> specified </tspan> rotation </text> <!-- Show outline of canvas using 'rect' element --> <rect x="1" y="1" width="498" height="118" fill="none" stroke="blue" stroke-width="2" /> </svg>
![]() |
'text' 要素内の赤色のテキストの回転:
"child1" 'tspan' 要素内のオレンジ色のテキストの回転:
"child2" 'tspan' 要素内の黄色のテキストの回転:
"child5" 'tspan' 要素内の青色のテキストの回転:
![]() |
'text' 要素のテキスト内容は、文字データとして直接 'text' 要素に埋めこまれているか、 'tref' 要素によって指定される参照先の文字データ内容である。
The textual content for a 'text' can be either character data directly embedded within the 'text' element or the character data content of a referenced element, where the referencing is specified with a 'tref' element.
<!ENTITY % SVG.tref.extra.content "" > <!ENTITY % SVG.tref.element "INCLUDE" > <![%SVG.tref.element;[ <!ENTITY % SVG.tref.content "( %SVG.animate.qname; | %SVG.set.qname; | %SVG.animateColor.qname; | %SVG.Description.class; %SVG.tref.extra.content; )*" > <!ELEMENT %SVG.tref.qname; %SVG.tref.content; > <!-- end of SVG.tref.element -->]]> <!ENTITY % SVG.tref.attlist "INCLUDE" > <![%SVG.tref.attlist;[ <!ATTLIST %SVG.tref.qname; %SVG.Core.attrib; %SVG.Conditional.attrib; %SVG.Style.attrib; %SVG.TextContent.attrib; %SVG.Font.attrib; %SVG.Paint.attrib; %SVG.Color.attrib; %SVG.Opacity.attrib; %SVG.Graphics.attrib; %SVG.Clip.attrib; %SVG.Mask.attrib; %SVG.Filter.attrib; %SVG.GraphicalEvents.attrib; %SVG.Cursor.attrib; %SVG.XLinkRequired.attrib; %SVG.External.attrib; x %Coordinates.datatype; #IMPLIED y %Coordinates.datatype; #IMPLIED dx %Lengths.datatype; #IMPLIED dy %Lengths.datatype; #IMPLIED rotate %Numbers.datatype; #IMPLIED textLength %Length.datatype; #IMPLIED lengthAdjust ( spacing | spacingAndGlyphs ) #IMPLIED > |
属性定義:
Attribute definitions:
参照先の要素内の文字データはマークアップで囲まれたものも含めて全て描画される。
All character data within the referenced element, including character data enclosed within additional markup, will be rendered.
属性 x, y, dx, dy, rotate は 'tspan' 要素と同じ意味を持つ。これらの属性は 'tref' 要素が 'tspan' に置き換えられ、参照された文字データ(すべての追加的マークアップは除去される)がこの仮想の 'tspan' 要素に埋めこまれたかのように、適用される。
The x, y, dx, dy and rotate attributes have the same meanings as for the 'tspan' element. The attributes are applied as if the 'tref' element was replaced by a 'tspan' with the referenced character data (stripped of all supplemental markup) embedded within the hypothetical 'tspan' element.
Example tref01 に他の要素の文字データをどのようにして 'tspan' 要素の文字データとして利用するかを示す。1つ目の 'text' 要素( id="ReferencedText")は 'defs' 要素の一部なので描画されない。 2つ目の 'text' 要素は「インライン文字データ」を描く。 3つ目の 'text' 要素は、「参照文字データ」を描く。すなわち、要素 "ReferencedText" を参照する 'tref' 要素を含んでおり、参照先の要素の文字データが「被参照文字データ」である。
Example tref01 shows how to use character data from a different element as the character data for a given 'tspan' element. The first 'text' element (with id="ReferencedText") will not draw because it is part of a 'defs' element. The second 'text' element draws the string "Inline character data". The third 'text' element draws the string "Reference character data" because it includes a 'tref' element which is a reference to element "ReferencedText", and that element's character data is "Referenced character data".
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="10cm" height="3cm" viewBox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <text id="ReferencedText"> Referenced character data </text> </defs> <desc>Example tref01 - インライン、および参照によるテキスト内容</desc> <text x="100" y="100" font-size="45" fill="blue" > Inline character data </text> <text x="100" y="200" font-size="45" fill="red" > <tref xlink:href="#ReferencedText"/> </text> <!-- 'rect' 要素によりキャンバスの外形線を表示 --> <rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" /> </svg>
![]() |
この節では SVG でサポートされているテキスト配置の特色機能について述べる。これには、左から右(例えばラテン語系スクリプト), 双方向(例えばヘブライ語やアラビア語), 縦書(例えば アジア系スクリプト)など、様々な国の言語の書字方向のサポートも含まれる。この節ではテキストは直線上(即ち現在の利用座標系において横または縦方向に厳密に並んだテキスト)であるとみなす。以降の節で パス上のテキスト についての追加的配置規則を述べる。
This section describes the text layout features supported by SVG, which includes support for various international writing directions, such as left-to-right (e.g., Latin scripts) and bidirectional (e.g., Hebrew or Arabic) and vertical (e.g., Asian scripts). The descriptions in this section assume straight line text (i.e., text that is either strictly horizontal or vertical with respect to the current user coordinate system). Subsequent sections describe the supplemental layout rules for text on a path.
SVG は自動改行や行送りの機能を提供しない。したがって、複数行のテキストブロックの整形をサポートする言語よりも多言語テキストの配置は単純になる。
SVG does not provide for automatic line breaks or word wrapping, which makes internationalized text layout for SVG relatively simpler than it is for languages which support formatting of multi-line text blocks.
SVG-UAは、各 'text' 要素に対し標準の横書または縦書のテキスト(即ちパス上でないテキスト)における現在の 基準方位( reference orientation ) を決定する。基準方位とは現在の利用座標系において、Y軸の負の無限大を向くベクトルである( 初期座標系 においては、基準方位は上方向である)。 パス上のテキスト における基準方位は文字ごとに毎回設定される。
For each 'text' element, the SVG user agent determines the current reference orientation. For standard horizontal or vertical text (i.e., no text-on-a-path), the reference orientation is the vector pointing towards negative infinity in Y within the current user coordinate system. (Note: in the initial coordinate system, the reference orientation is up.) For text on a path, the reference orientation is reset with each character.
基準方位と 'writing-mode' プロパティの値を基に、 SVG-UAは現在の 行進行方向( inline-progression-direction ) を決定する。左から右へのテキストでは、行進行方向は基準方位から時計回りに 90 度の方向である。右から左へのテキストでは、行進行方向は基準方位から反時計回りに 90 度の方向である。上から下へのテキストでは、行進行方向は基準方位の反対方向である。
Based on the reference orientation and the value for property 'writing-mode', the SVG user agent determines the current inline-progression-direction. For left-to-right text, the inline-progression-direction points 90 degrees clockwise from the reference orientation vector. For right-to-left text, the inline progression points 90 degrees counter-clockwise from the reference orientation vector. For top-to-bottom text, the inline-progression-direction points 180 degrees from the reference orientation vector.
基準方位と 'writing-mode' プロパティの値を基に、 SVG-UAは現在の ブロック進行方向( block-progression-direction ) 決定する。左から右へ( left-to-right )のテキストと右から左へ( right-to-left )のテキストでは、横書で利用できる 'writing-mode' が lr-tb と rl-tb だけなので、ブロック進行方向は基準方位の反対方向である。上から下へ( top-to-bottom )のテキストでは、利用できる 'writing-mode' が tb-rl だけなので、ブロック進行方向は常に基準方位から反時計回りに 90 度の方向である。
Based on the reference orientation and the value for property 'writing-mode', the SVG user agent determines the current block-progression-direction. For left-to-right and right-to-left text, the block-progression-direction points 180 degrees from the reference orientation vector because the only available horizontal 'writing-mode's are lr-tb and rl-tb. For top-to-bottom text, the block-progression-direction always points 90 degrees counter-clockwise from the reference orientation vector because the only available top-to-bottom 'writing-mode' is tb-rl.
シフト方向( shift direction )とは、 'baseline-shift' プロパティが正の値をとるときに 基底線テーブル が動く方向である。シフト方向は正の値に対し基底線テーブルが元の 基底線テーブル の最上端エントリへ向かってシフトする方向である。
The shift direction is the direction towards which the baseline table moves due to positive values for property 'baseline-shift'. The shift direction is such that a positive value shifts the baseline table towards the topmost entry in the parent's baseline table.
SVG-UAは 'text' 要素の処理において 現在のテキスト位置( current text position ) を常に更新しつづける。初期の現在のテキスト位置は 'text' 要素の属性 x と y によって確立される。
In processing a given 'text' element, the SVG user agent keeps track of the current text position. The initial current text position is established by the x and y attributes on the 'text' element.
現在のテキスト位置は各グリフの処理後ごとに、次のグリフが描画されるべき場所へと、調整される。現在のテキスト位置に対するこの調整は、現在の 行進行方向, 描画されたばかりのそのグリフの グリフ方位 ( glyph orientation )に対応するグリフ特有のアドバンス値, フォントのカーニングテーブル, それに様々な属性とプロパティの現在の値( 間隔調整プロパティ や要素 'text', 'tspan', 'tref', 'altGlyph' いずれかの属性 x, y, dx, dy の値)に基づいて行われる。もしグリフに現在の グリフ方位 に対応するアドバンス値が明示的に与えられていないならば、適切な近似が用いられるべきである。縦書のテキストならば、考えられる近似はグリフのアセントとディセント値の和である。 横書と縦書のテキストの両方に対するアドバンス値に対して考えられる別の近似として、emの大きさがある( デザイン単位 を見よ)。
The current text position is adjusted after each glyph to establish a new current text position at which the next glyph shall be rendered. The adjustment to the current text position is based on the current inline-progression-direction, glyph-specific advance values corresponding to the glyph orientation of the glyph just rendered, kerning tables in the font and the current values of various attributes and properties, such as the spacing properties and any x, y, dx and dy attributes on 'text', 'tspan', 'tref' or 'altGlyph' elements. If a glyph does not provide explicit advance values corresponding to the current glyph orientation, then an appropriate approximation should be used. For vertical text, a suggested approximation is the sum of the ascent and descent values for the glyph. Another suggested approximation for an advance value for both horizontal and vertical text is the size of an em (see units-per-em).
SVG-UAは、描画される各グリフに対し、現在のテキスト位置にきっちり合わせられる、グリフ上の適切な 整列点 を決定する。整列点は、グリフ自身におけるグリフセルの計量, 現在の 行進行方向 , 行進行方向に相対的な グリフ方位 に基づいて決定される。ほとんどのラテン語系テキスト(即ち 'writing-mode:lr', 'text-anchor:start', 'alignment-baseline:baseline' )においては、グリフ内の整列点はグリフセルの左端(または他の幾つかのグリフ特有の左側の原点を指示するX座標)とラテン語系グリフの基底線との交点である。上から下への縦書テキストの配置では、多くの場合、基準となる点はフォントの縦基底線のセットに基づくグリフ特有の原点であるか、グリフの中央とtop line(top lineの定義は [CSS2-topline] を参照)の交点である。もしグリフに現在の グリフ方位 に対応する原点が明示的に与えられていない場合、グリフの左端とグリフに対する適切な水平基底線との交点や、グリフの上端とグリフに対する適切な垂直基底線との交点などのような、適切な近似が用いられるべきである。もし基底線テーブルが無ければ、UAは処理において共通して利用される基底線テーブルを確立すべきである。
For each glyph to be rendered, the SVG user agent determines an appropriate alignment-point on the glyph which will be placed exactly at the current text position. The alignment-point is determined based on glyph cell metrics in the glyph itself, the current inline-progression-direction and the glyph orientation relative to the inline-progression-direction. For most uses of Latin text (i.e., 'writing-mode:lr', 'text-anchor:start', and 'alignment-baseline:baseline') the alignment-point in the glyph will be the intersection of left edge of the glyph cell (or some other glyph-specific x-axis coordinate indicating a left-side origin point) with the Latin baseline of the glyph. For many cases with top-to-bottom vertical text layout, the reference point will be either a glyph-specific origin point based on the set of vertical baselines for the font or the intersection of the center of the glyph with its top line (see [ CSS2-topline] for a definition of top line). If a glyph does not provide explicit origin points corresponding to the current glyph orientation, then an appropriate approximation should be used, such as the intersection of the left edge of the glyph with the appropriate horizontal baseline for the glyph or intersection of the top edge of the glyph with the appropriate vertical baseline. If baseline tables are not available, user agents should establish baseline tables that reflect common practice.
現在のテキスト位置に対する調整は 絶対位置調整 か 相対位置調整 かのどちらかである。 絶対位置調整は次の状況で生じる:
Adjustments to the current text position are either absolute position adjustments or relative position adjustments. An absolute position adjustment occurs in the following circumstances:
現在のテキスト位置に対する他の位置調整はすべて相対位置調整である。
All other position adjustments to the current text position are relative position adjustments.
各絶対位置調整に対し、個別に テキスト片 ( text chunk )が定義される。各絶対位置調整はテキスト配置に対し次のような影響をもたらす:
Each absolute position adjustment defines a new text chunk. Absolute position adjustments impact text layout in the following ways:
次の追加規則がリガチャの形成に適用される:
The following additional rules apply to ligature formation:
'writing-mode' プロパティは、 'text' 要素に対する初期の行進行方向を、左から右, 右から左, 上から下へのいずれにするかを指定する。 'writing-mode' プロパティは 'text' 要素にのみ適用される。このプロパティは下位の要素 'tspan', 'tref', 'altGlyph', 'textPath' では無視される。(注意:一つの 'text' 要素内における行進行方向は、ユニコード双方向アルゴリズムおよび 'direction'と 'unicode-bidi' プロパティによって変更されることがある。双方向テキストについては、 双方向性との関係 を見よ。)
The 'writing-mode' property specifies whether the initial inline-progression-direction for a 'text' element shall be left-to-right, right-to-left, or top-to-bottom. The 'writing-mode' property applies only to 'text' elements; the property is ignored for 'tspan', 'tref', 'altGlyph' and 'textPath' sub-elements. (Note that the inline-progression-direction can change within a 'text' element due to the Unicode bidirectional algorithm and properties 'direction' and 'unicode-bidi'. For more on bidirectional text, see Relationship with bidirectionality.)
値: | lr-tb | rl-tb | tb-rl | lr | rl | tb | inherit |
初期値: | lr-tb |
適用対象: | 'text' 要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 不可 |
Value: | lr-tb | rl-tb | tb-rl | lr | rl | tb | inherit |
Initial: | lr-tb |
Applies to: | 'text' elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | no |
場合によっては、文字並びの方位を行進行方向に相対して変える必要がある。このことは特に東アジア系の文書の縦書配置のときにあてはまり、セル幅の狭いラテン語系テキストが、あるときは直立に、別のときは横倒しに表示される。
In some cases, it is required to alter the orientation of a sequence of characters relative to the inline-progression-direction. The requirement is particularly applicable to vertical layouts of East Asian documents, where sometimes narrow-cell Latin text is to be displayed horizontally and other times vertically.
2つの可能な行進行方向のそれぞれに対し、基準方位に相対的なグリフ方位を制御する別々のプロパティがある。 'glyph-orientation-vertical' は行進行方向が縦のときのグリフ方位を制御する。 'glyph-orientation-horizontal' は行進行方向が横のときのグリフ方位を制御する。
Two properties control the glyph orientation relative to the reference orientation for each of the two possible inline-progression-directions. 'glyph-orientation-vertical' controls glyph orientation when the inline-progression-direction is vertical. 'glyph-orientation-horizontal' controls glyph orientation when the inline-progression-direction is horizontal.
値: | auto | <angle> | inherit |
初期値: | auto |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 不可 |
Value: | auto | <angle> | inherit |
Initial: | auto |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | no |
全角( fullwidth )表意文字と全角ラテン語系テキストではグリフ方位は 0 度に設定される。
句読点その他の横書と縦書の両形式を持つ表意文字に対しては、縦書形式のグリフが用いられる。
全角でないテキストではグリフ方位は 90 度に設定される。
この方位の再設定規則は一段階だけ非表意文字テキストのみに対し適用される。それ以上の書字方向モードまたは双方向処理の埋めこみは全てこの一段階目の回転に基づく。
注意:
これは非表意文字テキスト文字列を、双方向規則( bidi-rule )を尊重しつつ横書に設定し、その結果による行内領域における並び(グリフ方向の変更各一回につき一つの領域)を時計回りに 90 度回転することと同値である。
この「回転」手法によるテキストは、言語やスクリプトにおいて一般的な連結や再配列によるリガチャその他のグリフを含むことがあることに注意。(この「回転」手法による表示形式は自動リガチャ形成や同様な文脈依存によるグリフ形成を止めるわけではない。)
どの文字が自動的に回転されるべきかの決定はUAごとに様々になり得る。この決定は、国, 言語, スクリプト, 文字の特性, フォント, 文字の文脈などの間における複雑な相互関係に基づく。ユニコード TR 11, JIS 規格, その他の国家標準を調べることが薦められる。
Fullwidth ideographic and fullwidth Latin text will be set with a glyph-orientation of 0-degrees.
Ideographic punctuation and other ideographic characters having alternate horizontal and vertical forms will use the vertical form of the glyph.
Text which is not fullwidth will be set with a glyph-orientation of 90-degrees.
This reorientation rule applies only to the first-level non-ideographic text. All further embedding of writing-modes or bidi processing will be based on the first-level rotation.
NOTE:
This is equivalent to having set the non-ideographic text string horizontally honoring the bidi-rule, then rotating the resultant sequence of inline-areas (one area for each change of glyph direction) 90-degrees clockwise.
It should be noted that text set in this "rotated" manner may contain ligatures or other glyph combining and reordering common to the language and script. (This "rotated" presentation form does not disable auto-ligature formation or similar context-driven variations.)
The determination of which characters should be auto-rotated may vary across user agents. The determination is based on a complex interaction between country, language, script, character properties, font, and character context. It is suggested that one consult the Unicode TR 11 and the various JIS or other national standards.
このプロパティは 'writing-mode' が縦書のテキストにのみ適用される。
This property is applied only to text written in a vertical 'writing-mode'.
グリフ方位は各グリフが描画されるごとの現在のテキスト位置に対するアドバンス量に影響する。 行進行方向が縦方向で 'glyph-orientation-vertical' による方位の角度が 180 度の倍数のとき、現在のテキスト位置はグリフの縦方向の計量に従って増大する。そうでないとき、即ち 'glyph-orientation-vertical' による方位の角度が 180 度の倍数でないとき、現在のテキスト位置はグリフの横方向の計量に従って増大する。
The glyph orientation affects the amount that the current text position advances as each glyph is rendered. When the inline-progression-direction is vertical and the 'glyph-orientation-vertical' results in an orientation angle that is a multiple of 180 degrees, then the current text position is incremented according to the vertical metrics of the glyph. Otherwise, if the 'glyph-orientation-vertical' results in an orientation angle that is not a multiple of 180 degrees, then the current text position is incremented according to the horizontal metrics of the glyph.
この節のテキスト配置図では次の記号を用いる:
The text layout diagrams in this section use the following symbols:
- 幅広の( wide-cell )グリフ(例えば漢字)で、行内の n 番目のグリフ
- 幅狭の( narrow-cell )グリフ(例えばラテン語系)で、行内の n 番目のグリフ
- wide-cell glyph (e.g. Han) which is the n-th glyph in the text run
- narrow-cell glyph (e.g. Latin) which is the n-th glyph in the text run
上の図式の記号で想定している方位は、それらが表現するユニコード文字がUAにおいて描画されるときに想定される方向に対応する。図式のグリフ間の間隔は、問題点を明らかにするために意図的に変更される場合を除いて、表象的なものである。
The orientation which the above symbols assume in the diagrams corresponds to the orientation that the Unicode characters they represent are intended to assume when rendered in the user agent. Spacing between the glyphs in the diagrams is usually symbolic, unless intentionally changed to make a point.
次図に 'glyph-orientation-vertical' の異なる用いられ方を示す。図左はラテン語系の文字に対する 'glyph-orientation-vertical' を auto または 90 に指定した場合において、全角表意文字グリフと幅狭のグリフを混在させたときの結果を示している。図右はラテン語系の文字に対する 'glyph-orientation-vertical' を 0 に指定した場合において、全角表意文字グリフと幅狭のグリフを混在させたときの結果を示している。
The diagrams below illustrate different uses of 'glyph-orientation-vertical'. The diagram on the left shows the result of the mixing of full-width ideographic glyphs with narrow-cell Latin glyphs when 'glyph-orientation-vertical' for the Latin characters is either auto or 90. The diagram on the right show the result of mixing full-width ideographic glyphs with narrow-cell Latin glyphs when Latin glyphs are specified to have a 'glyph-orientation-vertical' of 0.
値: | <angle> | inherit |
初期値: | 0deg |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 不可 |
Value: | <angle> | inherit |
Initial: | 0deg |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | no |
このプロパティは 'writing-mode' が横書のテキストにのみ適用される。
This property is applied only to text written in a horizontal 'writing-mode'.
グリフ方位は各グリフが描画されるごとの現在のテキスト位置に対するアドバンス量に影響する。基準方位が水平方向で 'glyph-orientation-horizontal' による方位の角度が 180 度の倍数のとき、現在のテキスト位置はグリフの横方向の計量に従って増大する。そうでないとき、 'glyph-orientation-horizontal' による方位の角度が 180 度の倍数でないとき, 現在のテキスト位置はグリフの縦方向の計量に従って増大する。
The glyph orientation affects the amount that the current text position advances as each glyph is rendered. When the reference orientation direction is horizontal and the 'glyph-orientation-horizontal' results in an orientation angle that is a multiple of 180 degrees, then the current text position is incremented according to the horizontal metrics of the glyph. Otherwise, if the 'glyph-orientation-horizontal' results in an orientation angle that is not a multiple of 180 degrees, then the current text position is incremented according to the vertical metrics of the glyph.
ある種のスクリプトでは文字は右から左へ書かれる。一部の文書、特にアラビア語やヘブライ語のスクリプトで書かれた、何らかの複数言語の文脈では、一行のテキストに双方向が入り混じることになる。このような現象は双方向性( bidirectionality )または略して "bidi" と呼ばれる。
The characters in certain scripts are written from right to left. In some documents, in particular those written with the Arabic or Hebrew script, and in some mixed-language contexts, text in a single line may appear with mixed directionality. This phenomenon is called bidirectionality, or "bidi" for short.
ユニコード標準( [UNICODE] 3.11 節)ではテキストの正しい書字方向を決定する複雑なアルゴリズムが定義されている。 アルゴリズムは明示的な埋めこみと上書きの制御のみならず、文字の特性に基づく暗黙の部分からも構成される。 SVG-UAは 'text' 要素における文字の配置を決定する際にこの双方向アルゴリズムを適用する。 'direction' と 'unicode-bidi' プロパティは文字内容の本来の方向を文書作成者が上書きすることを可能にし、文書言語の要素と属性をこのアルゴリズムにどう写すかの明示的な制御が可能にする。この2つのプロパティは行進行方向に垂直なグリフに対応する全ての文字に対して適用することができる。
The Unicode standard ([ UNICODE], section 3.11) defines a complex algorithm for determining the proper directionality of text. The algorithm consists of an implicit part based on character properties, as well as explicit controls for embeddings and overrides. The SVG user agent applies this bidirectional algorithm when determining the layout of characters within a 'text' element. The 'direction' and 'unicode-bidi' properties allow authors to override the inherent directionality of the content characters and thus explicitly control how the elements and attributes of a document language map to this algorithm. These two properties are applicable to all characters whose glyphs are perpendicular to the inline-progression-direction.
ほとんどの場合、 [UNICODE] による双方向アルゴリズムは望ましい結果を自動的に算出してくれる。このアルゴリズムを正しく上書きすることは通常極めて複雑である。したがってほとんどの場合、文書作成者はこれらのプロパティに安易に値を設定するべきではない。
In most cases, the bidirectional algorithm from [ UNICODE] produces the desired result automatically, and overriding this algorithm properly is usually quite complex. Therefore, in most cases, authors are discouraged from assigning values to these properties.
双方向性についてのより完全な解説は "Cascading Style Sheets (CSS) level 2" 仕様 [CSS2-direction] を参照のこと。
A more complete discussion of bidirectionality can be found in the "Cascading Style Sheets (CSS) level 2" specification [ CSS2-direction].
双方向テキストの処理モデルは次のようになる。UAは 論理順序 で与えられる文字を処理する(論理順序とは、直接的包含あるいは 'tref' 要素による間接的参照を通して、文字たちが元の文書に現れる順番のことである)。UAは、各々に対し個別にユニコード双方向アルゴリズムが適用されるような独立のブロックに分割する。各 テキスト片 はテキストの独立ブロックを表す。加えて、 'glyph-orientation-horizontal' または 'glyph-orientation-vertical' プロパティから生ずるグリフ方位の変更により、独立のテキストブロックたちが更に細分される。各独立テキストブロックに対するユニコード双方向アルゴリズムおよび 'direction' と 'unicode-bidi' プロパティの処理が終わると、UAは、描画順序が左から右にされた再配列済みの文字のリストを得ることになる。文字の再配列に同時並行して、 'tspan' と 'tref' 要素の dx, dy, rotate 属性も、文字と属性値の元の対応関係を維持するために再配列される。文字またはグリフの組に対するカーニングとリガチャの処理は、それがフォント特有のものであるとしても、文字の再配列後に行われることがモデルとしては望ましい。
The processing model for bidirectional text is as follows. The user agent processes the characters which are provided in logical order (i.e., the order the characters appear in the original document, either via direct inclusion or via indirect reference due a 'tref' element). The user agent determines the set of independent blocks within each of which it should apply the Unicode bidirectional algorithm. Each text chunk represents an independent block of text. Additionally, any change in glyph orientation due to processing of properties 'glyph-orientation-horizontal' or 'glyph-orientation-vertical' will subdivide the independent blocks of text further. After processing the Unicode bidirectional algorithm and properties 'direction' and 'unicode-bidi' on each of the independent text blocks, the user agent will have a potentially re-ordered list of characters which are now in left-to-right rendering order. Simultaneous with re-ordering of the characters, the dx, dy and rotate attributes on the 'tspan' and 'tref' elements are also re-ordered to maintain the original correspondence between characters and attribute values. While kerning or ligature processing might be font-specific, the preferred model is that kerning and ligature processing occurs between combinations of characters or glyphs after the characters have been re-ordered.
値: | ltr | rtl | inherit |
初期値: | ltr |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 不可 |
Value: | ltr | rtl | inherit |
Initial: | ltr |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | no |
このプロパティは基になるテキストの書字方向および、ユニコード双方向アルゴリズムにおける埋めこみと上書きの方向( 'unicode-bidi' を見よ)を指定する。 'direction' プロパティは 'unicode-bidi' プロパティの値が 'embed' か 'bidi-override' でなければ意味をなさない。
This property specifies the base writing direction of text and the direction of embeddings and overrides (see 'unicode-bidi') for the Unicode bidirectional algorithm. For the 'direction' property to have any effect, the 'unicode-bidi' property's value must be 'embed' or 'bidi-override'.
この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-direction] で与えられる。
Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-direction].
'direction' プロパティは 行進行方向 に対し方位が垂直のグリフにのみ適用される。ここでの行進行方向は通常の横書のラテン語系またはアラビア語のテキスト場合と、上から下への行進行方向に相対して時計回りに 90 度回転されたラテン語系またはアラビア語の幅狭の文字の場合が含まれる。
The 'direction' property applies only to glyphs oriented perpendicular to the inline-progression-direction, which includes the usual case of horizontally-oriented Latin or Arabic text and the case of narrow-cell Latin or Arabic characters rotated 90 degrees clockwise relative to a top-to-bottom inline-progression-direction.
値: | normal | embed | bidi-override | inherit |
初期値: | normal |
適用対象: | テキスト内容要素 |
継承: | 無し |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 不可 |
Value: | normal | embed | bidi-override | inherit |
Initial: | normal |
Applies to: | text content elements |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Animatable: | no |
この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-unicode-bidi] で与えられる。
Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-unicode-bidi].
'text' 要素内の文字に結びつけられたグリフは元の文書における文字の論理順序で描画され、双方向性の実装に必要な再配列とは独立である。このように、視覚的に右から左へ連なるテキストでは、最も右側の文字に対応するグリフは他の文字に対応するグリフより先に描画される。
The glyphs associated with the characters within a 'text' element are rendered in the logical order of the characters in the original document, independent of any re-ordering necessary to implement bidirectionality. Thus, for text that goes right-to-left visually, the glyphs associated with the rightmost character are rendered before the glyphs associated with the other characters.
加えて、個々のグリフは次のグリフが描画される前に一体として描画される(即ち、 'fill' と 'stroke' プロパティによって指定される内部と外形線への塗りが行われる)。
Additionally, each distinct glyph is rendered in its entirety (i.e., it is filled and stroked as specified by the 'fill' and 'stroke' properties) before the next glyph gets rendered.
'text-anchor' プロパティはテキスト文字列を与えられた点に対して相対的に揃える(先頭揃え, 中央揃え, 末尾揃え)ために用いられる。
The 'text-anchor' property is used to align (start-, middle- or end-alignment) a string of text relative to a given point.
'text-anchor' プロパティは与えられた 'text' 要素における個々の テキスト片 に対し適用される。各テキスト片は初期の現在のテキスト位置を持ち、次のいずれかを適用した結果による(文脈に依存する)利用座標系の点を表現する:すなわち、テキスト片の最初に描画される文字に対し、 'text' 要素の x, y 属性、または明示的に指定された 'tspan', 'tref', 'altGlyph' のうちのいずれかの要素の x, y 属性の値、あるいは 'textPath' 要素における初期の現在のテキスト位置、のいずれかである。
The 'text-anchor' property is applied to each individual text chunk within a given 'text' element. Each text chunk has an initial current text position, which represents the point in the user coordinate system resulting from (depending on context) application of the x and y attributes on the 'text' element, any x or y attribute values on a 'tspan', 'tref' or 'altGlyph' element assigned explicitly to the first rendered character in a text chunk, or determination of the initial current text position for a 'textPath' element.
値: | start | middle | end | inherit |
初期値: | start |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | start | middle | end | inherit |
Initial: | start |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
これらの値は次の意味を持つ:
Values have the following meanings:
基底線整列と基底線テーブルについての概観は上の フォント, フォントテーブル, 基底線 にてすでに述べた。
An overview of baseline alignment and baseline tables can be found above in Fonts, font tables and baselines.
多言語が含まれるテキストの特徴の一つは異なるスクリプトのグリフに対し異なる基底線(異なる整列点)が存在することである。例えば横書の場合、漢字, 片仮名, 平仮名, ハングルのような表意文字スクリプトにおいては基底線による整列はグリフの下端近くで行われ、ラテン語系, キリル文字, ヘブライ語, アラビア語などのアルファベットを基調とするスクリプトにおいてはほとんどのグリフが下端が揃えられる一方で一部のグリフの下端が基底線より下に位置し、インド系スクリプトにおいてはグリフの上端近くが揃えられる。
One of the characteristics of international text is that there are different baselines (different alignment points) for glyphs in different scripts. For example, in horizontal writing, ideographic scripts, such as Han Ideographs, Katakana, Hiragana, and Hangul, alignment occurs with a baseline near the bottoms of the glyphs; alphabetic based scripts, such as Latin, Cyrillic, Hebrew, Arabic, align a point that is the bottom of most glyphs, but some glyphs descend below the baseline; and Indic based scripts are aligned at a point that is near the top of the glyphs.
異なるスクリプトが一行のテキストに混在するとき、スクリプトの異なるグリフが互いに正しく揃えるられように調整されなければならない。 OpenType [OPENTYPE] フォントは、現在の基底線から他の基底線へのオフセットを指定する基底線テーブル (BASE) [OPENTYPE-BASETABLE] を持つ。
When different scripts are mixed on a line of text, an adjustment must be made to ensure that the glyphs in the different scripts are aligned correctly with one another. OpenType [ OPENTYPE] fonts have a Baseline table (BASE) [ OPENTYPE-BASETABLE] that specifies the offsets of the alternative baselines from the current baseline.
SVG における 'text' 要素の処理では、(一つのフォントサイズの中で)一つのスクリプトが「支配的部分( dominant run )」になっているものとみなす、 OpenType に似た基底線テーブルのモデルが用いられる。すなわち、他のすべての基底線はこの支配的部分に相対的なものとして定義される。支配的部分となるスクリプトの基底線を 主基底線 ( dominant baseline )と呼ぶ。よって、例えば主基底線がアルファベットの基底線であるならば、表意文字の基底線やインド系言語の基底線など、他の基底線のためのオフセットが基底線テーブルに存在することになる。また、一部の数学用フォントに用いられる数式用基底線のためのオフセットも存在することになる。横書と縦書モードそれぞれに対し別々の基底線テーブルがあることに注意。これらのテーブルにおけるオフセットは横書と縦書ではそれぞれ異なるものになるであろう。
SVG uses a similar baseline table model that assumes one script (at one font-size) is the "dominant run" during processing of a 'text' element; that is, all other baselines are defined in relation to this dominant run. The baseline of the script with the dominant run is called the dominant baseline. So, for example, if the dominant baseline is the alphabetic baseline, there will be offsets in the baseline table for the alternate baselines, such as the ideographic baseline and the Indic baseline. There will also be an offset for the math baseline which is used for some math fonts. Note that there are separate baseline tables for horizontal and vertical writing-modes. The offsets in these tables may be different for horizontal and vertical writing.
'text' 要素の処理を始める時点で確立される基底線テーブルのことを 主基底線テーブル と呼ぶ。
The baseline table established at the start of processing of a 'text' element is called the dominant baseline table.
'font-family' プロパティの値はフォントのリストなので、一貫性のある基底線テーブルの選択を保証するために、フォントリスト内でグリフが利用可能な最初のフォントとして、名目上のフォント( nominal font )が定義される。これは、遭遇するそれぞれの文字に対し、そのグリフを持っている最初のフォントである。(この定義のため、フォントが置換されたり合成されたりしてもグリフデータが存在するものとみなされる。)この定義により、利用されるフォントと基底線テーブルの決定が内容から独立することが保証される。 (訳注:解り難い定義だが、名目上のフォントとは、要するに各文字に利用されるグリフを複数のフォントから寄せ集めたものというのが訳者の理解である。しかしながら、最後の文の「独立」の意味が訳者には把握できていない。)
Because the value of the 'font-family' property is a list of fonts, to insure a consistent choice of baseline table we define the nominal font in a font list as the first font in the list for which a glyph is available. This is the first font that could contain a glyph for each character encountered. (For this definition, glyph data is assumed to be present if a font substitution is made or if the font is synthesized.) This definition insures a content independent determination of the font and baseline table that is to be used.
'text' 要素の 'font-size' プロパティの値は 主基底線テーブル・フォントサイズ を確立する。
The value of the 'font-size' property on the 'text' element establishes the dominant baseline table font size.
このモデルでは各グリフは、グリフが揃えられる基底線を指示する 'alignment-baseline' 値を持つものとみなされる。( OpenType 基底線テーブルにおいては 'alignment-baseline' は "Baseline Tag" と呼ばれる。) 'alignment-baseline' プロパティの初期値ではグリフに結び付けられた基底線識別子が利用される。 'alignment-baseline' に対する代替値は、スクリプトの仲間内では特異な "*" のようなグリフに対して役立つ。
The model assumes that each glyph has a 'alignment-baseline' value which specifies the baseline with which the glyph is to be aligned. (The 'alignment-baseline' is called the "Baseline Tag" in the OpenType baseline table description.) The initial value of the 'alignment-baseline' property uses the baseline identifier associated with the given glyph. Alternate values for 'alignment-baseline' can be useful for glyphs such as a "*" which are ambiguous with respect to script membership.
このモデルではグリフが描かれるフォントは、 フォント基底線テーブル と呼ばれる基底線テーブルを持つものとみなされる。この基底線テーブルはフォントが持つ各基底線に対し、点 (0,0) からのデザイン単位で表されるオフセットを持つ。特に、グリフの点 (0,0) から 'alignment-baseline' で識別される基底線へのオフセットを持つ。
The model assumes that the font from which the glyph is drawn also has a baseline table, the font baseline table. This baseline table has offsets in units-per-em from the (0,0) point to each of the baselines the font knows about. In particular, it has the offset from the glyph's (0,0) point to the baseline identified by the 'alignment-baseline'.
基底線テーブルのオフセットの値はエムを分割した単位を意味する「デザイン単位」( design units )で表される。 CSS ではこれを "units-per-em" [CSS2-UNITSPEREM] と呼ぶ。したがって、(描画における文字高に相対的な単位が em だから)現在の 'font-size' は主基底線から他の基底線までの実際のオフセットを決定する際に用いられる。
The offset values in the baseline table are in "design units" which means fractional units of the EM. CSS calls these "units-per-em" [ CSS2-UNITSPEREM]. Thus, the current 'font-size' is used to determine the actual offset from the dominant baseline to the alternate baselines.
グリフの整列においては 'alignment-baseline' で識別されるグリフの基底線が主基底線テーブルにある同じ名前の基底線に揃えられる。
The glyph is aligned so that its baseline identified by its 'alignment-baseline' is aligned with the baseline with the same name from the dominant baseline table.
主基底線から 'alignment-baseline' で識別される基底線までのオフセットは主基底線テーブルと主基底線テーブル・フォントサイズを用いて計算される。グリフに適用可能なフォント基底線テーブルとフォントサイズは、識別された基底線からグリフの点 (0,0) までのオフセットの算出に用いられる。この第二のオフセットが シフト方向 における点 (0,0) の位置を得るために、第一のオフセットから引かれる。2つのオフセットは基底線テーブルの基底線の値に適切なフォントサイズの値を掛けることにより計算される。
The offset from the dominant baseline of the parent to the baseline identified by the 'alignment-baseline' is computed using the dominant baseline table and dominant baseline table font size. The font baseline table and font size applicable to the glyph are used to compute the offset from the identified baseline to the (0,0) point of the glyph. This second offset is subtracted from the first offset to get the position of the (0,0) point in the shift direction. Both offsets are computed by multiplying the baseline value from the baseline table times the appropriate font size value.
'alignment-baseline' が主基底線を指す場合、第一のオフセットは0になり、グリフは主基底線に揃えられる。他の基底線を指す場合、グリフはその基底線に揃えられる。
If the 'alignment-baseline' identifies the dominant baseline, then the first offset is zero and the glyph is aligned with the dominant baseline; otherwise, the glyph is aligned with the chosen alternate baseline.
この仕様で用いられる基底線識別子を下に挙げる。うち幾つかは、 [XSL description of Fonts and Font Data] で述べられるようにして、フォントに含まれる基底線テーブルから定まる。残りは以下で述べられる他のフォント特性から計算される。
The baseline-identifiers below are used in this specification. Some of these are determined by baseline-tables contained in a font as described in [XSL description of Fonts and Font Data]. Others are computed from other font characteristics as described below.
この識別子は、ほとんどのアルファベットと音節を基調とするスクリプトで用いられる基底線を指す。これらには、多くの西欧、南インド、東南アジア(非表意文字)のスクリプトが含まれるが、それらだけには限られない。
This identifies the baseline used by most alphabetic and syllabic scripts. These include, but are not limited to, many Western, Southern Indic, Southeast Asian (non-ideographic) scripts.
この識別子は、表意文字のスクリプトで用いられる基底線を指す。歴史的な理由により、この基底線は表意文字のエム平方の中心ではなく、下端にある。"central" 基底線を見よ。表意文字スクリプトには中国語, 日本語, 韓国語, ベトナム字喃 (訳注: Vietnamese Chu Nom - チュノム - 漢字から派生したベトナム古代文字) などが含まれる。
This identifies the baseline used by ideographic scripts. For historical reasons, this baseline is at the bottom of the ideographic EM box and not in the center of the ideographic EM box. See the "central" baseline. The ideographic scripts include Chinese, Japanese, Korean, and Vietnamese Chu Nom.
この識別子は、ある種のインド系スクリプトで用いられる基底線を指す。 これらのスクリプトにはデヴァーナーガリー (訳注: Devanagari - サンスクリットやヒンディー語などの現代インドの諸言語に用いられるアルファベット) , グルムキー文字 (訳注: Gurmukhi - パンジャブ語の表記に用いられる文字) , ベンガル語( Bengali )などが含まれる。
This identifies the baseline used by certain Indic scripts. These scripts include Devanagari, Gurmukhi and Bengali.
この識別子は、数学記号に用いられる基底線を指す。
This identifies the baseline used by mathematical symbols.
この識別子は、エム平方の中心として計算される基底線を表す。この基底線は text-before-edge と text-after-edge 基底線の中間に位置する。
注意:表意文字フォントに対しては、グリフの整列にこの基底線がよく用いられる。これは表意文字基底線の代替である。
This identifies a computed baseline that is at the center of the EM box. This baseline lies halfway between the text-before-edge and text-after-edge baselines.
NOTE:For ideographic fonts, this baseline is often used to align the glyphs; it is an alternative to the ideographic baseline.
この識別子は、基底線がアルファベット基底線から シフト方向に x-height フォント特性の値の 1/2 のオフセットにあることを表す。この基底線の位置はフォントデータまたはフォント特性に "x-height" を持つフォントから得られることがある。"x-height" の 1/2 によって計算されてもよい。 これらの情報が無い場合、基底線の位置は "central" 基底線からの近似にしてもよい。
This identifies a baseline that is offset from the alphabetic baseline in the shift-direction by 1/2 the value of the x-height font characteristic. The position of this baseline may be obtained from the font data or, for fonts that have a font characteristic for "x-height", it may be computed using 1/2 the "x-height". Lacking either of these pieces of information, the position of this baseline may be approximated by the "central" baseline.
この識別子は、エム平方の before-edge を表す。この基底線の位置は基底線テーブルによって指定されたり、計算によって得られたりする。
注意:この基底線は通常アセンダの上端かその周辺に位置するが、グリフの上側に現れるすべてのアセントを取り囲むとは限らない。これらのフォントでは "ascent" フォント特性の値が用いられる。表意文字フォントでは、この基底線は通常「表意文字」基底線からシフト方向 に1エムの所に位置する。しかしながら、一部の表意文字フォントでは、より圧縮された植字を可能にするために、行進行方向において切り詰められた幅を持つ。縦書モード専用にデザインされたそのようなフォントが横書モードで用いられた場合、"text-before-edge" 基底線は text-after-edge から1エムより小さい所に位置するかもしれない。
This identifies the before-edge of the EM box. The position of this baseline may be specified in the baseline-table or it may be calculated.
NOTE:The position of this baseline is normally around or at the top of the ascenders, but it may not encompass all accents that can appear above a glyph. For these fonts the value of the "ascent" font characteristic is used. For ideographic fonts, the position of this baseline is normally 1 EM in the shift-direction from the "ideographic" baseline. However, some ideographic fonts have a reduced width in the inline-progression-direction to allow tighter setting. When such a font, designed only for vertical writing-modes, is used in a horizontal writing-mode, the "text-before-edge" baseline may be less than 1 EM from the text-after-edge.
この識別子は、エム平方の after-edge を表す。この基底線の位置は基底線テーブルによって指定されたり、計算によって得られたりする。
注意:ディセンダを持つフォントでは、この基底線は通常アセンダの下端またはその周辺に位置する。これらのフォントでは "descent" フォント特性の値が用いられる。表意文字フォントでは、この基底線は通常「表意文字」基底線に位置する。
This identifies the after-edge of the EM box. The position of this baseline may be specified in the baseline-table or it may be calculated.
NOTE:For fonts with descenders, the position of this baseline is normally around or at the bottom of the descenders. For these fonts the value of the "descent" font characteristic is used. For ideographic fonts, the position of this baseline is normally at the "ideographic" baseline.
これらの他に、計算によって得られる2つの基底線がラインエリア( line areas )のためのみに定義されている。ラインエリアに基づく計算の概念は SVG のサポート外なので、この2つの基底線は次のように置き換えられる:
There are, in addition, two computed baselines that are only defined for line areas. Since SVG does not support the notion of computations based on line areas, the two computed baselines are mapped as follows:
4つの基底線が、横書モード専用に定義されている。
There are also four baselines that are defined only for horizontal writing-modes.
横書モードにおいて、この基底線は "before-edge" 基底線と同じであり、縦書モードでは未定義である。
This baseline is the same as the "before-edge" baseline in a horizontal writing-mode and is undefined in a vertical writing mode.
横書モードにおいて、この基底線は "text-before-edge" 基底線と同じであり、縦書モードでは未定義である。
This baseline is the same as the "text-before-edge" baseline in a horizontal writing-mode and is undefined in a vertical writing mode.
横書モードにおいて、この基底線は "after-edge" 基底線と同じであり、縦書モードでは未定義である。
This baseline is the same as the "after-edge" baseline in a horizontal writing-mode and is undefined in a vertical writing mode.
横書モードにおいて、この基底線は "text-after-edge" 基底線と同じであり、縦書モードでは未定義である。
This baseline is the same as the "text-after-edge" baseline in a horizontal writing-mode and is undefined in a vertical writing mode.
以下は基底線整列プロパティ。
The baseline-alignment properties follow.
値: | auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | | mathematical | central | middle | text-after-edge | text-before-edge | inherit |
初期値: | auto |
適用対象: | テキスト内容要素 |
継承: | 無し |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | | mathematical | central | middle | text-after-edge | text-before-edge | inherit |
Initial: | auto |
Applies to: | text content elements |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
"dominant-baseline"(主基底線)プロパティは伸縮済み基底線テーブル( scaled-baseline-table )を設定または再設定する際に用いられる。伸縮済み基底線テーブルは3つの成分:主基底線, 基底線テーブル, 基底線テーブル・フォントサイズで構成される複合値である。プロパティに指定する値の一部は3つ全ての値を再設定する。他は基底線テーブル・フォントサイズのみを再設定する。初期値 "auto" で得られる結果が望ましくない場合、このプロパティを伸縮済み基底線テーブルの上書きに利用することができる。
The "dominant-baseline" property is used to determine or re-determine a scaled-baseline-table. A scaled-baseline-table is a compound value with three components: a baseline-identifier for the dominant-baseline, a baseline-table and a baseline-table font-size. Some values of the property re-determine all three values; other only re-establish the baseline-table font-size. When the initial value, "auto", would give an undesired result, this property can be used to explicitly set the desire scaled-baseline-table.
このプロパティの値は次のような意味を持つ:
Values for the property have the following meaning:
このプロパティが 'text' 要素に生じた場合、計算値は 'writing-mode' プロパティの値に依存する。主基底線成分の値は 'writing-mode' が横書ならば 'alphabetic' に、縦書ならば 'central' になる。
このプロパティが 'tspan', 'tref', 'altGlyph', 'textPath' いずれかの要素に生じた場合、主基底線成分と基底線テーブル成分は、親の テキスト内容要素 におけるそれらと同じままにされる。 'baseline-shift' の計算値によって実際に基底線がシフトされる場合、基底線テーブル・フォントサイズ成分は 'dominant-baseline' プロパティが生じた要素の 'font-size' プロパティの値に設定される。そうでない場合、基底線テーブル・フォントサイズ成分はその要素におけるそれと同じままにされる。親の テキスト内容要素 が存在しない場合、伸縮済み基底線テーブルの値は上記の 'text' 要素に対するものと同様にして構築される。
If this property occurs on a 'text' element, then the computed value depends on the value of the 'writing-mode' property. If the 'writing-mode' is horizontal, then the value of the dominant-baseline component is 'alphabetic', else if the 'writing-mode' is vertical, then the value of the dominant-baseline component is 'central'.
If this property occurs on a 'tspan', 'tref', 'altGlyph' or 'textPath' element, then the dominant-baseline and the baseline-table components remain the same as those of the parent text content element. If the computed 'baseline-shift' value actually shifts the baseline, then the baseline-table font-size component is set to the value of the 'font-size' property on the element on which the 'dominant-baseline' property occurs, otherwise the baseline-table font-size remains the same as that of the element. If there is no parent text content element, the scaled-baseline-table value is constructed as above for 'text' elements.
もし、名目上のフォントに基底線テーブルが存在しない、または基底線テーブルの中に望まれる基底線エントリが欠けていた場合、UAは必要な基底線の位置を決定する際に経験的手法を用いてよい。
If there is no baseline table in the nominal font or if the baseline table lacks an entry for the desired baseline, then the user agent may use heuristics to determine the position of the desired baseline.
値: | auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | inherit |
初期値: | auto |
適用対象: | 'tspan', 'tref', 'altGlyph', 'textPath' 要素 |
継承: | 無し |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | inherit |
Initial: | auto |
Applies to: | 'tspan', 'tref', 'altGlyph', 'textPath' elements |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
このプロパティは親に対してオブジェクトをどのように揃えるかを指定する。このプロパティはこの要素のどの基底線を親の対応する基底線に対し揃えるかを指定する。例えば、ローマ字テキストにおけるアルファベットの基底線をフォントサイズの変化の中で揃えることを可能にする。 これは基底線の既定値を alignment-baseline プロパティの計算値と同じ名前にする。つまり、ブロック進行方向における "ideographic" 整列点は揃えられるオブジェクトの基底線テーブルの "ideographic" 基底線上にあることを意味する。
This property specifies how an object is aligned with respect to its parent. This property specifies which baseline of this element is to be aligned with the corresponding baseline of the parent. For example, this allows alphabetic baselines in Roman text to stay aligned across font size changes. It defaults to the baseline with the same name as the computed value of the alignment-baseline property. That is, the position of "ideographic" alignment-point in the block-progression-direction is the position of the "ideographic" baseline in the baseline-table of the object being aligned.
それぞれの値は次の意味を持つ:
Values have the following meanings:
値: | baseline | sub | super | <percentage> | <length> | inherit |
初期値: | baseline |
適用対象: | 'tspan', 'tref', 'altGlyph', 'textPath' 要素 |
継承: | 無し |
パーセント: | 'text' 要素の "line-height" を参照し、 SVG においては 'font-size' と同じである。 |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | baseline | sub | super | <percentage> | <length> | inherit |
Initial: | baseline |
Applies to: | 'tspan', 'tref', 'altGlyph', 'textPath' elements |
Inherited: | no |
Percentages: | refers to the "line-height" of the 'text' element, which in the case of SVG is defined to be equal to the 'font-size' |
Media: | visual |
Animatable: | yes |
'baseline-shift' プロパティは主基底線を親の テキスト内容要素 の主基底線に相対的に再配置させることを可能にする。シフトされたオブジェクトは下付または上付文字であることが予想される。シフトされたオブジェクトにおいては、一つの基底線だけでなく、基底線テーブル全体がオフセットされる。シフトされる量は、親の テキスト内容要素 , 親の テキスト内容要素 の名目上のフォントによる下付または上付文字 オフセット, 親の テキスト内容要素 の "line-height" パーセント, 絶対値 のいずれかの情報を基に決定される。
The 'baseline-shift' property allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element. The shifted object might be a sub- or superscript. Within the shifted object, the whole baseline-table is offset; not just a single baseline. The amount of the shift is determined from information from the parent text content element, the sub- or superscript offset from the nominal font of the parent text content element, percent of the "line-height" of the parent text content element or an absolute value.
SVG においては、 'baseline-shift' プロパティは基底線テーブルに対する追加的調整を表す。 'baseline-shift' プロパティは、例えばグリフを上付または下付文字の位置に上下させるなど、各グリフに対する基底線テーブルを一時的に新しい位置にシフトする。しかしながら、現在のテキスト位置には影響しない。各グリフの描画後におけるグリフのアドバンス値による現在のテキスト位置の調整は、基底線のシフトが無かったかのように行われる。
In SVG, the 'baseline-shift' property represents a supplemental adjustment to the baseline tables. The 'baseline-shift' property shifts the baseline tables for each glyph to temporary new positions, for example to lift the glyph into superscript or subscript position, but it does not effect the current text position. When the current text position is adjusted after rendering a glyph to take into account glyph advance values, the adjustment happens as if there were no baseline shift.
'baseline-shift' プロパティは入れ子にすることができる。入れ子にされた各 'baseline-shift' は前の基底線のシフト量に加えられる。
'baseline-shift' properties can nest. Each nested 'baseline-shift' is added to previous baseline shift values.
このプロパティの値は次の意味を持つ:
Values for the property have the following meaning:
SVG は次のフォント指定プロパティを用いる。この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-fonts] で与えられる。これらのプロパティについての SVG 特有の注意点は下で述べられる。
SVG uses the following font specification properties. Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-fonts]. Any SVG-specific notes about these properties are contained in the descriptions below.
値: |
[[ <family-name> | <generic-family> ],]* [<family-name> | <generic-family>] | inherit |
初期値: | UA依存 |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | [[ <family-name> | <generic-family> ],]* [<family-name> | <generic-family>] | inherit |
Initial: | depends on user agent |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
このプロパティはテキストの描画にどのフォントファミリを用いるかをフォントファミリ名/一般ファミリ名の優先順位付きのリストとして指示する。 この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-font-family] で与えられる。 CSS プロパティの値を記述する構文規則は [CSS2-propdef] を参照のこと。
This property indicates which font family is to be used to render the text, specified as a prioritized list of font family names and/or generic family names. Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-font-family]. The rules for expressing the syntax of CSS property values can be found at [ CSS2-propdef].
値: | normal | italic | oblique | inherit |
初期値: | normal |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | normal | italic | oblique | inherit |
Initial: | normal |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
このプロパティはテキストの描画に normal, italic, oblique (標準, イタリック, 斜体)のうちどの書体を用いるかを指示する。 この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-font-style] で与えられる。
This property specifies whether the text is to be rendered using a normal, italic or oblique face. Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-font-style].
値: | normal | small-caps | inherit |
初期値: | normal |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | normal | small-caps | inherit |
Initial: | normal |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
このプロパティは小文字のテキストの描画に normal, small-caps のどちらのグリフを用いるかを指示する。 この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-font-variant] で与えられる。
This property indicates whether the text is to be rendered using the normal glyphs for lowercase characters or using small-caps glyphs for lowercase characters. Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-font-variant].
値: |
normal | bold | bolder | lighter | 100 | 200 | 300
| 400 | 500 | 600 | 700 | 800 | 900 | inherit |
初期値: | normal |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit |
Initial: | normal |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
このプロパティはテキストの描画に用いられるグリフに対する、同じフォントファミリ内における相対的な太さまたは細さを指示する。 この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-font-weight] で与えられる。
This property refers to the boldness or lightness of the glyphs used to render the text, relative to other fonts in the same font family. Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-font-weight].
値: |
normal | wider | narrower | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | inherit |
初期値: | normal |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | normal | wider | narrower | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | inherit |
Initial: | normal |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
このプロパティはテキストの描画に用いられるグリフに対する圧縮または伸張の望ましい量を指示する。 この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-font-stretch] で与えられる。
This property indicates the desired amount of condensing or expansion in the glyphs used to render the text. Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-font-stretch].
値: |
<absolute-size> | <relative-size> | <length> | <percentage> | inherit |
初期値: | medium |
適用対象: | テキスト内容要素 |
継承: | 有り, 計算値は継承される |
パーセント: | 親要素のフォントサイズを参照する |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | <absolute-size> | <relative-size> | <length> | <percentage> | inherit |
Initial: | medium |
Applies to: | text content elements |
Inherited: | yes, the computed value is inherited |
Percentages: | refer to parent element's font size |
Media: | visual |
Animatable: | yes |
このプロパティは、複数行配置環境において複数行のテキストがべた組みにされるときの隣合う行の基底線の間隔としてフォントのサイズを指示する。 SVG においては、 <length> が単位識別子無しで与えられた場合(例えば 128 のような計量の無い数)、 SVG-UAは <length> を現在の利用座標系における高さの値として処理する。
This property refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment. For SVG, if a <length> is provided without a unit identifier (e.g., an unqualified number such as 128), the SVG user agent processes the <length> as a height value in the current user coordinate system.
<length>が 単位識別子 付きで与えられた場合(例えば 12pt や 10% )、 SVG-UAは <length> を 単位 で述べられている規則を適用して現在の利用座標系の対応する値に変換する。
If a <length> is provided with one of the unit identifiers (e.g., 12pt or 10%), then the SVG user agent converts the <length> into a corresponding value in the current user coordinate system by applying the rules described in Units.
この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-font-size] で与えられる。
Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-font-size].
値: | <number> | none | inherit |
初期値: | none |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可(非加法的。 'set' と 'animate' 要素のみ) |
Value: | <number> | none | inherit |
Initial: | none |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes (non-additive, 'set' and 'animate' elements only) |
このプロパティは文書作成者が、置換フォントとして最初に選ばれたフォントの x-height を維持するように、要素に対する縦横比を指定することを可能にする。 この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-font-size-adjust] で与えられる。
This property allows authors to specify an aspect value for an element that will preserve the x-height of the first choice font in a substitute font. Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-font-size-adjust].
値: |
[ [ <'font-style'> ||
<'font-variant'> ||
<'font-weight'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box| small-caption | status-bar | inherit |
初期値: | 個々のプロパティを見よ(下の注釈も見よ) |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | 'font-size' と 'line-height' でのみ許される(注意: SVG における 'font' プロパティの処理では、'line-height' はプロパティ 'font-size' の値に等しいものとみなされる。) |
メディア: | 視覚 |
アニメーション: | 可(非加法的。 'set' と 'animate' 要素のみ) |
Value: | [ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box| small-caption | status-bar | inherit |
Initial: | see individual properties |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | allowed on 'font-size' and 'line-height' (Note: for the purposes of processing the 'font' property in SVG, 'line-height' is assumed to be equal the value for property 'font-size') |
Media: | visual |
Animatable: | yes (non-additive, 'set' and 'animate' elements only) |
'font-style', 'font-variant', 'font-weight', 'font-size', 'line-height', 'font-family' を設定するための簡略記法のためのプロパティ。 SVG においては 'line-height' プロパティはテキスト配置に何の影響も与えない。 'font' プロパティの処理においては 'line-height' は 'font-size' プロパティの値に等しいものとみなされる。 適合 SVG ビューア には種々のシステムフォントのオプション ( caption, icon, menu, message-box, small-caption, status-bar ) のサポートは要求されておらず、システムフォントあるいは一般フォント( generic font )の一つで代用してよい。
Shorthand property for setting 'font-style', 'font-variant', 'font-weight', 'font-size', 'line-height' and 'font-family'. The 'line-height' property has no effect on text layout in SVG. For the purposes of the 'font' property, 'line-height' is assumed to be equal to the value of the 'font-size' property. Conforming SVG Viewers are not required to support the various system font options (caption, icon, menu, message-box, small-caption and status-bar) and can use a system font or one of the generic fonts instead.
この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-font] で与えられる。 CSS プロパティの値を記述する構文規則は [CSS2-propdef] を参照のこと。
Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-font]. The rules for expressing the syntax of CSS property values can be found at [ CSS2-propdef].
文字や単語の間隔に影響する3つのプロパティがある:
Three properties affect the space between characters and words:
値: | auto | <length> | inherit |
初期値: | auto |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | auto | <length> | inherit |
Initial: | auto |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
値 auto は利用されるフォントに含まれたカーニングテーブルに基づいたグリフの間隔調整をすべきであることをUAに指示する(即ち自動カーニングをする)。
The value of auto indicates that the user agent should adjust inter-glyph spacing based on kerning tables that are included in the font that will be used (i.e., enable auto-kerning).
値として <length> が与えられた場合、自動カーニングはされない。代りに与えられた <length> に間隔が設定される。自動カーニングされないように 'kerning' の値を 0 に設定することは auto 以外では最も一般的に利用される。
If a <length> is provided, then auto-kerning is disabled. Instead, inter-character spacing is set to the given <length>. The most common scenario, other than auto, is to set 'kerning' to a value of 0 so that auto-kerning is disabled.
<length> が単位識別子無しで与えられた場合(例えば 128 のような計量の無い数)、 SVG-UAは <length> を現在の利用座標系における幅の値として処理する。
If a <length> is provided without a unit identifier (e.g., an unqualified number such as 128), the SVG user agent processes the <length> as a width value in the current user coordinate system.
<length>が 単位識別子 付きで与えられた場合(例えば .25em や 1% )、 SVG-UAは <length> を 単位 述べられている規則を適用して現在の利用座標系の対応する値に換算する。
If a <length> is provided with one of the unit identifiers (e.g., .25em or 1%), then the SVG user agent converts the <length> into a corresponding value in the current user coordinate system by applying the rules described in Units.
<length> が与えられたとき、その値は 'letter-spacing' プロパティで指定される間隔の値に加えられる。
When a <length> is provided, its value is added to the inter-character spacing value specified by the 'letter-spacing' property.
値: | normal | <length> | inherit |
初期値: | normal |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | normal | <length> | inherit |
Initial: | normal |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
このプロパティは、 'kerning' プロパティによる間隔調整に対し追加的な、テキストの間隔調整の振る舞いを指定する。
This property specifies spacing behavior between text characters supplemental to any spacing due to the 'kerning' property.
SVG においては、 <length> が単位識別子無しで与えられた場合(例えば 128 のような計量の無い数)、現在の利用座標系における幅の値とみなされる。
For SVG, if a <length> is provided without a unit identifier (e.g., an unqualified number such as 128), the SVG user agent processes the <length> as a width value in the current user coordinate system.
<length>が 単位識別子 付きで与えられた場合(例えば .25em や 1% )、 SVG-UAは <length> を 単位 述べられた規則を適用して現在の利用座標系における値に換算する。
If a <length> is provided with one of the unit identifiers (e.g., .25em or 1%), then the SVG user agent converts the <length> into a corresponding value in the current user coordinate system by applying the rules described in Units.
この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-letter-spacing] で与えられる。
Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-letter-spacing].
値: | normal | <length> | inherit |
初期値: | normal |
適用対象: | テキスト内容要素 |
継承: | 有り |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | normal | <length> | inherit |
Initial: | normal |
Applies to: | text content elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
このプロパティは単語間の間隔調整の振る舞いを指定する。 SVG においては、 <length> が単位識別子無しで与えられた場合(例えば 128 のような計量の無い数)、現在の利用座標系における幅の値とみなされる。
This property specifies spacing behavior between words. For SVG, if a <length> is provided without a unit identifier (e.g., an unqualified number such as 128), the SVG user agent processes the <length> as a width value in the current user coordinate system.
<length>が 単位識別子 付きで与えられた場合(例えば .25em や 1% )、 SVG-UAは <length> を 単位 述べられた規則を適用して現在の利用座標系における対応する値に変換する。
If a <length> is provided with one of the unit identifiers (e.g., .25em or 1%), then the SVG user agent converts the <length> into a corresponding value in the current user coordinate system by applying the rules described in Units.
この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-word-spacing] で与えられる。
Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-word-spacing].
値: | none | [ underline || overline || line-through || blink ] | inherit |
初期値: | none |
適用対象: | テキスト内容要素 |
継承: | 無し(注釈を見よ) |
パーセント: | N/A |
メディア: | 視覚 |
アニメーション: | 可 |
Value: | none | [ underline || overline || line-through || blink ] | inherit |
Initial: | none |
Applies to: | text content elements |
Inherited: | no (see prose) |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
このプロパティは要素内のテキストに対する装飾について記述する。 適合 SVG ビューア は値 blink をサポートしなくともよい。
This property describes decorations that are added to the text of an element. Conforming SVG Viewers are not required to support the blink value.
この仕様で与える追加情報を除き、このプロパティの正式な定義は [CSS2-text-decoration] で与えられる。 CSS プロパティの値を記述する構文規則は [CSS2-propdef] を参照のこと。
Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-text-decoration]. The rules for expressing the syntax of CSS property values can be found at [ CSS2-propdef].
CSS2 仕様 [CSS2] では 'text-decoration' プロパティの振る舞いを「ブロックレベル要素」と「インライン要素」という用語を用いて定義している。 'text-decoration' プロパティと SVG の用途においては、 'text' 要素はブロックレベル要素を表現し、 'text' 要素の任意の子要素(例えば 'tspan' )はインライン要素を表現する。
The CSS2 specification [ CSS2] defines the behavior of the 'text-decoration' property using the terminology "block-level elements" and "inline elements". For the purposes of the 'text-decoration' property and SVG, a 'text' element represents a block-level element and any of the potential children of a 'text' element (e.g., a 'tspan') represent inline elements.
また、 CSS2 の 'text-decoration' の定義では、子孫要素に対する「装飾の色」は同じままとされている。 SVG の塗りのモデルにおいては様々な種類の塗り( 塗り:フィル, ストローク, マーカシンボル を見よ)をテキストの内部と外形線の両方に対して適用することが可能なので(即ち「フィル」と「ストローク」)、 SVG における 'text-decoration' プロパティは次のように定義される: 'text-decoration' プロパティが要素に指定されている場合、要素およびその全ての子孫要素の内容に対し、全ての装飾は同一のフィルとストロークプロパティがそれぞれの要素に存在するかのように描画され、もし 'text-decoration' プロパティが子孫要素にも指定されているならば、そちらが祖先要素のものより優先される。
Also, the CSS2 definition of 'text-decoration' specifies that the "color of the decorations" remain the same on descendant elements. Since SVG offers a painting model consisting of the ability to apply various types of paint (see Painting: Filling, Stroking and Marker Symbols) to both the interior (i.e., the "fill") and the outline (i.e., the "stroke") of text, for SVG the 'text-decoration' property is defined such that, for an element which has a specified value for the 'text-decoration' property, all decorations on its content and that of its descendants are rendered using the same fill and stroke properties as are present on the given element. If the 'text-decoration' property is specified on a descendant, then that overrides the ancestor.
SVG ではテキストに対しフィルもストローク可能なので、状況によっては描画順序がテキスト装飾に影響する。テキスト装飾の描画は次に述べる順序で行われるべきである:
Because SVG allows text to be both filled and stroked, drawing order matters in some circumstances with text decorations. Text decoration drawing order should be as follows:
Example textdecoration01 に 'text-decoration' の例をいくつか示す。図のテキストの1行目では 'text-decoration' の値が指定されていないので、初期値として 'text-decoration:none' が用いられる。2行目は 'text-decoration:line-through' を表している。3行目は 'text-decoration:underline' を表している。4行目は同じフィルとストロークのプロパティを用いる要素が 'text-decoration' を持つときにどのように装飾が描画されるかの規則を表している。 'text-decoration' は 'text' 要素に指定されているので、個々の単語が異なるフィルとストロークのプロパティ値を持っているにもかかわらず、 'text' 要素内のすべてのテキストに対し、下線は 'text' 要素に指定された同じフィルとストローク(青のフィルと赤のストローク)で描画される。しかしながら、単語 "different" には明示的に 'text-decoration' の値が設定されているので、下線は単語 "different" を囲む 'tspan' 要素のフィルとストローク(黄色のフィル, 深緑のストローク)を用いて描画される:
Example textdecoration01 provides examples for 'text-decoration'. The first line of text has no value for 'text-decoration', so the initial value of 'text-decoration:none' is used. The second line shows 'text-decoration:line-through'. The third line shows 'text-decoration:underline'. The fourth line illustrates the rule whereby decorations are rendered using the same fill and stroke properties as are present on the element for which the 'text-decoration' is specified. Since 'text-decoration' is specified on the 'text' element, all text within the 'text' element has its underline rendered with the same fill and stroke properties as exist on the 'text' element (i.e., blue fill, red stroke), even though the various words have different fill and stroke property values. However, the word "different" explicitly specifies a value for 'text-decoration'; thus, its underline is rendered using the fill and stroke properties as the 'tspan' element that surrounds the word "different" (i.e., yellow fill, darkgreen stroke):
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="12cm" height="4cm" viewBox="0 0 1200 400" xmlns="http://www.w3.org/2000/svg" version="1.1"> <desc>Example textdecoration01 - 'text-decoration' プロパティの振る舞い</desc> <rect x="1" y="1" width="1198" height="398" fill="none" stroke="blue" stroke-width="2" /> <g font-size="60" fill="blue" stroke="red" stroke-width="1" > <text x="100" y="75">Normal text</text> <text x="100" y="165" text-decoration="line-through" >Text with line-through</text> <text x="100" y="255" text-decoration="underline" >Underlined text</text> <text x="100" y="345" text-decoration="underline" > <tspan>One </tspan> <tspan fill="yellow" stroke="purple" >word </tspan> <tspan fill="yellow" stroke="black" >has </tspan> <tspan fill="yellow" stroke="darkgreen" text-decoration="underline" >different </tspan> <tspan fill="yellow" stroke="blue" >underlining</tspan> </text> </g> </svg>
![]() |
この例を SVG で見る( SVG および CSS 対応ブラウザのみ)
テキストを直線的に描くのに加えて、 SVG にはテキストを 'path' 要素の図形に沿ってテキストを配置させる機能も用意されている。テキストブロックが 'path' 要素の図形に沿って描画されるように指定するためには、 'textPath' 要素にテキストを含ませた上で、 'path' 要素への URI 参照 を xlink:href 属性に設定する。
In addition to text drawn in a straight line, SVG also includes the ability to place text along the shape of a 'path' element. To specify that a block of text is to be rendered along the shape of a 'path', include the given text within a 'textPath' element which includes an xlink:href attribute with a URI reference to a 'path' element.
<!ENTITY % SVG.textPath.extra.content "" > <!ENTITY % SVG.textPath.element "INCLUDE" > <![%SVG.textPath.element;[ <!ENTITY % SVG.textPath.content "( #PCDATA | %SVG.tspan.qname; | %SVG.tref.qname; | %SVG.altGlyph.qname; | %SVG.animate.qname; | %SVG.set.qname; | %SVG.animateColor.qname; | %SVG.Description.class; %SVG.Hyperlink.class; %SVG.textPath.extra.content; )*" > <!ELEMENT %SVG.textPath.qname; %SVG.textPath.content; > <!-- end of SVG.textPath.element -->]]> <!ENTITY % SVG.textPath.attlist "INCLUDE" > <![%SVG.textPath.attlist;[ <!ATTLIST %SVG.textPath.qname; %SVG.Core.attrib; %SVG.Conditional.attrib; %SVG.Style.attrib; %SVG.TextContent.attrib; %SVG.Font.attrib; %SVG.Paint.attrib; %SVG.Color.attrib; %SVG.Opacity.attrib; %SVG.Graphics.attrib; %SVG.Clip.attrib; %SVG.Mask.attrib; %SVG.Filter.attrib; %SVG.GraphicalEvents.attrib; %SVG.Cursor.attrib; %SVG.XLinkRequired.attrib; %SVG.External.attrib; startOffset %Length.datatype; #IMPLIED textLength %Length.datatype; #IMPLIED lengthAdjust ( spacing | spacingAndGlyphs ) #IMPLIED method ( align | stretch ) #IMPLIED spacing ( auto | exact ) #IMPLIED > |
属性定義:
Attribute definitions:
参照先の 'path' 要素内のパスデータの座標は 'path' 要素が定義される座標系ではなく、現在の 'text' 要素の座標系におけるものとみなされる。参照先の 'path' 要素の transform 属性は(もし現在の 'text' 要素にも transform 属性があれば、それによる座標系変換も含めて)現在の利用座標系に対する追加的変換を表現する。例えば次の SVG 内容文書片:
The path data coordinates within the referenced 'path' element are assumed to be in the same coordinate system as the current 'text' element, not in the coordinate system where the 'path' element is defined. The transform attribute on the referenced 'path' element represents a supplemental transformation relative to the current user coordinate system for the current 'text' element, including any adjustments to the current user coordinate system due to a possible transform attribute on the current 'text' element. For example, the following fragment of SVG content:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"> <g transform="translate(25,25)"> <defs> <path id="path1" transform="scale(2)" d="..." fill="none" stroke="red"/> </defs> </g> <text transform="rotate(45)"> <textPath xlink:href="#path1">Text along path1</textPath> </text> </svg>
は次と同じ効果をもたらすべきである:
should have the same effect as the following:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"> <g transform="rotate(45)"> <defs> <path id="path1" transform="scale(2)" d="..." fill="none" stroke="red"/> </defs> <text> <textPath xlink:href="#path1">Text along path1</textPath> </text> </g> </svg>
transform="rotate(45)"
は
'text'
とパス上のテキストから参照される図形としての
'path'
要素の利用の両方に適用される一方、
transform="translate(25,25)"
は
'textPath'
要素に対し何の効果も与えないことに注意。
Note that the transform="translate(25,25)"
has no effect on the 'textPath' element, whereas the
transform="rotate(45)"
applies to both the 'text' and the use of the 'path' element as the referenced shape for text on a path.
Example toap01 にパス上のテキストの簡単な例を示す:
Example toap01 provides a simple example of text on a path:
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="12cm" height="3.6cm" viewBox="0 0 1000 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <path id="MyPath" d="M 100 200 C 200 100 300 0 400 100 C 500 200 600 300 700 200 C 800 100 900 100 900 100" /> </defs> <desc>Example toap01 - 単純なパス上のテキスト</desc> <use xlink:href="#MyPath" fill="none" stroke="red" /> <text font-family="Verdana" font-size="42.5" fill="blue" > <textPath xlink:href="#MyPath"> We go up, then we go down, then up again </textPath> </text> <!-- 'rect' 要素によりキャンバスの外形線を表示 --> <rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" /> </svg>
![]() |
Example toap02 に、スタイル付け属性と現在のテキスト位置の調整を特定のグリフを描画する前に行うための、'textPath' 要素内での 'tspan' 要素の使い方を示す。最初の方の単語 "up" は内部を赤色に塗られる。 dy 属性は単語 "up" を基底線から持ち上げるのに用いられる。
Example toap02 shows how 'tspan' elements can be included within 'textPath' elements to adjust styling attributes and adjust the current text position before rendering a particular glyph. The first occurrence of the word "up" is filled with the color red. Attribute dy is used to lift the word "up" from the baseline.
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="12cm" height="3.6cm" viewBox="0 0 1000 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <path id="MyPath" d="M 100 200 C 200 100 300 0 400 100 C 500 200 600 300 700 200 C 800 100 900 100 900 100" /> </defs> <desc>Example toap02 - textPath 内の tspan</desc> <use xlink:href="#MyPath" fill="none" stroke="red" /> <text font-family="Verdana" font-size="42.5" fill="blue" > <textPath xlink:href="#MyPath"> We go <tspan dy="-30" fill="red" > up </tspan> <tspan dy="30"> , </tspan> then we go down, then up again </textPath> </text> <!-- 'rect' 要素によりキャンバスの外形線を表示 --> <rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" /> </svg>
![]() |
Example toap03 はテキスト文字列の開始位置をパス上の特定の位置に指定するために、 'textPath' 要素の startOffset 属性を利用している( パス上のテキストの配置規則 を見よ)。
Example toap03 demonstrates the use of the startOffset attribute on the 'textPath' element to specify the start position of the text string as a particular position along the path. Notice that glyphs that fall off the end of the path are not rendered (see text on a path layout rules).
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="12cm" height="3.6cm" viewBox="0 0 1000 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <path id="MyPath" d="M 100 200 C 200 100 300 0 400 100 C 500 200 600 300 700 200 C 800 100 900 100 900 100" /> </defs> <desc>Example toap03 - startOffset 属性を持つパス上のテキスト</desc> <use xlink:href="#MyPath" fill="none" stroke="red" /> <text font-family="Verdana" font-size="42.5" fill="blue" > <textPath xlink:href="#MyPath" startOffset="80%"> We go up, then we go down, then up again </textPath> </text> <!-- 'rect' 要素によりキャンバスの外形線を表示 --> <rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" /> </svg>
![]() |
概念的には、パス上のテキストのパスは横または縦の線分に引き張られる。横書テキストの流し込みでは、パスは開始点が線分の左端に写像されるように仮想の水平線分に引き張られる。縦書テキストの流し込みでは、パスは開始点が線分の上端に写像されるように仮想の垂直線分に引き張られる。標準の テキスト配置 規則がこの仮想の線分に適用され、その結果がパス上に逆写像される。縦書と双方向の テキスト配置 規則もパス上のテキストに適用される。
Conceptually, for text on a path the target path is stretched out into either a horizontal or vertical straight line segment. For horizontal text layout flows, the path is stretched out into a hypothetical horizontal line segment such that the start of the path is mapped to the left of the line segment. For vertical text layout flows, the path is stretched out into a hypothetical vertical line segment such that the start of the path is mapped to the top of the line segment. The standard text layout rules are applied to the hypothetical straight line segment and the result is mapped back onto the target path. Vertical and bidirectional text layout rules also apply to text on a path.
基準方位 はパスに沿って描画される各グリフに対し個別に定められる。横書テキストの流し込みでは、グリフの基準方位は、グリフが置かれるパス上の交点からのベクトルであり、交点における曲線の角度から反時計回りに 90 度の方向を指す。横書テキストの流し込みでは、グリフの基準方位は、グリフが置かれるパス上の交点からのベクトルであり、交点における曲線の角度から反時計回りに 180 度の方向を指す。
The reference orientation is determined individually for each glyph that is rendered along the path. For horizontal text layout flows, the reference orientation for a given glyph is the vector that starts at the intersection point on the path to which the glyph is attached and which points in the direction 90 degrees counter-clockwise from the angle of the curve at the intersection point. For vertical text layout flows, the reference orientation for a given glyph is the vector that starts at the intersection point on the path to which the glyph is attached and which points in the direction 180 degrees from the angle of the curve at the intersection point.
直線的な横書/縦書のテキストにおける基本的な テキスト配置 規則に対し追加的なパス上のテキストに特有の配置規則を説明するために、次の Example toap04 を以下で利用する。
Example toap04 will be used to illustrate the particular layout rules for text on a path that supplement the basic text layout rules for straight line horizontal or vertical text.
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="12cm" height="3.6cm" viewBox="0 0 1000 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <path id="MyPath" d="M 100 125 C 150 125 250 175 300 175 C 350 175 450 125 500 125 C 550 125 650 175 700 175 C 750 175 850 125 900 125" /> </defs> <desc>Example toap04 - パス上のテキストの配置規則</desc> <use xlink:href="#MyPath" fill="none" stroke="red" /> <text font-family="Verdana" font-size="60" fill="blue" letter-spacing="2" > <textPath xlink:href="#MyPath"> Choose shame or get war </textPath> </text> <!-- 'rect' 要素によりキャンバスの外形線を表示 --> <rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" /> </svg>
![]() |
次の図は 'text' 要素の最初のグリフを拡大して示したものである。
The following picture does an initial zoom in on the first glyph in the 'text' element.
図の小丸はグリフが置かれるパス上の点である。グリフを囲む四角はその点における横軸が曲線の傾きに平行になるように回転されていることを示している。この四角はグリフの 文字幅 ( charwidth - すなわちグリフが横書テキスト配置を用いて描かれるときの現在のテキスト位置の水平アドバンス量)を示している。
The small dot above shows the point at which the glyph is attached to the path. The box around the glyph shows the glyph is rotated such that its horizontal axis is parallel to the tangent of the curve at the point at which the glyph is attached to the path. The box also shows the glyph's charwidth (i.e., the amount which the current text position advances horizontally when the glyph is drawn using horizontal text layout).
次の図では配置規則の詳細を示すために更に拡大している。
The next picture zooms in further to demonstrate the detailed layout rules.
パスに沿った左から右への横書テキスト(即ちグリフ方位が 行進行方向 に垂直なとき)における配置規則は次のようになる:
For left-to-right horizontal text layout along a path (i.e., when the glyph orientation is perpendicular to the inline-progression-direction), the layout rules are as follows:
パスに沿った上から下への縦書テキストの配置(即ちグリフ方位が 行進行方向 に平行なとき)にも、相応する規則が用いられる。 配置規則は次のようになる:
Comparable rules are used for top-to-bottom vertical text layout along a path (i.e., when the glyph orientation is parallel with the inline-progression-direction), the layout rules are as follows:
上の計算において、もしパス上始点またはパス上終点がパスの端点より外にある場合は、パス上中点の算出を可能にするために、パスの端点の傾きに平行な直線により端点を越えてパスを延長する。
In the calculations above, if either the startpoint-on-the-path or the endpoint-on-the-path is off the end of the path, then extend the path beyond its end points with a straight line that is parallel to the tangent at the path at its end point so that the midpoint-on-the-path can still be calculated.
'text', 'tspan', 'tref', 'altGlyph' 要素の x 属性/ y 属性は、 行進行方向 が横方向/縦方向(同順)の場合のパスに沿う新しい絶対オフセットを表現し、パス上始点に対し明示的な新しい値を与える。横方向/縦方向の場合における、これらの要素の y 属性/ x 属性(同順)は無視される。
When the inline-progression-direction is horizontal, then any x attributes on 'text', 'tspan', 'tref' or 'altGlyph' elements represent new absolute offsets along the path, thus providing explicit new values for startpoint-on-the-path. Any y attributes on 'text', 'tspan', 'tref' or 'altGlyph' elements are ignored. When the inline-progression-direction is vertical, then any y attributes on 'text', 'tspan', 'tref' or 'altGlyph' elements represent new absolute offsets along the path, thus providing explicit new values for startpoint-on-the-path. Any x attributes on 'text', 'tspan', 'tref' or 'altGlyph' elements are ignored.
リガチャ, 特殊な用途のフォント(例えば楽譜用のフォント), アジア系テキストのための代替グリフなどのような、文字データに通常は対応しないグリフの異なるセットが必要となる状況がある。
There are situations such as ligatures, special-purpose fonts (e.g., a font for music symbols) or alternate glyphs for Asian text strings where it is required that a different set of glyphs is used than the glyph(s) which normally corresponds to the given character data.
'altGlyph' 要素は特定の文字データの描画に利用されるグリフに対する制御を提供する。
The 'altGlyph' element provides control over the glyphs used to render particular character data.
<!ENTITY % SVG.altGlyph.extra.content "" > <!ENTITY % SVG.altGlyph.element "INCLUDE" > <![%SVG.altGlyph.element;[ <!ENTITY % SVG.altGlyph.content "( #PCDATA %SVG.altGlyph.extra.content; )*" > <!ELEMENT %SVG.altGlyph.qname; %SVG.altGlyph.content; > <!-- end of SVG.altGlyph.element -->]]> <!ENTITY % SVG.altGlyph.attlist "INCLUDE" > <![%SVG.altGlyph.attlist;[ <!ATTLIST %SVG.altGlyph.qname; %SVG.Core.attrib; %SVG.Conditional.attrib; %SVG.Style.attrib; %SVG.TextContent.attrib; %SVG.Font.attrib; %SVG.Paint.attrib; %SVG.Color.attrib; %SVG.Opacity.attrib; %SVG.Graphics.attrib; %SVG.Clip.attrib; %SVG.Mask.attrib; %SVG.Filter.attrib; %SVG.GraphicalEvents.attrib; %SVG.Cursor.attrib; %SVG.XLink.attrib; %SVG.External.attrib; x %Coordinates.datatype; #IMPLIED y %Coordinates.datatype; #IMPLIED dx %Lengths.datatype; #IMPLIED dy %Lengths.datatype; #IMPLIED glyphRef CDATA #IMPLIED format CDATA #IMPLIED rotate %Numbers.datatype; #IMPLIED > |
属性定義:
Attribute definitions:
もし代替グリフへの参照の結果、利用する代替グリフの特定ができない場合、 'altGlyph' 要素内の文字が、 'altGlyph' 要素が 'tspan' 要素であるかのようにして描画される。
If the references to alternate glyphs do not result in successful identification of alternate glyphs to use, then the character(s) that are inside of the 'altGlyph' element are rendered as if the 'altGlyph' element were a 'tspan' element instead.
'altGlyph' 要素による参照先は次のどちらかで指定できる: xlink:href 属性による 'glyph' 要素または 'altGlyphDef' 要素、あるいは フォント選択プロパティ (即ちグリフ識別子とフォント形式)により特定されるグリフ。もし xlink:href 属性が指定された場合、こちらが優先され、他のグリフ識別属性/プロパティは無視される。
An 'altGlyph' element either references a 'glyph' element or an 'altGlyphDef' element via its xlink:href attribute or identifies a glyph by means of font selection properties, a glyph identifier and a font format. If the xlink:href attribute is specified, it takes precedence, and the other glyph identification attributes and properties are ignored.
'altGlyphDef' 要素は可能なグリフの置換セットを定義する。
The 'altGlyphDef' element defines a set of possible glyph substitutions.
<!ENTITY % SVG.altGlyphDef.extra.content "" > <!ENTITY % SVG.altGlyphDef.element "INCLUDE" > <![%SVG.altGlyphDef.element;[ <!ENTITY % SVG.altGlyphDef.content "(( %SVG.glyphRef.qname;+ | %SVG.altGlyphItem.qname;+ ) %SVG.altGlyphDef.extra.content; )" > <!ELEMENT %SVG.altGlyphDef.qname; %SVG.altGlyphDef.conte nt; > <!-- end of SVG.altGlyphDef.element -->]]> <!ENTITY % SVG.altGlyphDef.attlist "INCLUDE" > <![%SVG.altGlyphDef.attlist;[ <!ATTLIST %SVG.altGlyphDef.qname; %SVG.Core.attrib; > |
'altGlyphDef' は次のいずれも含ませることができる:
An 'altGlyphDef' can contain either of the following:
'altGlyphItem' 要素は可能なグリフ置換の候補の集合を定義する。参照先のグリフ全てが利用可能であるような 'altGlyphItem' 要素のうちの最初のものが選ばれる。それらのグリフたちが参照元の 'altGlyph' 要素内の文字のかわりに描画される。
The 'altGlyphItem' element defines a candidate set of possible glyph substitutions. The first 'altGlyphItem' element whose referenced glyphs are all available is chosen. Its glyphs are rendered instead of the character(s) that are inside of the referencing 'altGlyph' element
<!ENTITY % SVG.altGlyphItem.extra.content "" > <!ENTITY % SVG.altGlyphItem.element "INCLUDE" > <![%SVG.altGlyphItem.element;[ <!ENTITY % SVG.altGlyphItem.content "( %SVG.glyphRef.qname;+ %SVG.altGlyphItem.extra.con tent; )" > <!ELEMENT %SVG.altGlyphItem.qname; %SVG.altGlyphItem.content; > <!-- end of SVG.altGlyphItem.element -->]]> <!ENTITY % SVG.altGlyphItem.attlist "INCLUDE" > <![%SVG.altGlyphItem.attlist;[ <!ATTLIST %SVG.altGlyphItem.qname; %SVG.Core.attrib; > |
'glyphRef' 要素は利用可能なグリフを定義する。
The 'glyphRef' element defines a possible glyph to use.
<!ENTITY % SVG.glyphRef.element "INCLUDE" > <![%SVG.glyphRef.element;[ <!ENTITY % SVG.glyphRef.content "EMPTY" > <!ELEMENT %SVG.glyphRef.qname; %SVG.glyphRef.content; > <!-- end of SVG.glyphRef.element -->]]> <!ENTITY % SVG.glyphRef.attlist "INCLUDE" > <![%SVG.glyphRef.attlist;[ <!ATTLIST %SVG.glyphRef.qname; %SVG.Core.attrib; %SVG.Style.attrib; %SVG.Font.attrib; %SVG.XLink.attrib; x %Number.datatype; #IMPLIED y %Number.datatype; #IMPLIED dx %Number.datatype; #IMPLIED dy %Number.datatype; #IMPLIED glyphRef CDATA #IMPLIED format CDATA #IMPLIED > |
属性定義:
Attribute definitions:
'glyphRef' 要素による参照先は次のいずれかで指定できる: xlink:href 属性による SVG 文書片の 'glyph' 要素の参照、 フォント選択プロパティ (即ちグリフ識別子とフォント形式)により識別されるグリフ。もし属性やプロパティの指定がグリフの特定に不十分な場合、 'glyphRef' の処理は、グリフ参照が完全に指定されてはいるが与えられたグリフが利用不能なときと同じになる。 xlink:href 属性が指定されていた場合はそちらが優先され、他のグリフ識別属性/プロパティは無視される。
A 'glyphRef' either references a 'glyph' element in an SVG document fragment via its xlink:href attribute or identifies a glyph by means of font selection properties, a glyph identifier and a font format. If insufficient attributes and properties have been specified to identify a glyph, then the 'glyphRef' is processed in the same manner as when a glyph reference is fully specified, but the given glyph is not available. If the xlink:href attribute is specified, it takes precedence, and the other glyph identification attributes and properties are ignored.
XML の文字データにおける空白類の文字の扱いを指定するための標準 XML 属性 xml:space は、 SVG の 'text' 要素内の文字データにおいてもサポートされる。 ( エラータ :次を挿入) 'text' 要素のどの子要素もそれらのテキスト内容に適用されることになる xml:space 属性を持つことに注意。 SVG-UAは、以下で述べられるこの属性に関する特別な処理規則を持つ。これらは XML の構文解析 [XML10] と文書オブジェクトモデル [DOM2] の構築が完了した後に続く振る舞いである。
SVG supports the standard XML attribute xml:space to specify the handling of white space characters within a given 'text' element's character data. The SVG user agent has special processing rules associated with this attribute as described below. These are behaviors that occur subsequent to XML parsing [ XML10] and any construction of a Document Object Model [ DOM2].
xml:space は継承可能な属性であり、2種類の値をとれる:
xml:space is an inheritable attribute which can have one of two values:
xml:space="default"
と指定されているとき、 SVG-UAは元の文字データ内容の複製に対し次を行う:全ての改行を取り除き、全てのタブ文字をスペース文字に置き換え、先頭および末尾に在る連続するスペース文字を全て取り去り、最後に全ての連続するスペース文字は一つにまとめられる。
xml:space="default"
, the SVG user agent will do the following using a copy of the original character data content. First, it will remove all newline characters. Then it will convert all tab characters into space characters. Then, it will strip off all leading and trailing space characters. Then, all contiguous space characters will be consolidated.xml:space="preserve"
と指定されているとき、 SVG-UAは元の文字データ内容の複製に対し次を行う:すべての改行とタブ文字はスペース文字に置き換えられるが、スペース文字は先頭および末尾のもの, 連続したものも含めて、残さず描かれる。このように xml:space="preserve"
においては、文字列 "a b"
("a" と "b" の間に3つの空白)は "a b"
("a" と "b" の間に空白1つだけ)より、"a" と "b" の間が大きく空くように描かれる。
xml:space="preserve"
, the SVG user agent will do the following using a copy of the original character data content. It will convert all newline and tab characters into space characters. Then, it will draw all space characters, including leading, trailing and multiple contiguous space characters. Thus, when drawn with
xml:space="preserve"
, the string
"a b"
(three spaces between "a" and "b") will produce a larger separation between "a" and "b" than "a b"
(one space between "a" and "b").
次の例で
xml:space="default"
が利用されるときに行のインデントが重要な意味を持つことを示す。下の文書片には2つの似たような
'text'
要素の対がある。どちらの
'text'
要素にも
xml:space='default'
が利用されている。どの行の終りにも空白類はないものとする(即ち、行の最後の可視文字の直後に改行が続く)。
The following example illustrates that line indentation can be important when using xml:space="default"
. The fragment below show two pairs of similar 'text' elements, with both 'text' elements using xml:space='default'. For these examples, there is no extra white space at the end of any of the lines (i.e., the line break occurs immediately after the last visible character).
[01] <text xml:space='default'> [02] WS example [03] indented lines [04] </text> [05] <text xml:space='preserve'>WS example indented lines</text> [06] [07] <text xml:space='default'> [08]WS example [09]non-indented lines [10] </text> [11] <text xml:space='preserve'>WS examplenon-indented lines</text>
最初の 'text' 要素の対はインデントされた文字データを示している。最初の 'text' 要素の属性 xml:space='default' は、UAに次を指示する:
The first pair of 'text' elements above show the effect of indented character data. The attribute xml:space='default' in the first 'text' element instructs the user agent to:
後の方の 'text' 要素の対はインデントされていない文字データを示している。3番目の 'text' 要素の属性 xml:space='default' は、UAに次を指示する:
The second pair of 'text' elements above show the effect of non-indented character data. The attribute xml:space='default' in the third 'text' element instructs the user agent to:
XML 構文解析処理では、文字データをアプリケーションに渡す前に、改行指示の標準表現(例えば、2文字のリテラル "#xD#xA" か1文字のリテラル #xD または #xA )を単一の文字 #xA に変換することが要求されていることに注意。すなわち SVG の各改行は、元のリソースに利用されている改行表現に関係なく、一つの文字 #xA で表現される。( XML end-of-line handling 参照。)
Note that XML parsers are required to convert the standard representations for a newline indicator (e.g., the literal two-character sequence "#xD#xA" or the stand-alone literals #xD or #xA) into the single character #xA before passing character data to the application. Thus, each newline in SVG will be represented by the single character #xA, no matter what representation for newlines might have been used in the original resource. (See XML end-of-line handling.)
要素
'text',
'tspan',
'tref',
'altGlyph'
の属性
x,
y,
dx,
dy,
rotate
などの、文字の現れる順番に基づく SVG 言語または SVG DOM における仕組は、ここで述べられた空白類の処理の適用後の文字列に基づく。特に
xml:space="default"
のとき、空白文字はたいてい処理の一部として取り除かれる。テキスト文字列の各文字に対する番号付けは、この節の規則によって空白文字が取り除かれた後に行われる。
Any features in the SVG language or the SVG DOM that are based on character position number, such as the
x,
y,
dx,
dy and
rotate attributes on the
'text',
'tspan',
'tref'
'altGlyph' elements, are based on character position after applying the white space handling rules described here. In particular, if
xml:space="default"
, it is often the case that white space characters are removed as part of processing. Character position numbers index into the text string after the white space characters have been removed per the rules in this section.
xml:space 属性では:
The xml:space attribute is:
アニメーション:不可
Animatable: no.
システムがテキスト選択可能であり(例えばマウスのようなポインティング装置を装備したシステム)、コピーとペースト処理のためのクリップボードを持っている場合、 適合 SVG ビューア には次に挙げるもののサポートが要求される:
Conforming SVG viewers on systems which have the capacity for text selection (e.g., systems which are equipped with a pointer device such as a mouse) and which have system clipboards for copy/paste operations are required to support:
テキスト選択処理は次に挙げる全てが生じたときに開始される:
A text selection operation starts when all of the following occur:
テキスト選択操作の間(例えば利用者がマウスボタンを押し続ける)他のグラフィックス要素に関連するイベント全ては無視され(即ちテキスト選択操作はモダールになる)、 SVG-UAは選択されたグリフを補色で再描画するなどの適切なハイライトにより、どの文字が選択されているかを動的に表現することになる。テキスト選択操作においてマウスポインタが動きつづける間、選択部分における最後のグリフは、同じ 'text' 要素内のグリフで、グリフセルがポインタにもっとも近いものとなる。 'text' 要素内での位置が選択部分の始めと終わりの間に在るすべての文字は、キャンバス上の位置に関係なく、グラフィックス要素が選択部分の終わりの上を覆うかどうかにも関係なく、ハイライトされることになる。
As the text selection operation proceeds (e.g., the user continues to press the given mouse button), all associated events with other graphics elements are ignored (i.e., the text selection operation is modal) and the SVG user agent shall dynamically indicate which characters are selected by an appropriate highlighting technique, such as redrawing the selected glyphs with inverse colors. As the pointer is moved during the text selection process, the end glyph for the text selection operation is the glyph within the same 'text' element whose glyph cell is closest to the pointer. All characters within the 'text' element whose position within the 'text' element is between the start of selection and end of selection shall be highlighted, regardless of position on the canvas and regardless of any graphics elements that might be above the end of selection point.
一度テキスト選択操作が完了すれば(例えば利用者がマウスの押下をやめたとき)選択されたテキストは、ポインティング装置によるイベントなど(例えばマウスボタンの押下)、テキスト選択を解除するイベントが発生するまで、ハイライトし続ける。
Once the text selection operation ends (e.g., the user releases the given mouse button), the selected text will stay highlighted until an event occurs which cancels text selection, such as a pointer device activation event (e.g., pressing a mouse button).
テキスト選択操作中にどの文字をハイライトし続けるかの規則の詳細は テキスト選択の実装上の注意 で与えられる。
Detailed rules for determining which characters to highlight during a text selection operation are provided in Text selection implementation notes.
システムクリップボードを持つシステムにおいては、システムクリップボードに選択されているテキストをコピーするためのユーザーインターフェースを提供することが SVG-UAに要求される。 SVG-UAは、選択されたテキスト文字列をクリップボードに渡す際、システムにおける素のテキストのための適切なクリップボードデータ形式にするだけでも十分であるが、テキストに関連づけられた種々の フォントプロパティ を含めたリッチテキストも渡す方が好ましい。
For systems which have system clipboards, the SVG user agent is required to provide a user interface for initiating a copy of the currently selected text to the system clipboard. It is sufficient for the SVG user agent to post the selected text string in the system's appropriate clipboard format for plain text, but it is preferable if the SVG user agent also posts a rich text alternative which captures the various font properties associated with the given text string.
双方向テキストに対しては、論理順序によるテキスト選択をサポートすることがUAに要求される。この場合の選択結果は、双方向による再配列によりグリフのハイライトが不連続になり得る。UAは、双方向テキストの選択を視覚的描画順序(即ち 双方向 テキスト配置アルゴリズムが適用された後)に従うような代替の機能を提供してよいが、選択された文字データが論理順序において不連続となり得る。この場合、利用者が双方向テキストのクリップボードへのコピーを要求したときは、視覚的に選択された文字たちのみをコピーするように、適切な調整を行うことがUAに要求される。
For bidirectional text, the user agent must support text selection in logical order, which will result in discontinuous highlighting of glyphs due to the bidirectional reordering of characters. User agents can provide an alternative ability to select bidirectional text in visual rendering order (i.e., after bidirectional text layout algorithms have been applied), with the result that selected character data might be discontinuous logically. In this case, if the user requests that bidirectional text be copied to the clipboard, then the user agent is required to make appropriate adjustments to copy only the visually selected characters to the clipboard.
可能なら、 SVG ジェネレータは、ウェブブラウザのような SVG 表示ソフトウエアの中で正しく順序付けられたテキスト選択を容易にするように、テキスト文字列を順序付けることが推奨される。
When feasible, it is recommended that generators of SVG attempt to order their text strings to facilitate properly ordered text selection within SVG viewing applications such as Web browsers.
要素 | 属性 | 内容モデル |
---|---|---|
text | Core.attrib, Conditional.attrib, External.attrib, Style.attrib, transform, x, y, dx, dy, rotate, textLength, lengthAdjust, GraphicalEvents.attrib, Paint.attrib, Paint.attrib, Font.attrib, Opacity.attrib, Graphics.attrib, Cursor.attrib, Filter.attrib, Mask.attrib, GraphicalEvents.attrib, Clip.attrib, TextContent.attrib, Text.attrib | (#PCDATA | Description.class | TextContent.class | Hyperlink.class | Animation.class)* |
tspan | Core.attrib, Conditional.attrib, External.attrib, Style.attrib, x, y, dx, dy, rotate, textLength, lengthAdjust, GraphicalEvents.attrib, Paint.attrib, Paint.attrib, Font.attrib, Opacity.attrib, Graphics.attrib, Cursor.attrib, Filter.attrib, Mask.attrib, GraphicalEvents.attrib, Clip.attrib, TextContent.attrib | (#PCDATA | Description.class | TextContent.class | Hyperlink.class | Animation.class)* |
tref | Core.attrib, Conditional.attrib, External.attrib, Style.attrib, XLinkRequired.attrib, x, y, dx, dy, rotate, textLength, lengthAdjust, GraphicalEvents.attrib, Paint.attrib, Paint.attrib, Font.attrib, Opacity.attrib, Graphics.attrib, Cursor.attrib, Filter.attrib, Mask.attrib, GraphicalEvents.attrib, Clip.attrib, TextContent.attrib | (#PCDATA | Description.class | Animation.class)* |
textPath | Core.attrib, Conditional.attrib, External.attrib, Style.attrib, startOffset, textLength, lengthAdjust, method, spacing, XLinkRequired.attrib, GraphicalEvents.attrib, Paint.attrib, Paint.attrib, Font.attrib, Opacity.attrib, Graphics.attrib, Cursor.attrib, Filter.attrib, Mask.attrib, GraphicalEvents.attrib, Clip.attrib, TextContent.attrib | (#PCDATA | Description.class | TextContent.class | Hyperlink.class | Animation.class)* |
altGlyph | Core.attrib, Conditional.attrib, External.attrib, Style.attrib, x, y, dx, dy, rotate, textLength, glyphRef, format, XLink.attrib, lengthAdjust, GraphicalEvents.attrib, Paint.attrib, Paint.attrib, Font.attrib, Opacity.attrib, Graphics.attrib, Cursor.attrib, Filter.attrib, Mask.attrib, GraphicalEvents.attrib, Clip.attrib, TextContent.attrib | (PCDATA)* |
altGlyphDef | Core.attrib | (glyphRef+ | altGlyphItem+) |
altGlyphItem | Core.attrib | (glyphRef+) |
glyphRef | Core.attrib, External.attrib, Style.attrib, x, y, dx, dy, glyphRef, format, XLink.attrib, lengthAdjust, Font.attrib | Empty |
Text モジュールは Text.class と TextContent.class 内容セットを定義する。
The Text Module defines the Text.class and TextContent.class content sets.
内容セット名 | 内容セット内の要素 |
---|---|
Text.class | text, altGlyphDef |
TextContent.class | tspan, tref, textPath, altGlyph |
Text モジュールは Text.attrib, TextContent.attrib, Font.attrib 属性セットを定義する。
The Text Module defines the Text.attrib, TextContent.attrib and Font.attrib attribute sets.
コレクション名 | コレクション内の属性 |
---|---|
Text.attrib | writing-mode |
TextContent.attrib | alignment-baseline, baseline-shift, direction, dominant-baseline, glyph-orientation-horizontal, glyph-orientation-vertical, kerning, letter-spacing, text-anchor, text-decoration, unicode-bidi, word-spacing |
Font.attrib | font-family, font-size, font-size-adjust, font-stretch, font-style, font-variant, font-weight |
要素 | 属性 | 内容モデル |
---|---|---|
text | Core.attrib, Conditional.attrib, External.attrib, Style.attrib, transform, x, y, rotate, GraphicalEvents.attrib, Paint.attrib, Paint.attrib, Font.attrib, Opacity.attrib, Graphics.attrib, Cursor.attrib, Filter.attrib, Mask.attrib, GraphicalEvents.attrib, Clip.attrib, TextContent.attrib, Text.attrib | (#PCDATA | Description.class | Hyperlink.class | Animation.class)* |
次に挙げるインターフェースが以下で定義される: SVGTextContentElement, SVGTextPositioningElement, SVGTextElement, SVGTSpanElement, SVGTRefElement, SVGTextPathElement, SVGAltGlyphElement, SVGAltGlyphDefElement, SVGAltGlyphItemElement, SVGGlyphRefElement
SVGTextContentElement インターフェースは種々のテキスト関連のインターフェース: SVGTextElement, SVGTSpanElement, SVGTRefElement, SVGAltGlyphElement, SVGTextPathElement の基底インターフェースとなるものである。
このインターフェースの文字のインデックス/個数を参照するメソッドにおいて、それらの参照は UTF-16 コード単位のインデックス/個数と解釈される。これは、 DOM2 Core の CharacterData インターフェースのメソッドがインデックスと個数として文字データ内の UTF-16 コード単位を利用することとの一貫性を保つためである。従って例えば、 'text' 要素のテキスト内容が U+10000 などの1個の非 BMP 文字ならば、2つの UTF-16 コード単位(サロゲートペア)が1個の文字を表現するので、要素に対する getNumberOfChars の呼び出しでは 2 が返されることになる。
interface SVGTextContentElement : SVGElement, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGStylable, events::EventTarget { // lengthAdjust Types const unsigned short LENGTHADJUST_UNKNOWN = 0; const unsigned short LENGTHADJUST_SPACING = 1; const unsigned short LENGTHADJUST_SPACINGANDGLYPHS = 2; readonly attribute SVGAnimatedLength textLength; readonly attribute SVGAnimatedEnumeration lengthAdjust; long getNumberOfChars ( ); float getComputedTextLength ( ); float getSubStringLength ( in unsigned long charnum, in unsigned long nchars ) raises( DOMException ); SVGPoint getStartPositionOfChar ( in unsigned long charnum ) raises( DOMException ); SVGPoint getEndPositionOfChar ( in unsigned long charnum ) raises( DOMException ); SVGRect getExtentOfChar ( in unsigned long charnum ) raises( DOMException ); float getRotationOfChar ( in unsigned long charnum ) raises( DOMException ); long getCharNumAtPosition ( in SVGPoint point ); void selectSubString ( in unsigned long charnum, in unsigned long nchars ) raises( DOMException ); };
LENGTHADJUST_UNKNOWN | タイプが定義済みのものではないことを表す。新しい値にこのタイプを定めたり、既存の値をこのタイプに変更する試みは無効である。 | |
LENGTHADJUST_SPACING | 値 spacing に対応する。 | |
LENGTHADJUST_SPACINGANDGLYPHS | 値 spacingAndGlyphs に対応する。 |
long | 全文字数。 |
float | テキストアドバンス距離。 |
in unsigned long charnum | 部分文字列の最初の文字のインデックス。最初の文字がインデックス0である。 | |
in unsigned long nchars | 部分文字列の文字数。 ( エラータ :次を追加) nchars が存在する文字より多くの文字を指定している場合、部分文字列は charnum から文字列の末端までの文字からなるものとする。 |
float | テキストアドバンス距離。 |
DOMException |
INDEX_SIZE_ERR : charnum が負であるか、
|
in unsigned long charnum | 文字のインデックス。最初の文字がインデックス0である。 |
SVGPoint | 文字の開始位置。 |
DOMException |
INDEX_SIZE_ERR : charnum が負であるか、このノードの文字数以上のときにレイズされる。
|
in unsigned long charnum | 文字のインデックス。最初の文字がインデックス0である。 |
SVGPoint | 文字の終点。 |
DOMException |
INDEX_SIZE_ERR : charnum が負であるか、このノードの文字数以上のときにレイズされる。
|
in unsigned long charnum | 文字のインデックス。最初の文字がインデックス0である。 |
SVGRect | 描画された指定された文字に対応するグリフを全て囲む矩形。 |
DOMException |
INDEX_SIZE_ERR : charnum が負であるか、このノードの文字数以上のときにレイズされる。
|
in unsigned long charnum | 文字のインデックス。最初の文字がインデックス0である。 |
float | 回転角度。 |
DOMException |
INDEX_SIZE_ERR : charnum が負であるか、このノードの文字数以上のときにレイズされる。
|
in SVGPoint point | 利用空間内の点。 |
long | 与えられた点に存在する文字のインデックス。最初の文字がインデックス0である。 |
in unsigned long charnum | 選択部分における開始文字のインデックス。最初の文字がインデックス0である。 | |
in unsigned long nchars | 選択部分の文字数。 nchars が可能な文字数を超えた場合は、最後の文字まで選択される。 |
DOMException |
INDEX_SIZE_ERR : charnum または nchars が負であるか、 charnum がこのノードの文字数以上のときにレイズされる。
(
エラータ
)
|
SVGTextPositioningElement インターフェースはテキスト関連のインターフェース: SVGTextElement, SVGTSpanElement, SVGTRefElement, SVGAltGlyphElement に継承される。
interface SVGTextPositioningElement : SVGTextContentElement { readonly attribute SVGAnimatedLengthList x; readonly attribute SVGAnimatedLengthList y; readonly attribute SVGAnimatedLengthList dx; readonly attribute SVGAnimatedLengthList dy; readonly attribute SVGAnimatedNumberList rotate; };
SVGTextElement インターフェースは 'text' 要素に対応する。
interface SVGTextElement : SVGTextPositioningElement, SVGTransformable {};
SVGTSpanElement インターフェースは 'tspan' 要素に対応する。
interface SVGTSpanElement : SVGTextPositioningElement {};
SVGTRefElement インターフェースは 'tref' 要素に対応する。
interface SVGTRefElement : SVGTextPositioningElement, SVGURIReference {};
SVGTextPathElement インターフェースは 'textPath' 要素に対応する。
interface SVGTextPathElement : SVGTextContentElement, SVGURIReference { // textPath Method Types const unsigned short TEXTPATH_METHODTYPE_UNKNOWN = 0; const unsigned short TEXTPATH_METHODTYPE_ALIGN = 1; const unsigned short TEXTPATH_METHODTYPE_STRETCH = 2; // textPath Spacing Types const unsigned short TEXTPATH_SPACINGTYPE_UNKNOWN = 0; const unsigned short TEXTPATH_SPACINGTYPE_AUTO = 1; const unsigned short TEXTPATH_SPACINGTYPE_EXACT = 2; readonly attribute SVGAnimatedLength startOffset; readonly attribute SVGAnimatedEnumeration method; readonly attribute SVGAnimatedEnumeration spacing; };
TEXTPATH_METHODTYPE_UNKNOWN | タイプが定義済みのものではないことを表す。新しい値にこのタイプを定めたり、既存の値をこのタイプに変更する試みは無効である。 | |
TEXTPATH_METHODTYPE_ALIGN | 値 align に対応する。 | |
TEXTPATH_METHODTYPE_STRETCH | 値 stretch に対応する。 |
TEXTPATH_SPACINGTYPE_UNKNOWN | タイプが定義済みのものではないことを表す。新しい値にこのタイプを定めたり、既存の値をこのタイプに変更する試みは無効である。 | |
TEXTPATH_SPACINGTYPE_AUTO | 値 auto に対応する。 | |
TEXTPATH_SPACINGTYPE_EXACT | 値 exact に対応する。 |
SVGAltGlyphElement インターフェースは 'altGlyph' 要素に対応する。
interface SVGAltGlyphElement : SVGTextPositioningElement, SVGURIReference { attribute DOMString glyphRef; // raises DOMException on setting attribute DOMString format; // raises DOMException on setting };
DOMException |
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
|
DOMException |
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
|
SVGAltGlyphDefElement インターフェースは 'altGlyphDef' 要素に対応する。
interface SVGAltGlyphDefElement : SVGElement {};
SVGAltGlyphItemElement インターフェースは 'altGlyphItem' 要素に対応する。
interface SVGAltGlyphItemElement : SVGElement {};
SVGGlyphRefElement インターフェースは 'glyphRef' 要素に対応する。
interface SVGGlyphRefElement : SVGElement, SVGURIReference, SVGStylable { attribute DOMString glyphRef; // raises DOMException on setting attribute DOMString format; // raises DOMException on setting attribute float x; // raises DOMException on setting attribute float y; // raises DOMException on setting attribute float dx; // raises DOMException on setting attribute float dy; // raises DOMException on setting };
DOMException |
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
|
DOMException |
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
|
DOMException |
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
|
DOMException |
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
|
DOMException |
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
|
DOMException |
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
|