1. 序論
`CSS-FONTS-3$r 仕様は、文書の中の~fontを選定して利用するための基本的な制御~CSSを供する。 この文書では、その仕様に定義された各種~prop/規則に対する追加と改変を述べる。 ◎ The CSS3 Fonts specification ([CSS-FONTS-3]) describes the basic controls CSS provides for selecting and using fonts within documents. The ideas here are additions or modifications to the properties and rules defined in CSS3 Fonts.
~OpenType/~TrueType 可変~fontの~supportは、まだ,仕様と実装の初期~段階にあることに注意されたし。 この仕様~内に~bugがあれば ~CSSissue まで~commentを寄せられたし。 この仕様は、不完全であり, `CSS-FONTS-3$r からの~textの全部は含んでいないことに注意。 ◎ Please note that OpenType/TrueType variable font support is still in intial stages of specification and implementation. Please comment on any bugs in this spec at https://github.com/w3c/csswg-drafts/issues. Also, please note that this spec is incomplete and only includes some of the text from https://www.w3.org/TR/css-fonts-3/.
2. 基本的な~font~prop
文字を描画するために利用される,特定0の書体-は、[ その文字を内容に含む要素 ]に適用される ~font族や他の各種~font~propにより,決定される。 この構造により、これらの設定群の中の個々の設定は,互いに独立に変わり得るようになる。 ◎ The particular font face used to render a character is determined by the font family and other font properties that apply to a given element. This structure allows settings to be varied independent of each other.
【 この訳に現れる “~~書体” は、 “`typeface^en(~~活字書体)” ではなく, (より抽象的な) “`face^en” ( “~italic体”, 等々の “体” )の対訳(加えて、原文の “`font face^en” も訳では “~~書体” と略記する)。 】
2.1. ~font族: `font-family^p ~prop
◎名 `font-family@p ◎値 [ `family-name$t | `generic-family$t ]# ◎初 ~UAに依存する ◎ depends on user agent ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 いくつかの[ 文字列/ `generic-family$t ~keyword ]からなる~list ◎ a list of strings and/or <generic-family> keywords ◎順 文法に従う ◎ア 不可 ◎表終この~propは、いくつかの[ ~font族~名や汎用~族~名 ]からなる,優先順による~listを指定する。 ~font族は、様々な[ ~weight, 字幅, 斜傾度 ]を備える書体の集合を定義する。 ~CSSは、個々の書体を選定するために,族~名と他の~font~propの組合せを利用する。 ~design~appにおいて よく行われる様な[ ~style名を介する書体の選定-法 ]ではなく,この選定の仕組みにより、~fallbackが生じた際でも,ある程度 規則正しい~textual表示を得られるようになる。 ◎ This property specifies a prioritized list of font family names or generic family names. A font family defines a set of faces that vary in weight, width or slope. CSS uses the combination of a family name with other font properties to select an individual face. Using this selection mechanism, rather than selecting a face via the style name as is often done in design applications, allows some degree of regularity in textual display when fallback occurs.
成分~値の~listは~commaで区切られ,それぞれが代替候補を指示する。 ~UAは、[[ 描画される文字~用の~glyph ]を包含するような,可用な~font ]に合致するまで、族~名の~listを走査する( `~cluster照合$secを見よ)。 これにより、[ ~platformに渡る,可用な~fontの相違 ], および[ 個々の~fontから~supportされる文字~範囲の相違 ]が,許容されるようになる。 ◎ Component values are a comma-separated list indicating alternatives. A user agent iterates through the list of family names until it matches an available font that contains a glyph for the character to be rendered. (See §5.3 Cluster matching.) This allows for differences in available fonts across platforms and for differences in the range of characters supported by individual fonts.
body { font-family: Helvetica, Verdana, sans-serif; }
`Helvetica^F が可用ならば、それが描画-時に利用されることになる。 `Helvetica^F も `Verdana^F も無い場合、汎用~font族~sans-serif~fontが利用されることになる。 ◎ If Helvetica is available, it will be used when rendering. If neither Helvetica nor Verdana is present, then the generic font-family sans-serif font will be used.
~font族~名は、次の 2 つの型に分けられる: ◎ There are two types of font family names:
- `family-name@t
- 上の例の `Helvetica^F や `Verdana^F など,~font族の名前 ◎ The name of a font family, such as Helvetica or Verdana in the previous example.
- `generic-family@t
- 各 `generic-family$t ~keywordは、汎用~font候補を表現し,1 個~以上の[ ~localに`~install済み~font$のうち, 指定された汎用~fontに属するもの ]の別名として挙動する。 `generic-family$t は、作者による より特有の~font候補が可用でないときの,依拠-可能な~fallbackとして利用できる。 ◎ Each <generic-family> keyword represents a generic font choice, and behaves as an alias for one or more locally-installed fonts belonging to the specified generic font category. A <generic-family> can thus be used as a reliable fallback for when an author’s more specific font choices are not available.
- 作者には、堅牢性を向上するため,最後の代替候補として汎用~font族を付加しておくことが奨励される。 `generic-family$t は~keywordなので、引用符で括られてはならないことに注意(さもなければ、 `family-name$t として解釈される)。 ◎ Authors are encouraged to append a generic font family as a last alternative for improved robustness. Note that <generic-family> keywords cannot be quoted (otherwise they are interpreted as a <family-name>).
- 汎用~族~keywordとして,次に挙げるものが定義される — `汎用~font族$secを見よ ⇒# `serif$v, `sans-serif$v, `cursive$v, `fantasy$v, `monospace$v, `system-ui$v, `emoji$v, `math$v, `fangsong$v ◎ The following generic family keywords are defined: serif, sans-serif, cursive, fantasy, monospace, system-ui, emoji, math and fangsong. See §2.1.3 Generic font families.
2.1.1. `family-name^t の構文
`family-name$t による~font族~名は、 `string$t として引用符で括って与えるか,または[ 1 個以上の`~CSS識別子$が成す連列 ]として引用符で括らずに与えなければならない。 ◎ Font family names other than generic families must either be given quoted as <string>s, or unquoted as a sequence of one or more identifiers.
注記: したがって,引用符で括らない場合、各~tokenの先頭に在る[ 約物のほとんど/数字d ]は,~escapeする必要がある。 ◎ Note: This means most punctuation characters and digits at the start of each token must be escaped in unquoted font family names.
例えば,次に示す宣言は、どれも無効になる: ◎ To illustrate this, the following declarations are invalid:
font-family: Red/Black, sans-serif; font-family: "Lucida" Grande, sans-serif; font-family: Ahem!, sans-serif; font-family: test@foo, sans-serif; font-family: #POUND, sans-serif; font-family: Hawaii 5-0, sans-serif;
`family-name$t として識別子の連列が与えられた場合、その算出値は,連列の中の各~識別子を 1 個の~spaceで区切って順に連結して 文字列に変換した結果の名前になる。 ◎ If a sequence of identifiers is given as a <family-name>, the computed value is the name converted to a string by joining all the identifiers in the sequence by single spaces.
~escapeの誤記を避けるため、[ 空白/数字d/~hyphen以外の約物 ]を包含するような~font族~名は,引用符で括ることが推奨される: ◎ To avoid mistakes in escaping, it is recommended to quote font family names that contain white space, digits, or punctuation characters other than hyphens:
~font族を引用符で括れば,~escapeの誤記を防げる: ◎ Quoting font families prevents escaping mistakes.
body { font-family: "New Century Schoolbook", serif } <body style="font-family: '21st Century', fantasy">
`font-family$p ~keyword値(例: `inherit^v などの`~CSS全域~keyword$や, `serif$v などの `generic-family$t ~keyword)とたまたま同じになる~font族 名 は、~keywordと混同されないように,引用符で括られ~MUST。 ~UA は、これらの~keywordを[ `family-name$t 型に合致している ]と見なしては~MUST_NOT。 ◎ Font family names that happen to be the same as a font-family keyword value (e.g. CSS-wide keywords such as inherit, or <generic-family> keywords such as serif) must be quoted to prevent confusion with the keywords of the same names. UAs must not consider these keywords as matching the <family-name> type.
2.1.2. 書体と族との関係性
~font族~名は、[ 書体-の集合に付与されている名前 ]のみを指定するものであり,個々の書体は指定しない。 ◎ A font family name only specifies a name given to a set of font faces; it does not specify an individual face.
例えば,次に挙げる~fontが可用である下では、 `Futura^F は合致することになるが,`Futura_Medium^F は合致しない: ◎ For example, given the availability of the fonts below, Futura would match but Futura Medium would not:
注記: ~CSSによる[ 選定に利用される~font属性 ]の定義が,明示的に[ ~fontの分類法を定義することは意図していない。 活字~designerによる族の~ideaは、しばしば,標準の[ ~weight( `font-weight$p )/ 字幅( `font-stretch$p )/ 傾き( `font-style$p ) ]軸のみならず, 他の軸にも沿って変わり得るような,書体の集合まで拡張する。 族は、それに一意な軸に沿って変わるように,拡張し得る。 ~CSSにおける~font選定の仕組みは、単に,代用が必要とされるときに “最も近く合致するもの” を決定する仕方の一つを供するものに過ぎない。 ◎ Note: The CSS definition of font attributes used for selection are explicitly not intended to define a font taxonomy. A type designer’s idea of a family can often extend to a set of faces that vary along axes other than just the standard axes of weight (font-weight), width (font-stretch), and slant (font-style). A family can vary along axes that are unique to that family. The CSS font selection mechanism merely provides a way to determine the “closest” match when substitution is necessary.
注記: ~fontの集合をいくつかの~font族に~group化する精確な仕方は、~platformの~font管理~APIに依存して様々である。 例えば, ~Windows GDI ~APIにおいては,~groupに許容される書体~数は一つの族につき 4 個までである一方、 DirectWrite ~API, Core Text ~API他の~platform上の~APIでは,種々の[ ~weight, 字幅, 斜傾度 ]を伴う~font族が~supportされる(詳細は `~platform~font~propから~CSS~propへの対応付け$sec にて見れる)。 ◎ Note: The precise way a set of fonts are grouped into font families varies depending upon the platform font management APIs. For example, the Windows GDI API only allows four faces to be grouped into a family, while the DirectWrite API, Core Text API, and other platforms support font families with a variety of weights, widths, and slopes (see Appendix A: Mapping platform font properties to CSS properties for more details).
~font族~名がどう照合されるかについての情報は`地域化d名の照合$secを見よ。 ◎ See §5.1 Localized name matching below for information on how font-family names are matched.
2.1.3. 汎用~font族
各~汎用~font族( `generic-family$t )は、常に, 1 つ以上の合致する書体-に対応付けられ~MUST。 しかしながら,単独の汎用~font族は、[ 文字の~Unicode範囲, 包含している要素の`内容~言語$, 利用者~選好, ~system設定群, 等々 ]に基づいて,複数の活字書体から組成された書体にされても~MAY。 異なる汎用~font族が同じ使用~fontに対応付けられても~MAY。 ◎ Each generic font family must always map to at least one matched font face. However, a single generic font family may be a composite face combining different typefaces based on such things as the Unicode range of the character, the content language of the containing element, user preferences, system settings, etc. Different generic font families may map to the same used font.
~UAは、汎用~font族~用の既定の候補として,[ 下層~技術が許容する制限の中でアリな限り,それぞれの族の特徴を表す ]ような,適度なものをいくつか供するべきである。 ~UAには、[ 利用者が,汎用~font族~用の代替候補を選定できる ]ようにすることが奨励される。 ◎ User agents should provide reasonable default choices for the generic font families, that express the characteristics of each family as well as possible, within the limits allowed by the underlying technology. User agents are encouraged to allow users to select alternative faces for the generic font families.
- `serif@v
- ~serif~fontは、用字系における格式的な~text~styleを表現する。 【~serif — 描線~先端の小さな飾り】 これは,大抵[[ 終筆( `finishing stroke^en )や, 末広がり/先細りの末端 ], あるいは[ 実際に~serif化された末端仕上げ( ~slab~serifも含む) ]]を備えるような~glyphを意味するが,それらに限られない。 ~serif~fontは、概して,均衡字幅にされている。 それらは大抵、 `sans-serif$v 汎用~font族の~fontよりも,描線の太さの変動幅が大きく表示される。 ~CSSにおける語 “~serif” は、どの用字系の~fontにも適用されるものとして,利用される — [ `Mincho^F (~Japanese), `Sung^F, `Song^F (~Chinese), `Batang^F (~Korean) ]など、特定0の用字系においては,他の名前の方が馴染まれているかもしれないが。 ~Arabic用には、~Naskh~styleが — その~design~styleでなく,その~typographic上の役割に因り — `serif^v に対応することになる。 ◎ Serif fonts represent the formal text style for a script. This often means, but is not limited to, glyphs that have finishing strokes, flared or tapering ends, or have actual serifed endings (including slab serifs). Serif fonts are typically proportionately-spaced. They often display a greater variation between thick and thin strokes than fonts from the sans-serif generic font family. CSS uses the term "serif" to apply to a font for any script, although other names might be more familiar for particular scripts, such as Mincho (Japanese), Sung or Song (Chinese), Batang (Korean). For Arabic, the Naskh style would correspond to serif. This is due to its typographic role, rather than its design style.\
- この~typographic上の役割に適する どの~fontも、汎用 `serif$v 族を表現するために利用されて~MAY。 ◎ Any font that fits this typographic role may be used to represent the generic serif family.
- `sans-serif@v
- ~CSS用語としての,~sans-serif【 “~serifの~~無い” 】~fontの~glyphは、一般に,縦横の画線の太さが概ね一様で, 質素な描線の末端仕上げを備える([ ~flaring, 画線を横切る細い線【 `cross stroke^en — “t” の横線など】, その他の装飾様式 ]は伴わないような)。 ~sans-serif~fontは、概して,均衡字幅にされている。 それらは大抵、`serif$v 族の~fontより,描線の太さの変動幅は少ない。 ~CSSにおける語 “~sans-serif” は、どの用字系の~fontにも適用されるものとして,利用される — 特定0の用字系においては,他の名前 — 例えば[ `Gothic^F (~Japanese), `Hei^F (~Chinese), `Gulim^F (~Korean) ]などの方が馴染まれているかもしれないが。 ◎ Glyphs in sans-serif fonts, as the term is used in CSS, are generally low contrast (vertical and horizontal stems have the close to the same thickness) and have stroke endings that are plain (without any flaring, cross stroke, or other ornamentation). Sans-serif fonts are typically proportionately-spaced. They often have little variation between thick and thin strokes, compared to fonts from the serif family. CSS uses the term "sans-serif" to apply to a font for any script, although other names might be more familiar for particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim (Korean).\
- この~typographic上の役割に適する どの~fontも、汎用 `sans-serif$v 族を表現するために利用されて~MAY。 ◎ Any font that fits this typographic role may be used to represent the generic sans-serif family.
- `cursive@v
- ~cursive(~~筆記的)~fontの~glyphは、一般に,より格式的でない用字系~styleを利用し,その結果は、印刷物よりも,~penや絵筆で手書きされた様に見える。 例えば,絵筆に基づく~styleを利用する `Kaiti^F (~Chinese)は、~cursive~font族に分類される。 ~CSSにおける語 “~cursive” は、どの用字系の~fontにも適用されるものとして,利用される — ~font名には、[ `Chancery^F, `Brush^F, `Swing^F, `Script^F ]などの他の名前も利用されるが。 ◎ Glyphs in cursive fonts generally use a more informal script style, and the result looks more like handwritten pen or brush writing than printed letterwork. For example, Kaiti (Chinese), which uses a brush-based style, would be classified as a CSS cursive font family. CSS uses the term "cursive" to apply to a font for any script, although other names such as Chancery, Brush, Swing and Script are also used in font names.
- `fantasy@v
- ~fantasy~fontは、装飾や表情の豊かさを主とする~fontであり,文字の装飾的な, あるいは表情豊かな表現を包含する。 [ `Pi^F, `Picture^F ]などの,実際の文字を表現しない~fontは、これらには含まれない。 ◎ Fantasy fonts are primarily decorative or expressive fonts that contain decorative or expressive representations of characters. These do not include Pi or Picture fonts which do not represent actual characters.
- `monospace@v
- monospace (等幅)~fontとされるための,唯一の判定基準は、すべての~glyphが同じ固定幅を持つことである。 これは、~computer~codeの見本を描画する際に,よく利用される。 ◎ The sole criterion of a monospace font is that all glyphs have the same fixed width. This is often used to render samples of computer code.
- `system-ui@v
- この汎用~font族は、~UAが稼働している~platform上の既定の~UI~fontで,~textを描画させる。 複数の~platformを~supportする~UAは、~platformごとに異なる~fontを利用するべきである。 `system-ui$v の目的は、~web内容が~native~OSの~look-and-feelを統合できるようにすることである。 複数の~system~UI~fontを(例:異なる言語~用に)備える~platform上では、~UAは, `system-ui^v を[ 関連する~platform~UI~fontすべてを包摂するような,仮想の~font ]として扱って~MAY。 ◎ This generic font family lets text render with the default user interface font on the platform on which the UA is running. A cross-platform UA should use different fonts on its different supported platforms. The purpose of system-ui is to allow web content to integrate with the look and feel of the native OS. On platforms which have a collection of system user interface fonts (e.g. for different languages), user agents may treat system-ui as a virtual font which encompasses all the relevant platform user interface fonts.
-
他の汎用~font族と同じく,~installされた特定の~fontによる `system-ui$v 用の代用は、算出d~styleには影響しない。 ◎ As with other generic font families, the substitution of specific installed fonts for system-ui does not affect the computed style.
<div id="system-text" style="font-family: system-ui"></div> ... window.getComputedStyle(document.getElementById("system-text")).getPropertyValue("font-family");
上の~scriptは、[ 一連の~system~UI~fontを含むように, `system-ui$v がどう展開されたか ]についての知識を得るべきでない。 特に,上の~scriptに返される結果は、どの~platform上でも `system-ui^l なるべきである。 ◎ The script above should not have any knowledge of how system-ui is expanded to include a collection of system user interface fonts. In particular, the above script should yield a result of "system-ui" on every platform.
- `emoji@v
- この~font族は、絵文字~用途に意図されている。 ◎ This font family is intended for use with emoji characters.
- もっと記述を追加する。 ◎ Add more description
- `math@v
- この~font族は、数式~用途に意図されている。 ◎ This font family is intended for use with mathematical expressions.
- もっと記述を追加する。 ◎ Add more description
- `fangsong@v
- この~font族は、~Chineseの `Fang Song^F (仿宋)活字書体~用に利用される。 `Fang Song^F は、 `Song^F ( `serif$v )と `Kai^F ( `cursive$v )の合いの~~子の様な形である。 概して, `Song^F ~styleに比較して、横線は傾けられ,線端の~flourishは小さく,描線の太さの変動幅は少ない。 `Fang Song^F は、中国政府の公用~文書に利用されることが多い。 ◎ This font family is used for Fang Song (仿宋) typefaces in Chinese. Fang Song is a relaxed, indermediate form between Song (serif) and Kai (cursive). Typically, the horizontal lines are tilted, the endpoint flourishes are smaller, and there is less variation in stroke width, compared to a Song style. Fang Song is often used for official Chinese Government documents.
2.2. ~font~weight: `font-weight^p ~prop
◎名 `font-weight@p ◎値 `font-weight-absolute$t | `bolder$v | `lighter$v ◎初 `normal$v1 ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 数量的な字幅~値(記述を見よ) ◎ numeric weight value (see description) ◎順 文法に従う ◎ア `実数として$ ◎表終`font-weight$p ~propは、~font内の一連の~glyphの~weight,すなわち それらの ~~黒っぽさ/描線の太さ を指定する。 ◎ The font-weight property specifies the weight of glyphs in the font, their degree of blackness, or stroke thickness.
この~propは、次の値を受容する: ◎ This property accepts values of the following:
`font-weight-absolute@t = [`normal$v1 | `bold$v | `number$t]
各種~値の意味は,以下に与えられる: ◎ Values have the following meanings:
- `number$t
-
各数が指示する~weightは、大きいもの程,より小さいもの以上の濃さを表す。 妥当な値は, 1 以上, 1000 未満に限られ、他の値は無効になる。 数量的な値は概して、共通的に利用される~weight名に対応する: ◎ Each number indicates a weight that is at least as dark as its predecessor. Only values greater than or equal to 1, and less than or equal to 1000, are valid, and all other values are invalid. Numeric values typically correspond to the commonly used weight names below.
- `100@v — Thin 【最も細い/薄い/軽い】
- `200@v — Extra Light (Ultra Light)
- `300@v — Light (細字)
- `400@v — Normal (通常)
- `500@v — Medium
- `600@v — Semi Bold (Demi Bold)
- `700@v — Bold (太字)
- `800@v — Extra Bold (Ultra Bold)
- `900@v — Black (Heavy) 【最も太い/濃い/重い】
- 注記: ~fontは,~weight名への自前の対応付けを内部的に供することもあるが、そのような対応付けは,~CSSにおいては無視rされる。 ◎ Note: A font might internally provide its own weight name mappings, but those mappings within the font are disregarded in CSS.
- `normal@v1
- `400^v と同じ。 ◎ Same as 400.
- `bold@v
- `700^v と同じ。 ◎ Same as 700.
- `bolder@v
- 継承値より~boldな~weightを指定する。 `相対~weight$secを見よ。 ◎ Specifies a bolder weight than the inherited value. See §2.2.1 Relative Weights.
- `lighter@v
- 継承値より~lightな~weightを指定する。 `相対~weight$secを見よ。 ◎ Specifies a lighter weight than the inherited value. See §2.2.1 Relative Weights.
9 段でない 等級 を利用する~font形式は、その等級を[ 400 が概ね[ `Regular^F, `Book^F, `Roman^F ]に~labelされる書体に対応し, 700 が概ね[ `Bold^F ]に~labelされる書体に合致する ]ように,~CSSの等級へ対応付けるべきである。 あるいは、~style名から,前述の等級に概ね対応する~weightが推定されてもよい。 等級は相対的であり、より大きな~weight値を伴う書体が,より~lightに現れては~MUST_NOT。 ~weightの推定-時に,~style名が利用される場合、[ ~localeに渡る,~style名の~variation ]の取扱いに注意を払うべきである。 ◎ Font formats that use a scale other than a nine-step scale should map their scale onto the CSS scale so that 400 roughly corresponds with a face that would be labeled as Regular, Book, Roman and 700 roughly matches a face that would be labeled as Bold. Alternately, weights may be inferred from style names that correspond roughly with the scale above. The scale is relative, so a face with a larger weight value must never appear lighter. If style names are used to infer weights, care should be taken to handle variations in style names across locales.
2.2.1. 相対~weight
[ `bolder$v / `lighter$v ]による指定値は、親~要素の~weightに相対的な~weightを指示する。 ~weightの算出値は、下の表を利用して, `font-weight$p の継承値に基づいて計算される: ◎ Specified values of bolder and lighter indicate weights relative to the weight of the parent element. The computed weight is calculated based on the inherited font-weight value using the chart below.
継承値 | `bolder^v | `lighter^v |
---|---|---|
100 未満 | 400 | 変化しない |
100 以上, 350 未満 | 400 | 100 |
350 以上, 550 未満 | 700 | 100 |
550 以上, 750 未満 | 900 | 400 |
750 以上, 900 未満 | 900 | 700 |
900 以上, | 変化しない | 700 |
注記: 上の一覧は、 ~normal, ~bold に加えて ~thin, ~heavy の書体も包含している~font族が与えられている下での,相対的に次に ~bold/~light な書体の選定-法に、等価である。 作者は、要素に利用される正確な~weight値についての,より精緻な制御を欲するなら、相対~weightの代わりに,数量的な値を利用できる。 ◎ Note: The table above is equivalent to selecting the next relative bolder or lighter face, given a font family containing normal and bold faces along with a thin and a heavy face. Authors who desire finer control over the exact weight values used for a given element can use numerical values instead of relative weights.
2.2.2. 欠落中の~weight
特定0の~font族に対し,限られた少数の~weightしか可用でないことは、ごく普通にあり得る。 存在しない書体に対する~weightが指定されたときは、それに近い~weightによる書体が利用される。 一般に、~bold~weightのものは より重い~weightの書体に,~light~weightのものは より軽い~weightの書体に対応付けられる(精確な定義については,`~font照合~algo$secを見よ) )。 ◎ Quite often there are only a few weights available for a particular font family. When a weight is specified for which no face exists, a face with a nearby weight is used. In general, bold weights map to faces with heavier weights and light weights map to faces with lighter weights. (See the §5 Font Matching Algorithm for a precise definition.)
次の例に、それぞれの~weightにどの書体が利用されるかを図解する。 灰色のものは、欲される~weight用の書体が存在しないので,それに近い~weightによる書体が利用されることを指示する: ◎ The examples here illustrate which face is used for different weights. Grey indicates that a face for the desired weight does not exist, so a face with a nearby weight is used.
ほとんどの~UAは、~fontは特定0の~weightを持つものとして,~model化する。 それは、上に述べた 9 段の等級のうちいずれかに対応することが多い。 これは,ほとんどの~fontについて成立するが、中には,ある範囲の~weightを~supportするために環境設定-可能な~fontもある。 この状況においては、~UAは,要請された~weightにアリな限り近い~weightを伴う書体を利用する(精確な~algoについては`~font照合~algo$secを見よ)。 特に,ある範囲の~weightを~supportする~fontを利用している~UAは、範囲~内の個々の~weight用の~fontが在ったかのように挙動するべきである。 異体を利用する[ ~TrueType/~OpenType ]~font用には、 `wght^tag 異体が 様々な~weightを実装するときに利用される。 端数の~weightも妥当である。 ◎ Most user agents model a font as having a particular weight which often corresponds to one of the numbers in the nine-step scale described above. While this is true of most fonts, some fonts might be configurable so as to support a range of weights. In this situation, the user agent uses a face with a weight as close as possible to the weight requested (see §5 Font Matching Algorithm for the precise algorithm). In particular, a user agent using a font which supports a range of weights should behave the same as if a font is present at each individual weight in the range. For TrueType / OpenType fonts that use variations, the wght variation is used to implement varying weights. Fractional weights are valid.
~typographer達からは あまり好まれていない慣行だが、~bold体fは,実際の~bold体fを欠く族に,~UAにより合成されることが多い。 ~font照合の目的においては、これらの書体は,それらが族~内に存在しているかのように扱われ~MUST。 作者は、 `font-synthesis$p ~propを利用して,この挙動を明示的に避けることもできる。 ◎ Although the practice is not well-loved by typographers, bold faces are often synthesized by user agents for families that lack actual bold faces. For the purposes of font matching, these faces must be treated as if they exist within the family. Authors can explicitly avoid this behavior by using the font-synthesis property.
2.3. ~fontの字幅: `font-stretch^p ~prop
◎名 `font-stretch@p ◎値 `normal^v | `percentage$t | `ultra-condensed$v | `extra-condensed$v | `condensed$v | `semi-condensed$v | `semi-expanded$v | `expanded$v | `extra-expanded$v | `ultra-expanded$v ◎初 `normal$v1 ◎適 すべての要素 ◎継 される ◎百 解決されない ◎ Not resolved ◎算 百分率 ◎順 文法に従う ◎ア `百分率として$ ◎表終`font-stretch$p ~propは、~font族から[ ~normal / ~condensed / ~expanded ]体fを選定する。 値には、百分率, または 次に定義されるように百分率に対応付けられる各種~keyword を指定できる: ◎ The font-stretch property selects a normal, condensed, or expanded face from a font family. Values are specified either as percentages or as keywords which map to a percentage as defined in the following table:
絶対~keyword値 ◎ Absolute keyword value | 数量的な値 ◎ Numeric value |
---|---|
`ultra-condensed@v | 50% |
`extra-condensed@v | 62.5% |
`condensed@v | 75% |
`semi-condensed@v | 87.5% |
`normal@v1 | 100% |
`semi-expanded@v | 112.5% |
`expanded@v | 125% |
`extra-expanded@v | 150% |
`ultra-expanded@v | 200% |
`percentage$t 値は、~glyphの字幅の割合分を表現する。 `100%^v は(~font~designerにより定義された)“通常の( `normal^v )” ~glyph字幅を表現する。 0% 未満の値は`無効$になる。 ◎ <percentage> values represent the fractional width of the glyphs, with 100% representing “normal” glyph widths (as defined by the font designer). Values less than 0% are invalid.
所与の字幅~用の書体が存在しない下では、[ 100% 未満の値は より幅狭な書体 / 他の値は より幅広な書体 ]に対応付けられる(存在するならば)。 逆に言えば、[ 100% 以上の値は より幅広な書体 / 他の値は より幅狭な書体 ]に対応付けられる。 一部の~fontは、ある範囲の~stretch値を~supportする — 要請された~stretch値が当の~fontには可用でない場合、同じ対応付け規則を利用して,~supportする値のうち最も近いものが利用される(精確な~algoは`~font照合~algo$secを見よ)。 異体を~supportする[ ~TrueType/~OpenType ]~font用には、 様々な字幅を実装するときに `wdth^tag 異体が利用される。 ◎ When a face does not exist for a given width, values less than 100% map to a narrower face if one exists, otherwise a wider face. Conversely, values greater than or equal to 100% map to a wider face if one exists, otherwise a narrower face. Some fonts might support a range of stretch values; if the requested stretch value is not available in the font, the closest supported value is used, using the same mapping rules (see the §5 Font Matching Algorithm for the precise algorithm). For TrueType / OpenType fonts that support variations, the wdth variation is used to implement varying widths.
下の図に、種々の離散的~字幅を包含している~font族に対し, 9 種の `font-stretch$p ~prop設定のそれぞれが~font照合に与える影響を示す — 灰色のものは、字幅に対応する書体が存在せず,異なる字幅で代用されることを指示する: ◎ The figure below shows how nine font-stretch property settings affect font matching for a font family containing a variety of discrete widths. Grey indicates a width for which no face exists and a different width is substituted:
~UAは、実際に~stretchされた書体を欠く~font族~用に~stretchされた書体を合成しては~MUST_NOT。 ◎ User Agents must not sythesize stretched faces for font families which lack actual stretched faces.
`CSS-FONTS-3$r との互換性を得るため、 `getComputedStyle()$m は,いずれかの `font-stretch$p ~keywordに対応する値を( `percentage$t としてではなく)その~keywordとして直列化する。 ◎ For compatibility with [CSS-FONTS-3], getComputedStyle() serializes values that correspond to one of the font-stretch keywords as that keyword (instead of as a <percentage>).
2.4. ~font~style: `font-style^p ~prop
◎名 `font-style@p ◎値 `normal$v1 | `italic$v | `oblique$v `angle$t? ◎初 `normal$v1 ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎順 文法に従う ◎ア "from", "to" 値とも `oblique^v ならば `angle$t による`実数として$。 他の場合は不可。 ◎ If both "from" and "to" values are "oblique", then yes, as an <angle>. Otherwise, no. ◎表終`font-style$p ~propは,[ ~italic体fや~oblique体f ]の選定を可能にする。 一般に、~italic形は生来的に筆記的である一方,~oblique体fは 概して~regular体fの斜傾~versionである。 ◎ The font-style property allows italic or oblique faces to be selected. Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face.
人工的に斜傾にされた[ `Palatino^F `a^c と `Baskerville^F `N^c ](灰色で示される)と, 実際の~italic~versionとの,描画の比較: ◎ Compare the artificially sloped renderings of Palatino "a" and Baskerville "N" in grey with the actual italic versions:
各種~値の意味は,以下に与えられる: ◎ Values have the following meanings:
- `normal@v1
- [ ~italic体fでも, ~oblique体fでもない,~normal体f(“通常~体f”)に分類される書体 ]と照合される。 これは、~oblique値 `0^v を表現する。 ◎ Matches against a face that is classified as a normal face, one that is neither italic or obliqued. This represents an oblique value of "0".
- `italic@v
- ~italic体fとして~labelされている~fontと照合され,存在しないときは~oblique体fと照合される。 ◎ Matches against a font that is labeled as an italic face, or an oblique face if one does not exist.
- `oblique@v `angle$t?
- ~oblique体fとの照合を制御する。 正の `angle^t は時計回りの傾きを表現する。 負の `angle^t は反時計回りの傾きを表現する。 `angle$t が与えられていない場合、 `14deg^v を表現する。 (~fontは,~oblique用に自前の対応付けを内部的に供するかもしれないが、そのような対応付けは無視rされることに注意。) 小数や負の値も受容されるが、 `-90deg^v 〜 `90deg^v に入らない値は`無効$になる。 ~oblique体fが存在しない場合、この値は~italic体fと照合され得る。 ◎ Controls matching against an oblique face. Positive angles represent a clockwise slant; negative angles represent a counter-clockwise slant. The lack of an <angle> represents 14deg. (Note that a font might internally provide its own mapping for "oblique", but the mapping within the font is disregarded.) Fractional and negative values are accepted; however, values less than -90deg or values greater than 90deg are invalid. If no oblique faces exist, this value can match an italic face.
~font族は、[ ~italic体f, ~oblique体f ]の片方または両方とも包含しないこともあれば,互いに斜度が異なる様々な~oblique体fを包含することもある。 ~font照合~algoは、利用する~fontとして,要請された斜度に最も近いものを選定することになる。 一般に、要請された斜度が `20deg^v 以上ならば,より大きい斜度が選好され、他の場合は より小さい斜度が選好される(`~font照合~algo$secを見よ)。 異体を利用する[ ~TrueType/~OpenType ]~font用には、 `slnt^tag 異体が~oblique値を実装するために利用され,値 1 をとる `ital^tag 異体が~italic値を実装するために利用される。 ◎ A font family might contain no italic or oblique faces, only an italic face and no oblique, only an oblique face and no italic, both an oblique and an italic, multiple oblique faces at various angles, or various combinations thereof. The font matching routine will select a font to use which is closest to the requested angle. In general, for a requested angle greater or equal to 20deg, larger angles are prefered; otherwise, smaller angles are preferred. (See §5 Font Matching Algorithm.) For TrueType / OpenType fonts that use variations, the slnt variation is used to implement oblique values, and the ital variation with a value of 1 is used to implement the italic values.
~obliqueより~normalを選好する閾値は、平均~斜度【すなわち, `20deg^v 】 より低くされるべきである。 ◎ The threshold for preferring oblique over normal should be lower than the average angle.
縦組において[ 正の/負の ]~obliqueが斜傾する方向は、どっちにするべきか? ~~他方の次元において(縦組~用に必要な)斜傾-を達成するにはどうする? ◎ What direction should positive and negative obliques skew in vertical writing mode? How do we achieve skews in the opposite dimension (needed for vertical writing)?
~italic体fと~oblique体fともに可用でない場合、~oblique体fは,[ 非~oblique体fを用いた,人工的な~oblique化~演算を伴う描画 ]により合成されても~MAY。 これらの人工的な~oblique化された書体の利用は、 `font-synthesis$p ~propにより不能化できる。 ◎ If no italic or oblique face is available, oblique faces may be synthesized by rendering non-obliqued faces with an artificial obliquing operation. The use of these artificially obliqued faces can be disabled using the font-synthesis property.
注記: ~oblique体fは,~regular体fの~glyphを人工的に傾けて模造できるが、これは真の~obliqueと等価ではない — 真の~obliqueは、外見的な描線~太さを傾きにかかわらず適正に保全する。 合成的な~versionに依拠するより,実際の~oblique~fontを利用する方が常に良い。 ◎ Note: While oblique faces can be simulated by artificially sloping the glyphs of the regular face, this is not equivalent to a true oblique, in which optical stroke thicknesses are properly preserved despite the slant. It is always better to use an actual oblique font rather than rely on a synthetic version.
~font照合の目的においては、~UAは, `italic$v を `oblique^v の同義語として扱っても~MAY。 これらの値を別個に扱う~UAは、 `italic^v 用の合成を遂行しては~MUST_NOT。 ◎ For the purposes of font matching, User Agents may treat italic as a synonym for oblique. For User Agents that treat these values distinctly, synthesis must not be performed for italic.
注記: 作者は、~Cyrillicのような用字系においては、合成-による~~近似が形状として~italic形と著しく異なり,相応しくない場合もあることを意識しておくべきである。 合成的な~versionに依拠するよりも,実際の~italic~fontを利用する方が常に良い。 ◎ Note: Authors should also be aware that synthesized approaches might not be suitable for scripts like Cyrillic, where italic forms are very different in shape. It is always better to use an actual italic font rather than rely on a synthetic version.
注記: 多くの用字系では、~normal体fで描画される~text内に筆記的な形を混在させる慣習がない。 ~Chinese/~Japanese/~Korean の~fontは、ほとんど常に,~italic体fや~oblique体fを欠いている。 また、用字系の混在を~supportする~fontでは、~italic体fの中で~supportされる~glyphの集合から,~Arabicなどの特定の用字系が省略されることがある。 ~UAは、いくつかの~fontによる合成を実装するときには,各~書体の`文字map$について何を前提とするか注意深くあるべきである — 同じ族~内の~italic体fと `Roman^F 体fの`文字map$は異なることもあるので。 ◎ Note: Many scripts lack the tradition of mixing a cursive form within text rendered with a normal face. Chinese, Japanese and Korean fonts almost always lack italic or oblique faces. Fonts that support a mixture of scripts will sometimes omit specific scripts, such as Arabic, from the set of glyphs supported in the italic face. User agents should be careful about making character map assumptions across faces when implementing synthesis across fonts, as italic faces in a family can have different character maps than Roman faces.
2.5. ~font~size: `font-size^p ~prop
◎名 `font-size@p ◎値 `absolute-size$t | `relative-size$t | `length-percentage$vt ◎初 `medium$v ◎適 すべての要素 ◎継 される ◎百 親~要素の~font~sizeに相対的 ◎ refer to parent element’s font size ◎算 `font-min-size$p, `font-max-size$p で切詰められた,絶対~長さ ◎ an absolute length, as clamped by font-min-size and font-max-size ◎順 文法に従う ◎ア `長さとして$ ◎表終この~propは、~fontの~glyphの,欲される高さを指示する。 ~scalableな~fontに対しては、`font-size^p は,~fontの~EM単位に適用される拡縮率になる。 ~scalableでない~fontに対しては、`font-size^p は,絶対~単位に変換された上で[ ~font内で宣言されている~font-size ]に対して照合される — 両者の値に同じ絶対的な座標系を利用する下で。 ◎ This property indicates the desired height of glyphs from the font. For scalable fonts, the font-size is a scale factor applied to the EM unit of the font. For non-scalable fonts, the font-size is converted into absolute units and matched against the declared font-size of the font, using the same absolute coordinate space for both of the matched values.
注記: ~glyphが~EM~boxに どこまで近く収まるべきかについての要件は無い。 同じ `font-size$p で描画される下での,見かけの~sizeは、個々の~fontごとに異なる。 加えて、~EM~boxから遠く外側へ描画される~glyphもあるかもしれない — そのように~overflowする~glyphは、`包含塊$において`~ink~overflow$を誘引し得る。 ◎ Note: There is no requirement on how closely a glyph should fit its EM box. Individual fonts can have a different apparent visual size when rendered at the same font-size. Additionally, glyphs might render arbitrarily far outside their EM box; and if they overflow their containing block can induce ink overflow.
各種~値の意味は,以下に与えられる: ◎ Values have the following meanings:
- `absolute-size@t
- 各種 `absolute-size^t ~keywordは、[ ~UAにより算出され, 保たれる,一連の~font~sizeからなる一覧(`~size対応表$を見よ) ]の中の,ある~entryを指す。 ◎ An <absolute-size> keyword refers to an entry in a table of font sizes computed and kept by the user agent. See §2.5.1 Absolute Size Keyword Mapping Table.
-
アリな値は: ◎ Possible values are:
[ `xx-small$v | `x-small$v | `small$v | `medium$v | `large$v | `x-large$v | `xx-large$v ]
- `relative-size@t
- `relative-size$t による~keywordは、親~要素の `font-size$p の算出値に相対的に — および、場合によっては`~size対応表$に基づいて — 解釈される。 ◎ A <relative-size> keyword is interpreted relative to the computed font-size of the parent element and possibly the table of font sizes.\
-
アリな値は: ◎ Possible values are:
[ `larger@v | `smaller@v ]
- 親~要素の~font~sizeが`~size対応表$内のある~keywordに対応している場合、[ `larger^v / `smaller^v ]は,その対応表~内の[ 前/後 ]の~keywordに対応する~font~sizeに算出されても~MAY。 例えば、親~要素の~font~sizeが `medium$v の下で,値 `larger^v を指定したときには、子~要素の~font~sizeは `large^v にされても~MAY。 ◎ If the parent element has a keyword font size in the absolute size keyword mapping table, larger may compute the font size to the next entry in the table, and smaller may compute the font size to the previous entry in the table. For example, if the parent element has a font size of medium, specifying a value of larger may make the font size of the child element large.
- ~UAは、前項の対応表に従う代わりに,単純な比率を利用して親~要素に相対的な~font~sizeを[ 増やして/減らして ]も~MAY。 特定の比率は指定されないが、 1.2 〜 1.5 あたりにするべきである。 この比率は、要素ごとに変えても~MAY。 ◎ Instead of using next and previous items in the previous keyword table, User Agents may instead use a simple ratio to increase or decrease the font size relative to the parent element. The specific ratio is unspecified, but should be around 1.2–1.5. This ratio may vary across different elements.
- 注記: 弱視-利用者は、読み易くなるよう,既定より高い比率を利用するよう~UAに要請することもある。 加えて、~UAは,段落~textを検出したときは — ~title~textに反して — 異なる比率を利用しても~MAY。 ◎ Note: A sight-impared user may request a User Agent use a higher ratio than default, in order to aid readability. In addition, a User Agent may choose to use different ratios when it detects paragraph text as opposed to title text.
- `length-percentage$t
- 長さ値は,(`~size対応表$に依存しない)絶対~font~sizeを指定する。 負の長さは無効になる。 ◎ A length value specifies an absolute font size (independent of the user agent’s font table). Negative lengths are invalid.
- 百分率~値は、親~要素の `font-size$p の算出値に相対的な,絶対~font~sizeを指定する。 負の百分率は無効になる。 ◎ A percentage value specifies an absolute font size relative to the parent element’s computed font-size. Negative percentages are invalid.
- 注記: [ 百分率~値, または`~fontに相対的な長さ$ ]の利用は、~stylesheetを,より堅牢で~cascade可能なものにする。 ◎ Note: Use of percentage values or font-relative lengths such as ems and rems leads to more robust and cascadable style sheets.
次の~stylesheetは、~font~sizeを指定する様々な仕方を例示する ◎ The following style sheet demonstrates various ways of specifying the font size.
p { font-size: 12pt; } blockquote { font-size: larger } em { font-size: 150% } em { font-size: 1.5em }
注記: この~propの算出値は、[ `font-min-size$p, `font-max-size$p ]の算出値で切詰められる。 加えて,この~propの使用値は、 `font-size-adjust$p に因り,算出値から相違し得る。 しかしながら、子~要素は `font-size$p の算出値を継承し, `font-size-adjust$p は影響しない(さもなければ、 `font-size-adjust$p による効果は~~複雑になるであろう)。 ◎ Note: The computed value of this property is clamped by the computed values of font-min-size and font-max-size. Furthermore, the used value of this property can differ from its computed value due to font-size-adjust. However, child elements inherit the computed font-size value, which is not affected by font-size-adjust (otherwise, the effect of font-size-adjust would compound).
注記: この~propの`実際の値$は、ある種の~font~sizeが可用でないことに因り,使用値から相違し得る。 ◎ The actual value of this property can differ from the used value due to the unavailability of certain font sizes.
2.5.1. 絶対~size~keywordの対応付け~table
次の一覧に、絶対~sizeの拡縮率を[ ~HTML~heading / 絶対~font-size ]に対応付けるための,~UAへの指針を供する。 値 `medium^v は,基準~になる中央~値として利用される。 ~UAは、異なる~fontや異なる型の表示~機器のそれぞれに対し,これらの値をより精緻に~~調整しても~MAY。 ◎ The following table provides user agent guidelines for the absolute-size scaling factor and their mapping to HTML heading and absolute font-sizes. The medium value is used as the reference middle value. The user agent may fine-tune these values for different fonts or different types of display devices.
`xx-small@v | `x-small@v | `small@v | `medium@v | `large@v | `x-large@v | `xx-large@v | ||
---|---|---|---|---|---|---|---|---|
拡縮率 | 3/5 | 3/4 | 8/9 | 1 | 6/5 | 3/2 | 2/1 | 3/1 |
~HTML~heading | `h6^e | `h5^e | `h4^e | `h3^e | `h2^e | `h1^e |
【 原文のこの表には,廃用にされた~HTML `font^e 要素の(各 `size^a 属性~値たちからなる)行もあるが、和訳では省略する。 】 ◎ HTML font sizes | 1 | - | 2 | 3 | 4 | 5 | 6 | 7
注記: CSS1 においては、隣の~sizeに~~相対的な拡縮率には 1.5 が示唆されていたが,利用者~体験から,大き過ぎるものと判明した。 CSS2 においては、~computer~screen用に示唆される,隣の~sizeに~~相対的な拡縮率は 1.2 であったが、依然として,小さい~sizeにおいて~~問題があった。 新たな拡縮率は、可読性をより良くするため,各~sizeの合間ごとに変わり得る。 ◎ Note: In CSS1, the suggested scaling factor between adjacent indexes was 1.5, which user experience proved to be too large. In CSS2, the suggested scaling factor for computer screen between adjacent indexes was 1.2 which still created issues for the small sizes. The new scaling factor varies between each index to provide a better readability.
可読性を保全するため、~UAは,この指針を適用する下でも,[ ~EM単位あたり 9 機器~画素を下回るような~font~size ]を創出しないようにするべきである。 ◎ To preserve readability, an UA applying these guidelines should nevertheless avoid creating font sizes of less than 9 device pixels per EM unit.
2.6. 最小 /最大~font~size: `font-min-size^p / `font-max-size$p ~prop
◎名 `font-min-size@p ◎値 `absolute-size$t | `relative-size$t | `length-percentage$t ◎初 `0^v ◎適 すべての要素 ◎継 される ◎百 親~要素の~font~sizeを基準にする ◎ refer to parent element’s font size ◎算 絶対~長さ ◎順 文法に従う ◎ア `長さとして$ ◎表終 ◎名 `font-max-size@p ◎値 `absolute-size$t | `relative-size$t | `length-percentage$t | `infinity^v ◎初 `infinity^v ◎表終`font-max-size$p の適用対象~以下の欄は、 `font-min-size$p と同じ 【なので、この訳では省略する】 。 ◎ Applies to: all elements Inherited: yes Percentages: refer to parent element’s font size Media: visual Computed value: absolute length Canonical order: per grammar Animatable: As <length>
これらの 2 つの~propは、作者や利用者が,[ 要素の~font~sizeを指定した範囲に切詰める ]よう要求できるようにする。 `font-size$p の指定値が[ `font-min-size$p / `font-max-size$p ]の使用値から得られる限界域の外側にある場合、 `font-size^p の算出値は,その範囲内に切詰められる。 ◎ These two properties allow an author or user to require that an element’s font size be clamped within the specified range. If the specified value font-size is outside the bounds created by the used font-min-size and font-max-size, the computed value of font-size is clamped to the values specified in these two properties.
`font-min-size$p の算出値が `font-max-size$p の算出値より大きい場合、後者の使用値は,前者のそれに合致するよう増やされる。 ◎ If the computed font-min-size is larger than the computed font-max-size, then the used font-max-size is increased to match the font-min-size.
一部の~UAは、 `font-size$p の算出値と使用値との間に標準でない対応付けを供する。 そのような標準でない~algoと[ `font-min-size$p / `font-max-size$p ]との相互作用は、明示的に未定義である。 ◎ Some user agents provide a non-standard mapping between the computed value of font-size and the used value of font-size. The interaction of those nonstandard algorithms with font-min-size or font-max-size is explicitly undefined.
注記: 利用者は、`利用者~stylesheet$内で これらの~propに `!important^css 規則を設定して,~web~siteの~textを — ~accessibility上の選好に応じて — より[ 大きく/小さく ]するよう強制できる。 ◎ Note: Users with accessibility preferences can set these properties as !important rules in a user style sheet to force websites‘ text to become larger or smaller.
2.7. 相対的~sizing: `font-size-adjust^p ~prop
◎名 `font-size-adjust@p ◎値 `none$v1 | `number$vt ◎初 `none$v1 ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎順 文法に従う ◎ア `実数として$ ◎表終所与のどの~font~sizeに対しても、[ 見かけの~size/~textの実質的な判読し易さ ]は,~fontごとに様々である。 ~Latinや~Cyrillicなどの,大小文字を区別する用字系においては、小文字の,対応する大文字に相対的な高さが、判読し易さを決定する要因の一つになる。 この比率は、一般に `~aspect値@ と呼ばれ,~fontの`~x-height$を~font~sizeで除算した結果として定義される。 ◎ For any given font size, the apparent size and effective legibility of text varies across fonts. For scripts such as Latin or Cyrillic that distinguish between upper and lowercase letters, the relative height of lowercase letters compared to their uppercase counterparts is a determining factor of legibility. This is commonly referred to as the aspect value and is equal to the x-height of a font divided by the font size.
~font~fallbackが生じる状況~下では、~fallback~fontが,欲された~font族と同じ`~aspect値$を共有しないかもしれず、従って,読み難くなることもある。 `font-size-adjust$p ~propは、~font~fallbackが生じたときでも ~textの可読性を保たせる方法を与える。 これは、~font-sizeを[ その`~x-height$が,利用される~fontに関わらず同じになる ]ように調整することにより行われる。 ◎ In situations where font fallback occurs, fallback fonts might not share the same aspect value as the desired font family and will thus be less readable. The font-size-adjust property is a way to preserve the readability of text when font fallback occurs. It does this by adjusting the font-size so that the x-height is the same regardless of the font used.
下に定義される~styleは,欲される~font族として `Verdana^F を定義するが、それが可用でない場合は,`Futura^F または `Times^F が利用されることになる: ◎ The style defined below defines Verdana as the desired font family, but if Verdana is not available Futura or Times will be used.
p { font-family: Verdana, Futura, Times; } <p>Lorem ipsum dolor sit amet, ...</p>
`Verdana^F の`~aspect値$は比較的~高く,小文字は大文字に比して背が高いので、小~sizeの~textは より判読し易く現れる。 `Times^F の`~aspect値$はより低いので、~fallbackが生じた場合,小~sizeの~textは `Verdana^F より判読し難くなる。 ◎ Verdana has a relatively high aspect value, lowercase letters are relatively tall compared to uppercase letters, so at small sizes text appears legible. Times has a lower aspect value and so if fallback occurs, the text will be less legible at small sizes than Verdana.
これらの~fontによる~text描画を比較した様子を下に示す。 各~縦列の~textは,左から順に `Verdana^F, `Futura^F, `Times^F により描画されている。 `font-size^p 値は,各段ごとに一定であるが、下半分においては,各~縦列に渡る`~x-height$を保つために[ 実際の~font~sizeを調整する `font-size-adjust$p ~prop ]も設定されている。 最上段と最下段には `~x-height$の相違を示す,赤線が引かれている。 下半分では、どの列の小さい~textも,判読し易さが比較的 ~~保たれている点に注目。 ◎ How text rendered in each of these fonts compares is shown below, the columns show text rendered in Verdana, Futura and Times. The same font-size value is used across cells within each row and red lines are included to show the differences in x-height. In the upper half each row is rendered in the same font-size value. The same is true for the lower half but in this half the font-size-adjust property is also set so that the actual font size is adjusted to preserve the x-height across each row. Note how small text remains relatively legible across each row in the lower half.
この~propは、作者が,要素における`~aspect値$を指定できるようにする。 それは、代用されたかどうかに関係なく,第一~候補の~fontの`~x-height$を実質的に保たせる。 各種~値の意味は,以下に与えられる: ◎ This property allows authors to specify an aspect value for an element that will effectively preserve the x-height of the first choice font, whether it is substituted or not. Values have the following meanings:
- `none@v1
- ~fontの`~x-height$は保たれない ◎ Do not preserve the font’s x-height.
- `number$t
-
`~aspect値$を指定する — それは、調整~済み~font~sizeの計算~公式に利用される: ◎ Specifies the aspect value used in the calculation below to calculate the adjusted font size:
%c = ( %a ÷ %A ) × %s
ここで:
- %s = `font-size$p の値
- %a = `font-size-adjust$p ~propに指定された`~aspect値$
- %A = ~fontの実際の`~aspect値$
- %c = `font-size$p の調整~後の使用値
- 負の値は無効になる。 ◎ Negative values are invalid.
- この値は,選定されたどの~fontにも適用されるが、典型的な用法においては,[ ~font族~名~listの中の最初の~fontの`~aspect値$ ]に基づくべきである。 これが正確aに指定された下では、上の公式の中の項 ( %a ÷ %A ) は,最初の~fontに対しては 1 になり,調整は実質的に生じない。 値が正確aに指定されていない場合、[ `font-size-adjust$p を~supportしない 古い~UA ]においては,[ 族~listの最初の~fontを利用して描画される~text ]の表示が異なってくる。 ◎ This value applies to any font that is selected but in typical usage it should be based on the aspect value of the first font in the font-family list. If this is specified accurately, the (a/a') term in the formula above is effectively 1 for the first font and no adjustment occurs. If the value is specified inaccurately, text rendered using the first font in the family list will display differently in older user agents that don’t support font-size-adjust.
`font-size-adjust$p の値は, `font-size$p の使用値に影響するが、算出値には影響しない。 それは、[ `ex$u や `ch$u ]などの[ `可用な最初の~font$の~font計量に基づく,相対~単位 ]の~sizeに影響するが,`em$u 単位の~sizeには影響しない。 数量的な `line-height$p 値は, `font-size$p の算出値を参照rするので、 `font-size-adjust$p は,`line-height$p の使用値には影響しない。 ◎ The value of font-size-adjust affects the used value of font-size but does not affect the computed value. It affects the size of relative units that are based on font metrics of the first available font such as ex and ch but does not affect the size of em units. Since numeric values of line-height refer to the computed size of font-size, font-size-adjust does not affect the used value of line-height.
注記: ~CSSにおいては、作者は `line-height$p を `font-size$p の倍数として指定することが多い。 `font-size-adjust$p ~propは, `font-size$p の使用値に影響するので、作者は, `font-size-adjust$p を利用するときは 行高の設定にも注意を払うべきである。 この状況~下では、行高の設定を狭小にし過ぎると,~text行が重合するおそれがある。 ◎ Note: In CSS, authors often specify line-height as a multiple of the font-size. Since the font-size-adjust property affects the used value of font-size, authors should take care setting the line height when font-size-adjust is used. Setting the line height too tightly can result in overlapping lines of text in this situation.
実際に `font-size-adjust$p を利用している例に置換する — それを計測する方法に代えて。 issue#2859 ◎ replace with an example of actually using font-size-adjust rather than how to measure it <https://github.com/w3c/csswg-drafts/issues/2859>
作者は、[ 同じ内容, かつ `font-size-adjust$p ~propが異なる ]ような 2 つの区間を比較することにより,所与の~fontに対する`~aspect値$を計算できる。 同じ `font-size^p が利用された下での, 2 つの区間は、その~fontに対する `font-size-adjust$p 値が正確aであるときに,合致することになる。 ◎ Authors can calculate the aspect value for a given font by comparing spans with the same content but different font-size-adjust properties. If the same font-size is used, the spans will match when the font-size-adjust value is accurate for the given font.
~fontの`~aspect値$を決定するために,~borderを伴う 2 つの区間を利用する例。 両~区間( `span^e )に対し, `font-size$p は同じであるが、右側の `span^e には `font-size-adjust$p ~propも指定されている。 値 0.5 から始めて、 2 つの普通字を囲む~borderが揃うまで,`~aspect値$を調整する: ◎ Two spans with borders are used to determine the aspect value of a font. The font-size is the same for both spans but the font-size-adjust property is specified only for the right span. Starting with a value of 0.5, the aspect value can be adjusted until the borders around the two letters line up.
p { font-family: Futura; font-size: 500px; } span { border: solid 1px red; } .adjust { font-size-adjust: 0.5; } <p><span>b</span><span class="adjust">b</span></p>
図右の~boxは,図左のものより少しばかり大きいので、この~fontの`~aspect値$は, 0.5 より幾分~小さい。 2 つの~boxが揃うまで値を調整すれば~~正確な値が得られる。 ◎ The box on the right is a bit bigger than the one on the left, so the aspect value of this font is something less than 0.5. Adjust the value until the boxes align.
2.8. ~font略式: `font^p ~prop
◎名 `font@p ◎値 [ [ `font-style$tp || `font-variant-css2$t || `font-weight$tp || `font-stretch$tp ]? `font-size$tp [ / `line-height$tp ]? `font-family$tp ] | `caption$v | `icon$v | `menu$v | `message-box$v | `small-caption$v | `status-bar$v ◎初 個々の~propを見よ ◎適 すべての要素 ◎継 される ◎百 個々の~propを見よ ◎算 個々の~propを見よ ◎順 文法に従う ◎ア 個々の~propを見よ ◎表終`font$p ~propは、~stylesheetの中の同じ場所で[ `font-style$p, `font-variant$p, `font-weight$p, `font-stretch$p, `font-size$p, `line-height$p, `font-family$p ]をまとめて設定するための,略式~propである — ただし: ◎ The font property is, except as described below, a shorthand property for setting font-style, font-variant, font-weight, font-stretch, font-size, line-height, font-family at the same place in the stylesheet.\
-
`font-variant$p ~prop用の値は、 CSS 2.1 にて~supportされるものに限られる — この ~level 3/4 仕様にて追加されている `font-variant$p 用のどの値も, `font$p 略式~propには利用できない: ◎ Values for the font-variant property can also be included but only those supported in CSS 2.1; none of the font-variant values added in CSS Fonts Levels 3 or 4 can be used in the font shorthand:
`font-variant-css2@t = `normal^v | `small-caps^v
-
`font-stretch$p ~prop用の値は、 `CSS-FONTS-3$r にて~supportされるものに限られる — この仕様にて追加された `font-stretch$p 用のどの値も, `font$p 略式~propには利用できない: ◎ Values for the font-stretch property can also be included but only those supported in CSS Fonts level 3, none of the font-stretch values added in this specification can be used in the font shorthand:
`font-stretch-css3@t = `normal^v | `ultra-condensed$v | `extra-condensed$v | `condensed$v | `semi-condensed$v | `semi-expanded$v | `expanded$v | `extra-expanded$v | `ultra-expanded$v
この~propの構文は、~fontに関係する複数の~propを設定するための,伝統的な~typographic上の略式~記法に基づく。 ◎ The syntax of this property is based on a traditional typographical shorthand notation to set multiple properties related to fonts.
`font$p ~propの各~下位propは:
- 先ず,それぞれの初期値に設定し直される — 上に挙げたものに加えて,次に挙げるものも含めて ⇒# `font-size-adjust$p, `font-kerning$p, `font-variant$p の下位propすべて, `font-feature-settings$p, `font-language-override$p, `font-min-size$p, `font-max-size$p, `font-optical-sizing$p, `font-variation-settings$p, `font-palette$p
- 次に,各 下位propには、この略式~propに明示的に値が与えられていれば,その値が設定される — 許容される値/初期値の定義は、個々の下位propの定義を見よ。
- 後方互換性の理由から、この略式~propでは, `font-size-adjust$p を初期値~以外の値に設定することはアリでない — 代わりに、個々の~propを利用すること。
p { font: 12pt/14pt sans-serif } p { font: 80% sans-serif } p { font: x-large/110% "new century schoolbook", serif } p { font: bold italic large Palatino, serif } p { font: normal small-caps 120%/120% fantasy } p { font: condensed oblique 12pt "Helvetica Neue", serif; } p { font: condensed oblique 25deg 753 12pt "Helvetica Neue", serif; }
2 個目の規則における~font~size百分率~値( `80%^v )は、親~要素の `font-size$p の算出値を参照rする。 3 個目の規則における行高~百分率( `110%^v )は、要素~自身の~font~sizeを参照rする。 ◎ In the second rule, the font size percentage value ("80%") refers to the computed font-size of the parent element. In the third rule, the line height percentage ("110%") refers to the font size of the element itself.
最初の 3 個の規則は[ `font-variant$p と `font-weight$p ]を明示的に指定しないので、これらの~propは,それらの初期値( `normal^v )を受取る。 ~font族~名 `"new century schoolbook"^v は~spaceを包含しているので、引用符で括られていることに注意。 4 個目の規則は,[ `font-weight$p を `bold$v, `font-style$p を `italic$v ]に設定し, `font-variant$p を暗黙的に `normal^v に設定する ◎ The first three rules do not specify the font-variant and font-weight explicitly, so these properties receive their initial values (normal). Notice that the font family name "new century schoolbook", which contains spaces, is enclosed in quotes. The fourth rule sets the font-weight to bold, the font-style to italic, and implicitly sets font-variant to normal.
5 個目の規則は[ `font-variant$p ( `small-caps^v ), `font-size$p (親の~font~sizeの 120% ), `line-height$p (~font~sizeの 120% ), `font-family$p ( `fantasy$v ) ]を設定する。 従って,~keyword `normal^v は残りの 2 つの~prop[ `font-style$p, `font-weight$p ]に適用される。 ◎ The fifth rule sets the font-variant (small-caps), the font-size (120% of the parent’s font size), the line-height (120% of the font size) and the font-family (fantasy). It follows that the keyword normal applies to the two remaining properties: font-style and font-weight.
6 個目の規則は[ `font-style$p, `font-stretch$p, `font-size$p, `font-family$p ]を設定し,他の~font~propは それぞれの初期値に設定させておく。 ◎ The sixth rule sets the font-style, font-stretch, font-size, and font-family, the other font properties being set to their initial values.
7 個目の規則は、 `font-style$p を `oblique 25deg^v に, `font-weight$p を `753^v に, `font-stretch$p を `condensed$v に 設定する。 この規則における `25deg^v は、 `oblique^v ~keywordの直後にし~MUSTことに注意。 ◎ The seventh rule sets font-style to oblique 25deg, font-weight to 753, and font-stretch to condensed. Note that the 25deg in this rule must be immediately following the "oblique" keyword.
`font-stretch$p ~propは CSS 2.1 では定義されていないので、作者は, `font$p 規則~内で `font-stretch$p 値を利用する際には,古い~UAとも互換な予備の~versionを含めるべきである: ◎ Since the font-stretch property was not defined in CSS 2.1, when using font-stretch values within font rules, authors should include a extra version compatible with older user agents:
p {
font: 80% sans-serif; /*
古い~UA用
◎
for older user agents
*/
font: condensed 80% sans-serif;
}
次の値は~system~fontを参照rする: ◎ The following values refer to system fonts:
- `caption@v
- ~caption付きの~control(例えば,~button, ~drop-down, 等々)用に利用される~font ◎ The font used for captioned controls (e.g., buttons, drop-downs, etc.).
- 【 利用中の~browserでは、このように呈示される。 】
- `icon@v
- ~iconに~labelを貼るために利用される~font ◎ The font used to label icons.
- 【 利用中の~browserでは、このように呈示される。 】
- `menu@v
- ~menu(例えば~drop-down~menuや~menu~list)に利用される~font ◎ The font used in menus (e.g., dropdown menus and menu lists).
- 【 利用中の~browserでは、このように呈示される。 】
- `message-box@v
- ~dialog-boxに利用される~font ◎ The font used in dialog boxes.
- 【 利用中の~browserでは、このように呈示される。 】
- `small-caption@v
- 小さな~controlに~labelを貼るために利用される~font ◎ The font used for labeling small controls.
- 【 利用中の~browserでは、このように呈示される。 】
- `status-bar@v
- ~windowの~status-barに利用される~font ◎ The font used in window status bars.
- 【 利用中の~browserでは、このように呈示される。 】
~system~fontは一体としてのみ設定できる。 すなわち,[ ~font族, ~size, ~weight, ~style, 等々 ]は、すべて同時に設定される。 しかる後,欲されるならば、これらの値は個々に改めれる。 指示された特徴を備える~fontが,所与の~platform上に存在しない場合、~UAは,適当に代用するか(例えば `small-caption$v ~fontに対しては, `caption$v ~fontの より小さい~versionを利用するなど),または ~UAによる既定の~fontで代用するべきである。 ~regular~fontに対しては、~system~fontであるならば、個々の~propのうち,[ OS にて可用な利用者~選好 ]の一部でないものについては,それぞれの初期値に設定されるべきである。 ◎ System fonts can only be set as a whole; that is, the font family, size, weight, style, etc. are all set at the same time. These values can then be altered individually if desired. If no font with the indicated characteristics exists on a given platform, the user agent should either intelligently substitute (e.g., a smaller version of the caption font might be used for the small-caption font), or substitute a user agent default font. As for regular fonts, if, for a system font, any of the individual properties are not part of the operating system’s available user preferences, those properties should be set to their initial values.
これが、この~propが “ほぼ” 略式~propとされている理由である: ~system~fontは、`font-family$p 自身ではなく,この~propを通してのみ指定し得るので、作者は `font$p により[ その一連の下位propの総和 ]より多くのことを行える。 一方で、 `font-weight$p などの個々の~propには,依然として~system~fontから採られる値が与えられ、独立に変わり得る。 ◎ That is why this property is "almost" a shorthand property: system fonts can only be specified with this property, not with font-family itself, so font allows authors to do more than the sum of its subproperties. However, the individual properties such as font-weight are still given values taken from the system font, which can be independently varied.
上に挙げられた~system~font用の~keywordは,先頭に位置するときに限り~keywordとして扱われ、他所に位置している場合は,~font族~名の一部として扱われることに注意: ◎ Note that the keywords used for the system fonts listed above are only treated as keywords when they occur in the initial position, in other positions the same string is treated as part of the font family name:
font: menu; /* ~system~menu用の~font設定群を利用 ◎ use the font settings for system menus */ font: large menu; /* "menu" という名前の~font族を利用 ◎ use a font family named "menu" */
button { font: 300 italic 1.3em/1.7em "FB Armada", sans-serif } button p { font: menu } button p em { font-weight: bolder }
例えば、特定0の~system上に[ ~drop-down~menu用に利用される~font ]が居合わせていて,それが[ 9-point `Charcoal^F, ~weight 600 ]を伴うものであったとするなら、 `button^e 要素の子孫の `p^e 要素は、次の規則が~~有効であったかのように表示されることになる: ◎ If the font used for dropdown menus on a particular system happened to be, for example, 9-point Charcoal, with a weight of 600, then P elements that were descendants of BUTTON would be displayed as if this rule were in effect:
button p { font: 600 9pt Charcoal }
`font$p 略式~propは,明示的に与えられていない どの~propの値も,その初期値に設定し直すので、これは,次の宣言と同じ効果になる: ◎ Because the font shorthand resets to its initial value any property not explicitly given a value, this has the same effect as this declaration:
button p { font-style: normal; font-variant: normal; font-weight: 600; font-size: 9pt; line-height: normal; font-family: Charcoal }
2.9. 合成的な書体の制御-法
2.9.1. 合成d~boldの制御-法: `font-synthesis-weight^p ~prop
◎名 `font-synthesis-weight@p ◎値 `auto$v | `none$v ◎初 `auto$v ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎順 文法に従う ◎ア 可 ◎表終この~propは、~font族が~bold体fを欠くとき,~UAがそれを合成するのを許容するかどうかを制御する。 ◎ This property controls whether user agents are allowed to synthesize bold font faces when a font family lacks bold faces.
- `auto@v1
- ~bold体fの合成は許容される。 ◎ Synthesis of bold faces is allowed
- `none@v1
- ~bold体fの合成は許容されない。 ◎ Synthesis of bold faces is not allowed
2.9.2. 合成d ~obliqueの制御-法: `font-synthesis-style^p ~prop
◎名 `font-synthesis-style@p ◎値 `auto$v | `none$v ◎初 `auto$v ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎順 文法に従う ◎ア 可 ◎表終この~propは、~font族が~oblique体fを欠くとき,~UAがそれを合成するのを許容するかどうかを制御する。 ◎ This property controls whether user agents are allowed to synthesize oblique font faces when a font family lacks oblique faces.
- `auto@v1
- ~oblique体fの合成は許容される。 ◎ Synthesis of oblique faces is allowed
- `none@v1
- ~oblique体fの合成は許容されない。 ◎ Synthesis of oblique faces is not allowed
2.9.3. 合成d ~small-capsの制御-法: `font-synthesis-small-caps^p ~prop
◎名 `font-synthesis-small-caps@p ◎値 `auto$v | `none$v ◎初 `auto$v ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎順 文法に従う ◎ア 可 ◎表終この~propは、~font族が~small-caps体fを欠くとき,~UAがそれを合成するのを許容するかどうかを制御する。 ◎ This property controls whether user agents are allowed to synthesize small caps font faces when a font family lacks small caps faces.
- `auto@v1
- ~small-caps体fの合成は許容される。 ◎ Synthesis of small caps faces is allowed
- `none@v1
- ~small-caps体fの合成は許容されない。 ◎ Synthesis of small caps faces is not allowed
2.9.4. 書体の合成を制御する: `font-synthesis^p 略式~prop
◎名 `font-synthesis@p ◎値 `none^v | [ `weight^v || `style^v ] ◎初 `weight^v `style^v `small-caps^v ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎順 文法に従う ◎ア 不可 ◎表終この~propは、[ `font-synthesis-weight$p, `font-synthesis-style$p ]~prop用の略式である。 【 `small-caps^v に関する記述が抜けている。】 各~値は、次に従って対応付けられる: ◎ This property is a shorthand for the font-synthesis-weight and font-synthesis-style properties. Values are mapped as following:
`font-synthesis$p 値 | `font-synthesis-weight$p 値 | `font-synthesis-style$p 値 |
---|---|---|
`none^v | `none^v | `none^v |
`weight^v | `auto^v | `none^v |
`style^v | `none^v | `auto^v |
`weight^v `style^v | `auto^v | `auto^v |
次の~style規則は、合成的に~oblique化された~Arabic体fの利用を不能化する: ◎ The style rule below disables the use of synthetically obliqued Arabic:
*:lang(ar) { font-synthesis: none; }
3. ~font描画の制御
3.1. ~font描画の制御 — 序論
~UAは、 `font-face$at を介して~download可能な`~web~font$を利用するとき,~fontを読込んでいる最中に何をするか,知る必要がある。 ほとんどの~web~browserは、何らかの形の時間切れを採用している: ◎ When using downloadable Web Fonts via @font-face, the user agent needs to know what to do while the font is actively loading. Most web browsers have adopted some form of timeout:
~browser | 時間切れ | ~fallback | 入替 |
---|---|---|---|
~Chrome 35+ | 3 秒 | する | する |
~Opera | 3 秒 | する | する |
~Firefox | 3 秒 | する | する |
~MSIE | 0 秒 | する | する |
~Safari | 3 秒 | する | する |
- ~Chrome/~Firefox では、 3 秒で時間切れになる — その時点で、~textは~fallback~fontで示される。 最終的には入替が生じる — すなわち、意図される~fontが可用になり次第,~textは それで描画し直される。 ◎ Chrome and Firefox have a 3 second timeout after which the text is shown with the fallback font. Eventually, a swap occurs: the text is re-rendered with the intended font once it becomes available.
- ~MSIEでは、 0 秒で時間切れになる — その結果,~textは即時に描画される: 要請された~fontがまだ可用でない場合、~fallbackが利用される — 要請された~fontが後で可用になり次第,~textは描画し直される。 ◎ Internet Explorer has a 0 second timeout which results in immediate text rendering: if the requested font is not yet available, fallback is used, and text is rerendered later once the requested font becomes available.
これらの既定の挙動は適度であるが、あいにく,各~browser間で一貫的でない。 さらには、[[ 現代の利用者~体験, あるいは処理能 ]に気を使う~appに要求される,~~多様な利用事例 ]を受持つに足る,単独の~approachは無い。 ◎ While these default behaviors are reasonable, they’re unfortunately inconsistent across browsers. Worse, no single approach is sufficient to cover the range of use-cases required by modern user-experience– and performance–conscious applications.
`CSS-FONT-LOADING-3$r ~APIは,開発者が上の挙動の一部を上書きできるようにするが、~scriptingに自明でない量の労を要し,適度な事例すべてを受持つに足る~hookを~~根本的に供さない。 加えて,開発者は、読込-用の~scriptを自身の頁~内に直書きするか,外部~libraryを読込む必要があり、いずれにせよ,~fontを読込めるようになる前に 追加の~network遅延をもたらすため、~text描画は延期される。 ◎ The Font Loading API [CSS-FONT-LOADING-3] allows a developer to override some of the above behaviors, but that requires scripting, a non-trivial amount of effort, and ultimately doesn’t provide sufficient hooks to cover all reasonable cases. Additionally, the developer needs to either inline the loading script into their page or load an external library, introducing additional network latency before the fonts can be loaded and delaying text rendering.
設計/処理能に気を使う~web開発者は、[ 意図される利用者~体験のための,所与の`~web~font$の相対的な重要度 ]について,よく知る立場にある。 この仕様は、開発者に~fontの[ 時間切れ/描画 ]の挙動を制御する能を供する。 — 特定的には: ◎ Design/performance-conscious web developers have a good sense for the relative importance of a given Web Font for the intended user experience. This specification provides them the ability to control font timeout and rendering behavior. Specifically, it lets developers:
- いつ,~textを塗るに準備済みになるか、についての~font表示-施策を定義する: それまで阻むか,~fallbackで塗るか。 ◎ Define the font display policy when text is ready to be painted: block, or paint with fallback.
- 欲される~fontが可用になったときの,~font表示-施策を定義する: ~textを新たな~fontで描画し直すか,~fallbackのままにしておくかどうか。 ◎ Define the font display policy once the desired font is available: rerender text with the new font, or leave it with the fallback.
- 各~fontごとに~custom時間切れ値を定義する。 ◎ Define custom timeout values for each font.
- 要素ごとに ~custom[ 表示-/時間切れ ]施策を定義する。 ◎ Define custom display and timeout policies per element.
3.2. ~font表示-時列線
書体-の `~font~download~timer@ が開始されるのは、~UAが,ある頁~上で~downloadされた所与の書体-を最初に利用しようと試みた時点になる。 この~timerは、当の書体-に結付けられる 3 つの期間 — `阻み期間$, `入替~期間$, `失敗~期間$ — を通して進む — それは、書体-を利用している要素の描画の挙動を規定する: ◎ At the moment the user agent first attempts to use a given downloaded font face on a page, the font face’s font download timer is started. This timer advances through three periods of time associated with the font face—the block period, the swap period, and the failure period—which dictate the rendering behavior of any elements using the font face:
- `阻み期間@ が最初の期間になる。 この期間~内に書体-が読込まれなかった場合、それを利用しようと試みている どの要素も,代わりに `不可視~fallback書体-で描画-$し~MUST — 成功裡に読込まれた場合、書体-は通常に利用される。 ◎ The first period is the font block period. During this period, if the font face is not loaded, any element attempting to use it must instead render with an invisible fallback font face. If the font face successfully loads during the block period, the font face is then used normally.
- `阻み期間$の直後からは、 `入替~期間@ になる。 この期間~内に書体-が読込まれなかった場合、それを利用しようと試みている どの要素も,`~fallback書体-で描画-$し~MUST — 成功裡に読込まれた場合、書体-は通常に利用される。 ◎ The second period, occuring immediately after the block period, is the font swap period. During this period, if the font face is not loaded, any element attempting to use it must instead render with a fallback font face. If the font face successfully loads during the swap period, the font face is then used normally.
- `入替~期間$の直後からは、書体-がまだ読込まれていないならば, `失敗~期間@ が開始される — 読込-は失敗したものとされ,通常の~font~fallbackを生じさせる。 他の場合、書体-は通常に利用される。 ◎ The third period, occuring immediately after the swap period, is the font failure period. If the font face is not yet loaded when this period starts, it’s marked as a failed load, causing normal font fallback. Otherwise, the font face is used normally.
所与の要素~用に `~fallback書体-で描画-@ するときは、~UAは,要素の `font-family$p ~listに指定された書体-のうち すでに読込まれた最初のものを見出して,それを~textの描画に利用し~MUST。 これを行なうときは、~fallback~fontの読込-を誘発しては~MUST_NOT。 ◎ To render with a fallback font face for a given element, the user agent must find the first font face specified in the element’s font-family list which is already loaded, and use that for rendering text. Doing this must not trigger loads of any of the fallback fonts.
所与の要素~用に `不可視~fallback書体-で描画-@ するときは、[ `~fallback書体-で描画-$するときにしたがって,書体-を見出した ]上で,[ その書体-と同じ計量を伴うが,すべての~glyphは “不可視” である( “~ink” を包含しない) ]ような匿名~書体-を作成して,それを~textの描画に利用する。 これを行なうときは、~fallback~fontの読込-を誘発しては~MUST_NOT。 ◎ To render with an invisible fallback font face for a given element, find a font face as per "render with a fallback font face". Create an anonymous font face with the same metrics as the selected font face but with all glyphs "invisible" (containing no "ink"), and use that for rendering text. Doing this must not trigger loads of any of the fallback fonts.
`fallback$v / `optional$v により、族~内のある書体が,他のものが~fallbackするよう要求される間に利用-中になる結果、 “脅迫状( `ransom note^en )” のような見かけになり得る。 おそらく、族~内のすべての~fontが~~一斉に同じに挙動する(すべて入替わるか すべて~fallbackする)必要があるのでは? ~font族~~単位で挙動を制御する `font-feature-values$at も見よ。 ◎ fallback and optional can result in some faces in a family being used while others are required to fallback, giving a "ransom note" look. Perhaps require that all fonts in a family have the same behavior (all swapped in, or all fallback)? See also the @font-feature-values for controlling the behavior on a font family basis.
4. ~font資源
4.1. `font-face^at 規則
`font-face@at 規則は、[ 必要時に自動的に~fetchされた上で作動化される ]ような~fontに向けて,~linkを張れるようにする。 これにより,作者は、~fontの候補を[ 所与の~platform上で可用な~fontの集合 ]に限ることなく,[ 頁の~design目標に近く合致する~font ]を選定できるようになる。 [ この規則が与える,一連の~font記述子からなる集合 ]は、個々の書体の~style特徴に沿うような,[ ~local/外部 ]にある~font資源の所在を定義する。 複数の `font-face$at 規則を利用して,[ 種々の書体を備える~font族 ]を構築することもできる。 ~UAは — ~CSS~font照合~規則の利用を通して — 所与の~text片に必要な書体のみを,選択的に~downloadできるようになる。 ◎ The @font-face rule allows for linking to fonts that are automatically fetched and activated when needed. This allows authors to select a font that closely matches the design goals for a given page rather than limiting the font choice to a set of fonts available on a given platform. A set of font descriptors define the location of a font resource, either locally or externally, along with the style characteristics of an individual face. Multiple @font-face rules can be used to construct font families with a variety of faces. Using CSS font matching rules, a user agent can selectively download only those faces that are needed for a given piece of text.
その構文は: ◎ Its syntax is:
@font-face { `declaration-list$t }
`font-face$at 規則は、この仕様にて定義する各種~記述子を受容する。 ◎ The @font-face rule accepts the descriptors defined in this specification.
`font-face$at 規則は、すべての~font記述子に対し,それぞれの値を[ 暗黙的に, または明示的に ]指定する。 規則の中で値が明示的に与えられていないものについては、[ この仕様の中で,それぞれの記述子の定義に挙げられている初期値 ]を値にとる。 これらの記述子は、もっぱら,[ それが定義される `font-face$at 規則の文脈 ]の下でのみ適用され,文書~言語の要素に【直に】適用されるものではない。 記述子がどの要素に適用されるかや,値が子~要素に継承されるかどうかの観念は存在しない。 所与の `font-face$at 規則の中に,同じ名前の記述子が複数回~出現したときは、それらのうち最後の記述子~宣言のみが利用され,他の宣言は すべて無視される。 ◎ Each @font-facerule specifies a value for every font descriptor, either implicitly or explicitly. Those not given explicit values in the rule take the initial value listed with each descriptor in this specification. These descriptors apply solely within the context of the @font-face rule in which they are defined, and do not apply to document language elements. There is no notion of which elements the descriptors apply to or whether the values are inherited by child elements. When a given descriptor occurs multiple times in a given @font-face rule, only the last descriptor declaration is used and all prior declarations for that descriptor are ignored.
`Gentium^F と称される~download可能な~fontを利用するためには: ◎ To use a downloadable font called Gentium:
@font-face { font-family: Gentium; src: url(http://example.com/fonts/Gentium.woff); } p { font-family: Gentium, serif; }
~UAは、 `Gentium^F を~downloadした上で,[ `p^e 要素~内の~text ]の描画-時に,それを利用することになる。 何らかの理由で~fontを給している~siteが可用でない場合、既定の~serif~fontが利用されることになる。 ◎ The user agent will download Gentium and use it when rendering text within paragraph elements. If for some reason the site serving the font is unavailable, the default serif font will be used.
所与の `font-face$at 規則の集合は、これらの規則を包含する文書において可用な~fontの集合を定義する。 ~font照合を終えたときは、これらの規則を利用して定義される~fontが,~system上の他の可用な~fontの前に考慮される。 ◎ A given set of @font-face rules define a set of fonts available for use within the documents that contain these rules. When font matching is done, fonts defined using these rules are considered before other available fonts on a system.
~downloadされた~fontたちは、それらを参照する文書に限り可用になる。 これらの~fontを作動化させる処理は、それらを[ 同じ~fontへ直に~linkしていない他の~appや文書 ]からも可用にしては~MUST_NOT。 ~UAの実装者は、[ ~downloadされた~fontを[ ~system~font~fallback手順の下で,可用な~fontが他に存在しない ]ような他の文書 ]内の文字の描画-時に利用すること ]が簡便であると考えるかもしれないが、ある頁の内容が他の頁に影響できることになれば,攻撃者から何らかの攻撃路に利用され得ることになり、~securityに穴を開けかねない。 この制約は,~cache法の挙動には影響しない — ~fontは、他の~web資源が~cacheされるのと同じ仕方で~cacheされる。 ◎ Downloaded fonts are only available to documents that reference them. The process of activating these fonts must not make them available to other applications or to documents that don’t directly link to the same font. User agent implementers might consider it convenient to use downloaded fonts when rendering characters in other documents for which no other available font exists as part of the system font fallback procedure. However, this would cause a security leak since the contents of one page would be able to affect other pages, something an attacker could use as an attack vector. These restrictions do not affect caching behavior, fonts are cached the same way other web resources are cached.
`font-face$at 規則は: ◎ This at-rule\
- ~CSSの前方互換な構文解析規則に従う。 宣言~block内の~propと同様、~UAは,自身が~supportしない どの記述子に対しても,その宣言を無視し~MUST。 ◎ follows the forward-compatible parsing rules of CSS. Like properties in a declaration block, declarations of any descriptors that are not supported by the user agent must be ignored.\
- [ `font-family$d, および `src$d ]記述子が要求される — いずれかが欠落中のものは、`~font照合~algo$secを遂行するときに考慮されては~MUST_NOT。 ◎ @font-face rules require a font-family and src descriptor; if either of these are missing, the @font-face rule must not be considered when performing the font matching algorithm.
- ~UAが[ ~platform資源が制限されている / ~download可能な~font資源を不能化する能を実装している ]事例では、単純に無視され~MUST — この仕様にて定義される個々の記述子の挙動は、改められるべきではない。 ◎ In cases where user agents have limited platform resources or implement the ability to disable downloadable font resources, @font-face rules must simply be ignored; the behavior of individual descriptors as defined in this specification should not be altered.
4.2. ~font族: `font-family^d 記述子
◎述 `font-family@d ◎用 `font-face$at ◎値 `family-name$t ◎初 なし(必須) ◎表終この記述子は、すべての[ ~CSS~font族~名の照合 ]に利用されることになる,~font族~名を定義する。 `font-face$at 規則が妥当になるためには,これが要求される。 それは,下層の~font~dataに包含されている~font族~名を上書きする。 すなわち、~font族~名が,[ 利用者~環境にて可用な~font族 ]の名前と同じである場合、これは,その下層の~font — この記述子が記されている~stylesheetを利用する文書~用の,下層の~font — を実質的に隠す。 これにより,~web作者は、利用者~環境に在る~font族~名との競合-を気にせずに,自由に~font族~名を選べるようになる。 同様に、所与の~font族~名に対し,~platform代用が利用されては~MUST_NOT。 ◎ This descriptor defines the font family name that will be used in all CSS font family name matching. It is required for the @font-face rule to be valid. It overrides the font family names contained in the underlying font data. If the font family name is the same as a font family available in a given user’s environment, it effectively hides the underlying font for documents that use the stylesheet. This permits a web author to freely choose font-family names without worrying about conflicts with font family names present in a given user’s environment. Likewise, platform substitutions for a given font family name must not be used.
4.3. ~font参照: `src^d 記述子
◎述 `src@d ◎用 `font-face$at ◎値 注釈文を見よ ◎初 なし(必須) ◎表終この記述子は、~font~dataを包含している資源を指定する。 `font-face$at 規則が妥当になるためには,これが要求される。 その値は,~commaで区切られた~listであり、優先順による,一連の[ 外部~参照または[ ~localに~installされた書体-名 ]]からなる。 ~UAは,~fontが必要になったときに、~listされている参照の集合を走査した上で,成功裡に構文解析して作動化できる最初のものを利用する。 この記述子の構文解析-法は、他の記述子の構文解析-法より複雑である。 その規則については、次節を見よ。 ~fontの作動化は、[ ~fileを~downloadするか~diskから読取って, それを構文解析して, おそらく~UA依存な追加の手続きも行う ]ことを孕む。 [ 妥当でない~dataを包含している~font / ~local書体-が見出されないもの ]は,無視され、~UAは~list内の次にある~fontを読込むことになる。 ◎ This descriptor specifies the resource containing font data. It is required for the @font-face rule to be valid. Its value is a prioritized, comma-separated list of external references or locally-installed font face names. When a font is needed the user agent iterates over the set of references listed, using the first one it can successfully parse and activate. Parsing this descriptor is more complicated than parsing other descriptors; see §4.3.1 Parsing the src descriptor for the parsing rules. Activation of a font involves downloading the file or reading it from disk, parsing it, and perhaps additional user-agent-dependent steps. Fonts containing invalid data or local font faces that are not found are ignored and the user agent loads the next font in the list.
4.3.1. `src^d 記述子の構文解析-法
`src$d 記述子の値は、それを成す各片ごとに構文解析される: ◎ The value of the src descriptor is parsed piecewise.
- ~IF[ 値の中に,【入子も込みで】対になってない[ 開き, 閉じ ]丸括弧がある ] ⇒ ~RET — 記述子は構文解析-~error ◎ First, opening and closing parentheses are matched. If these parentheses cannot be matched, the value is a parse error.\
- %~list ~LET[[ 最外縁の対になっている[ 開き, 閉じ ]丸括弧の内側には無い,各~commaの所 ]で,値を分割して得られる~list ◎ Matching the parentheses has the effect of partitioning the value into multiple regions, each of which is either inside outermost parentheses or outside outermost parentheses. ◎ Once the value is partitioned, all the commas outside outermost parentheses are located. The value is then split at these comma locations.
-
%~list を成す ~EACH( %~item ) に対し: ◎ Each item in the split value is\
-
次の文法に従って, %~item を構文解析する: ◎ then parsed against this grammar:
`url$t [ format(`font-format$t [supports `font-technology$t#]?)]? | local(`font-face-name$t)
`font-format@t = `string$t | woff | truetype | opentype | woff2 | embedded-opentype | svg `font-technology@t = features | variations | color(`color-font-technology$t) | palettes `color-font-technology@t = COLR | SVG | sbix
-
~IF[ %~item を構文解析した結果は構文解析-~errorである ] ⇒ %~item を投棄する ◎ If parsing a particular item in the split value results in a parse error, that item is thrown out.
“投棄する” が何を意味するか定義する。 ◎ Define what "thrown out" means
-
- ~IF[ %~list 内に構文解析-~errorにならない~itemは無い ] ⇒ 記述子は構文解析-~error ◎ If no item in the split value survives, then the descriptor is a parse error.
この構文解析規則は、特定0の~font技術を~supportしない~UA用に,上品な~font~fallbackを許容する。 ◎ These parsing rules allow for graceful fallback of fonts for user agents which don’t support a particular font technology.
4.3.2. `src^d 記述子~内の個々の~itemの読込-法
~CSSにおける他の~URLと同様に,~URLは相対的にもなり得る — その事例では、[ `font-face$at 規則を包含している~stylesheetの所在 ]から相対的に解決される。 ~SVG~fontの事例では、~URLは[ ~SVG~font定義を包含している文書 ]内の要素を指す — 要素~参照が省略されている場合、[ 定義されている~fontのうち,最初のもの ]への参照が黙示される。 同様に,~font容器~形式が複数の~fontを包含し得る場合も、所与の 1 個の `font-face$at 規則に対し 読込まれる~fontは,きっかり 1 個で~MUST。 素片~識別子は、どの~fontを読込むかを指示するために利用される — これらは、 `RFC8081$r にて定義される,~fontの~PostScript名を利用する。 適合的~UAは、素片~識別子が[ 未知/未~support ]である場合には,その~font資源を~downloadすることなく飛ばさ~MUST。 例えば,~OpenType~font集を~supportしない旧~UAは、~list内で次にある~URLへ飛ぶことになる。 ◎ As with other URLs in CSS, the URL can be relative, in which case it is resolved relative to the location of the style sheet containing the @font-face rule. In the case of SVG fonts, the URL points to an element within a document containing SVG font definitions. If the element reference is omitted, a reference to the first defined font is implied. Similarly, font container formats that can contain more than one font must load one and only one of the fonts for a given @font-face rule. Fragment identifiers are used to indicate which font to load; these use the PostScript name of the font as defined in [RFC8081]. Conformant user agents must skip downloading a font resource if the fragment identifier is unknown or unsupported. For example, older user agents which do not support OpenType collections will skip to the next url in the list.
src: url(fonts/simple.woff); /* ~stylesheetの所在から相対的な `simple.woff^l を読込む ◎ load simple.woff relative to stylesheet location */ src: url(/fonts/simple.woff); /* 絶対的な所在から `simple.woff^l を読込む ◎ load simple.woff from absolute location */ src: url(fonts/coll.otc#foo); /* ~font集 `coll.otc^l から~font `foo^l を読込む ◎ load font foo from collection coll.otc */ src: url(fonts/coll.woff2#foo);/* ~WOFF 2 ~font集 `coll.woff2^l から~font `foo^l を読込む ◎ load font foo from woff2 collection coll.woff2 */ src: url(fonts.svg#simple); /* `id^c に `simple^l が付与された~SVG~fontを読込む ◎ load SVG font with id 'simple' */
4.3.3. `src^d 内の~itemたちの選定-法
外部~参照は、 1 個の~URLと, 任意選択で後続する形式~hint【 `format^f 】からなる。 形式~hintは、~URLが参照する~font資源の形式について述べる。 適合的~UAは、その形式~hintが[ 自身が~supportしないか未知の~font形式 / 自身が~supportしない~font技術 ]を指示している場合には、その~font資源の~download~~処理を飛ばさ~MUST。 形式~hintが給されていない場合、その~font資源を~downloadするべきである。 ◎ External references consist of a URL, followed by an optional hint describing the format of the font resource referenced by that URL. Conformant user agents must skip downloading a font resource if the format hint indicates an unsupported or unknown font format, or if any of the font technologies are unsupported by the user agent. If no format hint is supplied, the user agent should download the font resource.
アリなら WOFF ~fontを読込んで,他の場合は~OpenType~fontを利用する例: ◎ For example, the following shows how to load a WOFF font if possible, otherwise use an OpenType font
@font-face { font-family: bodytext; src: url(ideal-sans-serif.woff) format("woff"), url(basic-sans-serif.ttf) format("opentype"); }
4.3.3.1. `font-face$at 形式の型
この仕様により定義される形式~文字列は、以下に従う。 各種 `font-format$t 値は、下に挙げる形式~用の同義語である。 ◎ Format strings defined by this specification are as follows. The <font-format> values are synonyms for the formats below.
文字列 ◎ String | ~font形式 ◎ Font Format | 共通的な拡張子 ◎ Common extensions |
---|---|---|
`woff^l | ~WOFF( Web Open Font Format ) ◎ WOFF (Web Open Font Format) | .woff |
`truetype^l | ~TrueType ◎ TrueType | .ttf |
`opentype^l | ~OpenType ◎ OpenType | .ttf, .otf |
`woff2^l | ~WOFF~file形式 2.0 ◎ WOFF File Format 2.0 (Web Open Font Format) | .woff2 |
`embedded-opentype^l | 埋込みの~OpenType ◎ Embedded OpenType | .eot |
`svg^l | `~SVG~font$(廃止予定) ◎ SVG Font (deprecated) | .svg, .svgz |
~TrueTypeと~OpenTypeの間では,共通的な用法が重合しているので、形式~hint[ `truetype^l と `opentype^l ]は,同義と見なされ~MUST — 形式~hint `opentype^l は、~fontが[ ~PostScript~CFF~style~glyph~data / ~OpenType~layout情報 ]を包含することを含意するわけではない(これについての より深い背景は 付録 A に)。 ◎ Given the overlap in common usage between TrueType and OpenType, the format hints "truetype" and "opentype" must be considered as synonymous; a format hint of "opentype" does not imply that the font contains Postscript CFF style glyph data or that it contains OpenType layout information (see Appendix A for more background on this).
4.3.3.2. `font-face$at の各種~要件
特能( `features^en )要件は、[[[ `GSUB^tag, `GPOS^tag ]~tableを伴う `OPENTYPE$r / `morx^tag ~tableを利用している `AAT^r ]にて共通的に実装されている~font特能 ]用の~supportを基準にする。 `~font特能~prop$secにて,これらの便宜性と相互作用する~propを述べる。 ◎ The features requirement refers to support for font features, commonly implemented in [OPENTYPE] with the GSUB and the GPOS tables, as well as in [AAT] using the morx table. The section on §6 Font Feature Properties describes properties that interact with these facilities.
異体( `variations^en )要件は、[[ `avar^tag, `cvar^tag, `fvar^tag, `gvar^tag, `HVAR^tag, `MVAR^tag, `STAT^tag, `VVAR^tag ]~tableを伴う `OPENTYPE$r / [ `avar^tag, `cvar^tag, `gvar^tag, `fvar^tag ]~tableを利用している `AAT^r にて共通的に実装されている,~font異体 ]の~supportを基準にする。 [ `基本的な~font~prop$sec, `~font異体~prop$sec ]にて,これらの便宜性と相互作用する~propを述べる。 ◎ The variations requirement refers to the support of font variations, commonly implemented in [OPENTYPE] with the avar, cvar, fvar, gvar, HVAR, MVAR, STAT, and VVAR tables, as well as in [AAT] using the avar, cvar, fvar, and gvar tables. The section on §2 Basic Font Properties as well as the section on §8 Font Variation Properties describe properties that interact with these facilities.
色( `color^en )要件は、様々な色~font~file技術を挙げる。 `color^f 関数に与える各~引数は、この要件を満たすために~supportされ~MUSTような[[ `OPENTYPE$r / `AAT^r ]~fontの内側にある~table ]を表現する。 ◎ The color requirement lists various types of color font file technologies. Each of the arguments to the color function represents a table inside [OPENTYPE] or [AAT] fonts which must be supported to satisfy this requirement.
~palette( `palette^en )要件は、[[ `OPENTYPE$r / `CPAL^tag ~tableを伴う `AAT^r ]にて共通的に実装されている~font~palette ]用の~supportを基準にする。 `色~fontの~support$secにて,これらの便宜性と相互作用する~propを述べる。 ◎ The palettes requirement refers to support for font palettes, commonly implemented in the [OPENTYPE] and [AAT] with the CPAL table. The section on §9 Color Font Support describes properties that interact with these facilities.
~web作者は、 `format^f 関数を指定して,[ ~fontを正しく描画するためには,その~supportが要求される ]ことを指示できる。 この仕組みを利用すれば、異体~supportが無いときにも副次的~fontに上品に~fall-backできる。 ◎ Web authors can specify the format function to indicate that support is required for correct rendering of a font. This mechanism can be used for gracefully falling back to an ancillary font when variation support is not present.
次の `font-face$at ~blockは、~UA上に~supportが在るならば 色~fontを利用し,無いならば そうでない~fontに~fall-backする方法を示す。 ◎ This @font-face block shows how to use a color font if support is present on the user agent, and falls back to a non-color-font if support is not present.
@font-face { font-family: "Trickster"; src: url("trickster-COLR.otf") format(opentype supports color(COLR)), url("trickster-outline.otf") format(opentype); }
4.3.3.3. ~local~font~fallback
作者が,所与の~fontに対し[ ~localに可用な複製が在るならばそれを利用し, 無いならば~downloadする ]ことを選好する場合には、 `local@f を利用できる。 その引数 `font-face-name$t は、~localに~installされた,より大きな族~内で単独の書体-を一意に識別するような,形式~特有な文字列を与える。 名前は、任意選択で引用符で括ることもできる。 括られていない場合、引用符で括られない族~名に対する処理ng規約に従って,名前は、`空白$で区切られた識別子の連列で~MUST — それは、識別子たちを単独の~spaceで区切って順に連結することにより,文字列に変換される。 ◎ When authors would prefer to use a locally available copy of a given font and download it if it’s not, local() can be used. The locally-installed <font-face-name> argument to local() is a format-specific string that uniquely identifies a single font face within a larger family. The name can optionally be enclosed in quotes. If unquoted, the unquoted font family name processing conventions apply; the name must be a sequence of identifiers separated by whitespace which is converted to a string by joining the identifiers together separated by a single space.
/* `Gentium^F の~regular体f ◎ regular face of Gentium */ @font-face { font-family: MyGentium; src: local(Gentium), /* `Gentium^F が~localに可用なら,それを選好する ◎ prefer locally available Gentium */ url(Gentium.woff); /* 他の場合は~downloadする ◎ otherwise, download it */ }
~OpenType および~TrueTypeの~fontに対しては、この文字列が合致する対象は,~localに可用な~fontの`名前~table$の中の[ ~PostScript名/全部的~font名 ]に限られる。 どちらの型の名前が利用されるかは、~platformと~fontにより様々なので、作者は,~platform間に渡る適正な照合を確保するためには,これらの名前の両者を含めるべきである。 所与の~font名に対し,~platform代用が利用されては~MUST_NOT。 ◎ For OpenType and TrueType fonts, this string is used to match only the Postscript name or the full font name in the name table of locally available fonts. Which type of name is used varies by platform and font, so authors should include both of these names to assure proper matching across platforms. Platform substitutions for a given font name must not be used.
/* `Gentium^F の~bold体f ◎ bold face of Gentium */ @font-face { font-family: MyGentium; src: local(Gentium Bold), /* 全部的~font名 ◎ full font name */ local(Gentium-Bold), /* ~PostScript名 ◎ Postscript name */ url(GentiumBold.woff); /* 上のどれも利用できないときは ~downloadする ◎ otherwise, download it */ font-weight: bold; }
`font-face$at 規則が[ 1 個の族~内の単独の~font ]の特徴を指定するのとちょうど同じく, `local$f を通して利用される一意な名前は、~font族~全体ではなく,単独の~fontを指定する。 ~OpenType~font~dataの用語で述べるなら、~PostScript名は,[ ~fontの`名前~table$ ]の中の [ nameID = 6 の name record ]の中から見出される(詳細は `OPENTYPE$r に)。 ~PostScript名が、[ OSX 上ではすべての~font, ~Windows上では~PostScript~CFF~font ]に対し,共通的に利用される~keyである。 全部的~font名( nameID = 4 )は、 ~Windows上では~TrueType~glyphを伴う~fontに対する一意な~keyとして利用される。 ◎ Just as an @font-face rule specifies the characteristics of a single font within a family, the unique name used with local() specifies a single font, not an entire font family. Defined in terms of OpenType font data, the Postscript name is found in the font’s name table, in the name record with nameID = 6 (see [OPENTYPE] for more details). The Postscript name is the commonly used key for all fonts on OSX and for Postscript CFF fonts under Windows. The full font name (nameID = 4) is used as a unique key for fonts with TrueType glyphs on Windows.
複数個の[ 全部的~font名の地域化版 ]を伴うような~OpenType~fontに対しては、[ ~US~English版( ~Windows上では ~langID = 0x409, ~Macintosh上では ~langID = 0 )]か,あるいは~US~Englishの全部的~font名が可用でないときは[ 最初の地域化名 ]が利用され~MUST( ~OpenType仕様では どの~fontにも最小限~US~English名は含める ことが推奨されている)。 他の全部的~font名 にも 合致させる~UA ( 例えば,現在の~system~localeが~Dutchに設定されている下での,~Dutch名への照合 )は、不適合と見なされる。 ◎ For OpenType fonts with multiple localizations of the full font name, the US English version must be used (language ID = 0x409 for Windows and language ID = 0 for Macintosh) or the first localization when a US English full font name is not available (the OpenType specification recommends that all fonts minimally include US English names). User agents that also match other full font names, e.g. matching the Dutch name when the current system locale is set to Dutch, are considered non-conformant.
注記: これは、[ ~Englishを選好しない, かつ[[ ~fontの~versionや OS による地域化名 ]の相違により,照合が一貫しなくなるのを避ける ]]ように,行われる — ~font~style名(例えば, "Bold" )は,多くの言語にて常習的に地域化されており、可用な地域化d名からなる集合は,[ 多岐に渡る,~platformや~fontの~version ]間で様々なので。 ◎ Note: This is done, not to prefer English, but to avoid matching inconsistencies across font versions and OS localizations, since font style names (e.g. "Bold") are frequently localized into many languages and the set of localizations available varies widely across platform and font version.
[ 族~名( nameID = 1 )と~style名 ( nameID = 2 ) ]の連結に合致させる~UAも,不適合と見なされる。 ◎ User agents that match a concatenation of family name (nameID = 1) with style name (nameID = 2) are considered non-conformant.
注記: また,これにより、他の方法では参照し得ない様な,[ より大きな族に属する書体 ]を【直に】参照することも可能になる。 ◎ Note: This also allows for referencing faces that belong to larger families that cannot otherwise be referenced.
~local~fontを利用する, または 別の文書の中の~SVG~fontを参照する: ◎ Use a local font or reference an SVG font in another document:
@font-face { font-family: Headline; src: local(Futura-Medium), url(images/fonts.svg#MyGeometricModern) format("svg"); }
異なる~platform上に渡る,~local~Japanese~fontに対する別名を作成する: ◎ Create an alias for local Japanese fonts on different platforms:
@font-face { font-family: jpgothic; src: local(HiraKakuPro-W3), local(Meiryo), local(IPAPGothic); }
より大きな族~内では合致され得ない 1 個の書体-を参照する: ◎ Reference a font face that cannot be matched within a larger family:
@font-face {
font-family: Hoefler Text Ornaments;
/*
は、 Hoefler Text Regular と同じ~font~propを備える【ので,従来の方法では選定できない(ような例として挙げられている?)】
◎
has the same font properties as Hoefler Text Regular
*/
src: local(HoeflerText-Ornaments);
}
地域化された全部名は,決して合致しないので、下の~heading用~style規則を伴う文書は、特定0の~system~locale~parameterが~Finnishに設定されているかどうかに関わらず,常に既定の~serif~fontを利用して描画される: ◎ Since localized fullnames never match, a document with the header style rules below would always render using the default serif font, regardless whether a particular system locale parameter is set to Finnish or not:
@font-face {
font-family: SectionHeader;
src: local("Arial Lihavoitu"); /*
`Arial_Bold^F に対する~Finnishの全部名は失敗するべき
◎
Finnish fullname for Arial Bold, should fail
*/
font-weight: bold;
}
h2 { font-family: SectionHeader, serif; }
適合的~UAは、下の例の中の~font `gentium.eot^css を決して読込まないことになる — それは `src$d 記述子の最初の定義に含まれており,同じ `font-face$at 規則の中の 2 個目の定義により上書きされるので: ◎ A conformant user agent would never load the font 'gentium.eot' in the example below, since it is included in the first definition of the src descriptor which is overridden by the second definition in the same @font-face rule:
@font-face { font-family: MainText; src: url(gentium.eot); /* 古い~UA用 ◎ for use with older user agents */ src: local("Gentium"), url(gentium.woff); /* `src^d 定義を上書きする ◎ Overrides src definition */ }
4.4. ~font~prop記述子: `font-style^d , `font-weight^d , `font-stretch^d 記述子
◎述 `font-style@d ◎用 `font-face$at ◎値 `auto^v | `font-style$tp | [ `oblique$v `angle$t `angle$t ] ◎初 `normal^v ◎表終 ◎述 `font-weight@d ◎用 `font-face$at ◎値 `auto^v | `font-weight-absolute$t `font-weight-absolute$t? ◎初 `normal^v ◎表終 ◎述 `font-stretch@d ◎用 `font-face$at ◎値 `auto^v | `font-stretch$tp `font-stretch$tp? ◎初 `normal^v ◎表終これらの記述子は、書体-の特徴を定義し,~styleを特定の書体と照合する処理に利用される。 いくつかの `font-face$at 規則により定義される~font族に対しては、 ~UAは、[ 族の中の書体をすべて~downloadする ]か, または[ これらの記述子を利用して,[[ 文書の中で利用される実際の~style ]に合致する書体- ]を選択的に~downloadする ]ことができる。 ◎ These descriptors define the characteristics of a font face and are used in the process of matching styles to specific faces. For a font family defined with several @font-face rules, user agents can either download all faces in the family or use these descriptors to selectively download font faces that match actual styles used in document.\
これらの記述子~用の値の意味は、同じ名前の~font~propがとる値と同じである — ただし: ◎ The meaning of the values for these descriptors are the same as those for the corresponding font properties except that\
- `font-weight$d 記述子に対する相対~keyword[ `bolder$v, `lighter$v ]は許容されない。 ◎ relative keywords are not allowed, bolder and lighter.\
- 省略された記述子については、初期値をとるものと見做される。 ◎ If these descriptors are omitted, initial values are assumed.\
- 指定された値が,【次項~以下に述べる値は別として】 同じ名前の~propが受容する値の範囲~外にある場合、当の記述子は構文解析-~errorとして扱われる。 ◎ If specified values are out of range of the accepted values of the property of the same name, the descriptor is treated as a parse error.
- これら 3 種の記述子は、単独の値に代えて, 2 個の値による範囲( `*^t `*^t )も受容する。 値のうち小さくない方が範囲の上限を与え,他方は下限を与える。 単独の値は、上限と下限が一致する範囲と同じ意味になる。 範囲は、`~font照合~algo$secにて利用される。 ◎ Ranges are accepted in these three descriptors in place of a single value. Where a single value is specified, it has the same meaning as a range with identical startpoint and endpoint. User agents must swap the computed value of the startpoint and endpoint of the range in order to forbid decreasing ranges. Both endpoints are inclusive. The ranges are used in the Font Matching Algorithm below.
-
これら 3 種の記述子は、値 `auto^v も受容する — その効果は: ◎ The auto values for these three descriptors have the following effects:
- ~font選定の目的においては、~fontは適切な初期~値が選ばれていたかのように選定される。 ◎ For font selection purposes, the font is selected as if the appropriate initial value is chosen
- 異体~軸の切詰法においては、切詰法は生じない ◎ For variation axis clamping, clamping does not occur
これらの書体-~style属性~用の値は、下層の~font~dataにより黙示される~styleに代えて利用される。 これにより,作者は、元々の~font~dataが異なる~~形に編成されている状況においても,いくつかの書体を柔軟に組合することが可能になる。 合成的な[ ~bold化/~oblique化 ]を実装する~UAは、[ ~font~dataにより黙示される~style属性 ]に基づいてではなく,~font記述子から必要と黙示された所に限り、合成的な~style法を適用し~MUST。 しかしながら, `font-face^at で定義した~fontに適用される各~異体~値は、[ それらの記述子~内に指定された値, ~font~file自身が~supportする値 ]の両者により切詰められることになる。 ◎ The value for these font face style attributes is used in place of the style implied by the underlying font data. This allows authors to combine faces in flexible combinations, even in situations where the original font data was arranged differently. User agents that implement synthetic bolding and obliquing must only apply synthetic styling in cases where the font descriptors imply this is needed, rather than based on the style attributes implied by the font data. However, variation values applied to fonts defined with '@font-face' will be clamped to both the values specified in these descriptors as well as the values supported by the font file itself.
この節にて定義される~font記述子は、[ 所与の族に対し `font-face$at 規則により定義された,~fontの集合 ]から,~fontを選定するときに利用される。 ◎ The font descriptors defined in this section are used for selecting a font from within the set of fonts defined by @font-face rules for a given family.
単独の~regular体fのみを包含している族を考える: ◎ Consider a family containing a single, regular face:
@font-face { font-family: BaskervilleSimple; src: url(baskerville-regular.woff); }
~style付けされていない~textは, `font-face$at 規則の中で定義された~regular体fを利用して表示されることになる: ◎ Unstyled text would display using the regular face defined in the @font-face rule:
しかしながら、~italic~textについては,別々に定義された~italic体fはないので、大多数の~UAは,~regular体fからの~glyphを 合成的に~oblique化して表示することになる: ◎ However, italic text would display in most user agents using synthetically obliqued glyphs from the regular face, since a separate italic face is not defined:
次に、実際に~italic体fが定義されている族を考える: ◎ Now consider a family for which an actual italic face is defined:
@font-face { font-family: BaskervilleFull; src: url(baskerville-regular.woff); } @font-face { font-family: BaskervilleFull; src: url(baskerville-italic.woff); font-style: italic; }
2 個目の `font-face$at 規則は、~style属性に[
~italic -style, ~normal -weight, ~normal -stretch
]を持つ~font資源
baskerville-italic.woff
を定義する。
~italic~textを表示するときは、~UAは,~italic~textに最も近く合致する この~fontを利用することになる。
従って、~regular体fからの~glyphを合成的に~oblique化するのではなく,活字~designerにより~designされた~glyphを利用して、~textが表示される:
◎
The second @font-face rule defines the font resource baskerville-italic.woff to have style attributes of normal weight, normal stretch and italic style. When displaying italic text, the user agent will use this font, since it’s the closest match for italic text. Thus, the text will display using glyphs designed by a type designer rather than using synthetically obliqued glyphs from the regular face:
~font族の中から特定0の書体を選定するための処理についての,より完全な詳細は、 ~font~styleの照合 節に。 ◎ See the section on font matching for more complete details of the process used to select a particular face within a font family.
4.5. 文字~範囲: `unicode-range^d 記述子
◎述 `unicode-range@d ◎用 `font-face$at ◎値 `urange$t# ◎初 `U+0-10FFFF^v ◎表終この記述子を宣言することにより、書体-が~supportし得る~Unicode符号位置たちの集合を定義できる。 記述子は、一連の~Unicode範囲( `urange$t )からなる,~comma区切りの~listを値にとる。 符号位置の集合は、これらの範囲の和集合として定義され,~UAが[ 所与の~text連なり用に~font資源を~downloadするかどうか ]を裁定する際の~hintになる。 ◎ This descriptor defines the set of Unicode codepoints that may be supported by the font face for which it is declared. The descriptor value is a comma-delimited list of Unicode range (<urange>) values. The union of these ranges defines the set of codepoints that serves as a hint for user agents when deciding whether or not to download a font resource for a given text run.
各 `urange$t ~tokenは、接頭辞[ `U+^css または `u+^css ]と後続する符号位置~範囲からなる。 符号位置~範囲は、次に挙げる 3 種いずれかの形をとる — この形に収まらないものは無効になり,当の宣言は無視されることになる: ◎ Each <urange> value is a UNICODE-RANGE token made up of a "U+" or "u+" prefix followed by a codepoint range in one of the three forms listed below. Ranges that do not fit one of the these forms are invalid and cause the declaration to be ignored.
- 単独の符号位置(例: `U+416^v ) ◎ single codepoint (e.g. U+416)
- 1 〜 6 個の 16 進~数字dとして表現される, 1 個の~Unicode符号位置のみからなる範囲 ◎ a Unicode codepoint, represented as one to six hexadecimal digits
- 区間範囲(例: `U+400-4ff^v ) ◎ interval range (e.g. U+400-4ff)
- ~hyphenで区切られた 2 個の 16 進~数字d列として表現される範囲 — 2 個の数字d列は、順に,範囲の[ 始端, 終端 ]を指示する。 ◎ represented as two hyphen-separated Unicode codepoints indicating the inclusive start and end codepoints of a range
- ~wildcard範囲(例: `U+4??^v ) ◎ wildcard range (e.g. U+4??)
- 尾部の各 文字 `?^css が任意の 16 進~数字dを表すとするときの,符号位置の集合として定義される範囲。 ◎ defined by the set of codepoints implied when trailing '?' characters signify any hexadeximal digit
ここで: ◎ ↓
- 個々の符号位置は、 ~Unicode文字~符号位置 に対応する 16 進~値で記される。 ◎ Individual codepoints are written using hexadecimal values that correspond to Unicode character codepoints.\
- いずれにせよ、符号位置を与える各 数字dは,文字大小無視であり、指示される符号位置は,範囲 { 0 〜 10FFFF } に入ら~MUST。 ◎ Unicode codepoint values must be between 0 and 10FFFF inclusive. Digit values of codepoints are ASCII case-insensitive.\
- 区間範囲における終端の符号位置は、始端の符号位置~以上で~MUST。 ◎ For interval ranges, the start and end codepoints must be within the range noted above and the end codepoint must be greater than or equal to the start codepoint.
- 先頭の数字dを欠いている~wildcard範囲(例: `U+???^v )も妥当であり,先頭に数字d `0^css を付与した~wildcard範囲(例: `U+0???^v , すなわち `U+0000-0FFF^v )と等価になる。 ~Unicode符号位置の範囲に~~収まり切らない~wildcard範囲は無効になる。 したがって、~wildcard範囲は 6 桁まで受容するが,その尾部を成す~wildcard文字 `?^css は 5 個までになる。 ◎ Wildcard ranges specified with ‘?’ that lack an initial digit (e.g. "U+???") are valid and equivalent to a wildcard range with an initial zero digit (e.g. "U+0???" = "U+0000-0FFF"). Wildcard ranges that extend beyond the range of Unicode codepoints are invalid. Because of this, the maximum number of trailing '?' wildcard characters is five, even though the UNICODE-RANGE token accepts six.
`unicode-range$d 記述子の宣言に含まれる~Unicode範囲~listにおいては,複数の範囲が互いに重合しても~MAY。 これらの範囲の和集合が,対応している~fontから利用され得る[ 符号位置の集合 ]を定義する。 ~UAは、この集合に入らない符号位置に対しては,当の~fontを~downloadしたり利用しては~MUST_NOT。 ~UAは、範囲~listを,同じ[ 符号位置の集合 ]を表現する,異なる~listに正規化しても~MAY。 ◎ Within the comma-delimited list of Unicode ranges in a unicode-range descriptor declaration, ranges may overlap. The union of these ranges defines the set of codepoints for which the corresponding font may be used. User agents must not download or use the font for codepoints outside this set. User agents may normalize the list of ranges into a list that is different but represents the same set of codepoints.
当の~fontは[ `unicode-range$d 記述子が定義する[ 符号位置の集合 ]]の一部に対し,対応する~glyphを包含しないかもしれない。 ~fontが利用されるときの `有効~文字map@ とは、[ `unicode-range$d により定義される[ 符号位置の集合 ]]と[ ~fontの`文字map$ ]との共通部分(積集合)として,定義される。 これにより,作者は、下層の~fontが~supportする符号位置の精確な範囲について気にせずに,~supportされる範囲を おおまかな範囲で定義できるようになる。 ◎ The associated font might not contain glyphs for the entire set of codepoints defined by the unicode-range descriptor. When the font is used, the effective character map is the intersection of the codepoints defined by unicode-range with the font’s character map. This allows authors to define supported ranges in terms of broad ranges without worrying about the precise codepoint ranges supported by the underlying font.
4.5.1. 組成-~fontを定義するための文字~範囲の用法
同じ[ 族と[ 一連の~style記述子の値 ]]に対し,異なる `unicode-range$d を伴うような、複数の `font-face$at 規則を利用して、[ 用字系ごとに異なる~font ]からの~glyphを混合する[ 組成-~font ]を創出できる。 これを,いくつかの[[ 単独の用字系(例えば, ~Latin, ~Greek, ~Cyrillic )用の~glyph ]のみを包含する~font ]を組合する~~目的に利用できる。 あるいは,作者はこれを、~fontを[ 共通的に利用される文字~用の~font ]と[ さほど利用されない文字~用の~font ]に区分する方法として利用できる。 ~UAは,必要な~fontのみを取り寄せることになるので、頁~帯域幅の節約にもなる。 ◎ Multiple @font-face rules with different unicode ranges for the same family and style descriptor values can be used to create composite fonts that mix the glyphs from different fonts for different scripts. This can be used to combine fonts that only contain glyphs for a single script (e.g. Latin, Greek, Cyrillic) or it can be used by authors as a way of segmenting a font into fonts for commonly used characters and less frequently used characters. Since the user agent will only pull down the fonts it needs this helps reduce page bandwidth.
同じ[ 族と[ 一連の~style記述子の値 ]]を伴う 複数の `font-face$at 規則 において, `unicode-range$d が重合している場合、それらの規則が検査される順序は,それらが定義された順序の逆順になる。 したがって、最後に定義されている規則が,所与の文字に対し最初に検査される。 ◎ If the unicode ranges overlap for a set of @font-face rules with the same family and style descriptor values, the rules are ordered in the reverse order they were defined; the last rule defined is the first to be checked for a given character.
特定の[ 言語や文字 ]に対する範囲の例: ◎ Example ranges for specific languages or characters:
- `unicode-range^d: `U+A5^v;
- 単独の符号位置:[円/元]通貨記号 ◎ a single code point, the yen/yuan symbol
- `unicode-range^d: `U+0-7F^v;
- 基本 ASCII文字の符号範囲 ◎ code range for basic ASCII characters
- `unicode-range^d: `U+590-5ff^v;
- ~Hebrew文字の符号範囲 ◎ code range for Hebrew characters
- `unicode-range^d: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
- ~Japanese[ 漢字, 平仮名, 片仮名 ]文字, および[円/元]通貨記号の符号範囲 ◎ code range for Japanese kanji, hiragana and katakana characters plus yen/yuan symbol
BBC はニュースサービスを様々な言語で供しているが、その多くは,すべての~platformに渡り十分に~supportされているとは限らない。 `font-face$at 規則を利用して、 BBC は,これらのどの言語~用の~fontも[ 手動による~font~downloadにより すでに行われていた ]かのように,供せるようになるであろう。 ◎ The BBC provides news services in a wide variety of languages, many that are not well supported across all platforms. Using an @font-face rule, the BBC could provide a font for any of these languages, as it already does via a manual font download.
@font-face { font-family: BBCBengali; src: url(fonts/BBCBengali.woff) format("woff"); unicode-range: U+00-FF, U+980-9FF; }
技術文書では、多岐に渡る記号を要することが多い。 STIX ~font~projectは、[ 標準~化された仕方で,多岐に渡る技術用の植字-法を~supportするための~font ]を供することを目指している~projectの一つである。 下の例に,[ ~Unicode内の[ 多数の 数学用/技術用 記号 ]用の~glyph ]を供する~fontの利用を示す: ◎ Technical documents often require a wide range of symbols. The STIX Fonts project is one project aimed at providing fonts to support a wide range of technical typesetting in a standardized way. The example below shows the use of a font that provides glyphs for many of the mathematical and technical symbol ranges within Unicode:
@font-face { font-family: STIXGeneral; src: local(STIXGeneral), url(/stixfonts/STIXGeneral.otf); unicode-range: U+000-49F, U+2000-27FF, U+2900-2BFF, U+1D400-1D7FF; }
次の例は、作者が,[ ~Japanese~fontの中で利用される~Latin文字 ]の~glyphを,異なる~fontからの~glyphで上書きする方法を示している。 1 個目の規則は,範囲を指定していないので、既定で全範囲になる。 [ 2 個目の規則の中で指定される範囲 ]は重合することになるが、より後の方で定義されているので,より優先される。 ◎ This example shows how an author can override the glyphs used for Latin characters in a Japanese font with glyphs from a different font. The first rule specifies no range so it defaults to the entire range. The range specified in the second rule overlaps but takes precedence because it is defined later.
@font-face {
font-family: JapaneseWithGentium;
src: local(MSMincho);
/*
範囲は指定されていないので、既定で全範囲になる。
◎
no range specified, defaults to entire range
*/
}
@font-face {
font-family: JapaneseWithGentium;
src: url(../fonts/Gentium.woff);
unicode-range: U+0-2FF;
}
帯域幅を最適化するために、[ ~Latin, ~Japanese, その他 ]の文字を,それぞれ異なる~font~fileに分離することにより構築される、族を考える: ◎ Consider a family constructed to optimize bandwidth by separating out Latin, Japanese and other characters into different font files:
/* ~fallback~font — ~size: 4.5MB ◎ fallback font - size: 4.5MB */ @font-face { font-family: DroidSans; src: url(DroidSansFallback.woff); /* 範囲は指定されていないので、既定で全範囲になる。 ◎ no range specified, defaults to entire range */ } /* ~Japanese~glyph — ~size: 1.2MB ◎ Japanese glyphs - size: 1.2MB */ @font-face { font-family: DroidSans; src: url(DroidSansJapanese.woff); unicode-range: U+3000-9FFF, U+ff??; } /* いくつかの約物と記号も伴われた ~Latin, ~Greek, ~Cyrillic — ~size: 190KB ◎ Latin, Greek, Cyrillic along with some punctuation and symbols - size: 190KB */ @font-face { font-family: DroidSans; src: url(DroidSans.woff); unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300; }
単純な~Latin~textに対しては、~Latin文字~用の~fontのみが~downloadされる: ◎ For simple Latin text, only the font for Latin characters is downloaded:
body { font-family: DroidSans; } <p>This is that</p>
この場合、~UAはまず,[ ~Latin文字を包含している~font( DroidSans.woff ) ]に対する `unicode-range$d を検査する。 上の文字はすべて,範囲 U+0-5FF に入るので、~UAは,その~fontを~downloadした上で,~textをその~fontにより描画する。 ◎ In this case the user agent first checks the unicode-range for the font containing Latin characters (DroidSans.woff). Since all the characters above are in the range U+0-5FF, the user agent downloads the font and renders the text with that font.
次に,矢印~文字( ⇨ )を利用する~textを考える: ◎ Next, consider text that makes use of an arrow character (⇨):
<p>This ⇨ that<p>
ここでも~UAは,最初に[ ~Latin文字を包含している~font ]の `unicode-range$d を検査する。 矢印の符号位置( `21E8^U )は,範囲 `U+2000-2300^v に入るので、~UAは,その~fontを~downloadする。 しかしながら,~Latin~fontは,この文字に合致している~glyphを持たないので、この符号位置は[ ~font照合~用に利用される有効 `unicode-range^d ]から除外される。 次に,~UAは~Japanese~fontを評価する。 ~Japanese~fontに対する `unicode-range^d は[ `U+3000-9FFF^v, および `U+ff??^v ]であり, `21E8^U は含まれていないので、~UAは,その~Japanese~fontを~downloadしない。 次に,~fallback~fontが考慮される。 ~fallback~font用の `font-face$at 規則は, `unicode-range^d を定義していないので、その値は,既定で[ すべての~Unicode符号位置からなる集合 ]になる。 ~fallback~fontが,矢印~文字を描画するために~downloadされて利用される。 ◎ The user agent again first checks the unicode-range of the font containing Latin characters. Since U+2000-2300 includes the arrow code point (U+21E8), the user agent downloads the font. For this character however the Latin font does not have a matching glyph, so the effective unicode-range used for font matching excludes this code point. Next, the user agent evaluates the Japanese font. The unicode-range for the Japanese font, U+3000-9FFF and U+ff??, does not include U+21E8, so the user agent does not download the Japanese font. Next the fallback font is considered. The @font-face rule for the fallback font does not define unicode-range so its value defaults to the range of all Unicode code points. The fallback font is downloaded and used to render the arrow character.
4.6. ~font特能: `font-variant^d, `font-feature-settings^d, `font-variation-settings^d 記述子
◎述 `font-variant@d ◎用 `font-face$at ◎値 `normal^v | `none^v | [ `common-lig-values$t || `discretionary-lig-values$t || `historical-lig-values$t || `contextual-alt-values$t || `stylistic$v(`feature-value-name$t) || `historical-forms$v || `styleset$v(`feature-value-name$t #) || `character-variant$v(`feature-value-name$t #) || `swash$v(`feature-value-name$t) || `ornaments$v(`feature-value-name$t) || `annotation$v(`feature-value-name$t) || [ `small-caps$v | `all-small-caps$v | `petite-caps$v | `all-petite-caps$v | `unicase$v | `titling-caps$v ] || `numeric-figure-values$t || `numeric-spacing-values$t || `numeric-fraction-values$t || `ordinal$v || `slashed-zero$v || `east-asian-variant-values$t || `east-asian-width-values$t || `ruby$v || [ `sub$v | `super$v ] ] ◎初 `normal^v ◎表終 ◎述 `font-feature-settings@d ◎用 `font-face$at ◎値 `normal^v | `feature-tag-value$t# ◎初 `normal^v ◎表終 ◎述 `font-variation-settings@d ◎用 `font-face$at ◎値 `normal^v | [ `string$t `number$t ] # ◎初 `normal^v ◎表終これらの記述子は、[ `font-face$at 規則により定義される~font ]の描画-時に適用される,初期~設定群を定義する。 これらは~fontの選定には影響しない。 各種 値は、`~CSS全域~keyword$は~~除外されることを除き,対応する[ `font-variant$p, `font-feature-settings$p, `font-variation-settings$p ]~prop用に定義されるものに一致する。 複数の[ ~font特能[ 記述子/~prop/ 異体 ], および任意選択の`有名~instance$ ]が利用されるときの,[ ~text描画における累積的な効果 ]についての詳細は、`~font特能と異体の解決$secにて。 [ 一連の特定の値 ]が,[[ ある `font-variant$p 下位prop ]用に合成される~fallback ]を定義している所では、合成された同じ~fallbackが,[ それらの値の中で利用される【?】が `font-variant$d 記述子と伴用されたとき ]にも適用される。 ◎ These descriptors define initial settings that apply when the font defined by an @font-face rule is rendered. They do not affect font selection. Values are identical to those defined for the corresponding font-variant, font-feature-settings, and font-variation-settings properties defined below except that the CSS-wide keywords are omitted. When multiple font feature descriptors, properties, or variations are used, optionally along with a named instance, the cumulative effect on text rendering is detailed in the section §7 Font Feature and Variation Resolution below. In cases where specific values define synthesized fallback for certain font-variant subproperties, the same synthesized fallback applies when used within those values are used with the font-variant descriptor.
これらの記述子は、要素~全体ではなく, `font-face$at 規則が表現する~font~obj上に[ 特能, 異体 ]値を設定する。 したがって,これらの記述子を利用した場合、`~cluster照合$secに因り,要素~内の一部の~glyphしか その特能で描画されないこともある。 ◎ These descriptors set features and variation values on the font object which the @font-face rule represents, rather than on an entire element. Therefore, when using these descriptors, only some glyphs in an element may be rendered with that feature, due to §5.3 Cluster matching.
4.7. 可変~fontからの有名~instanceの利用-法: `font-named-instance^d 記述子
◎述 `font-named-instance@d ◎用 `font-face$at ◎値 `auto^v | `string$t ◎初 なし(必須) ◎表終`font-named-instance$d 記述子が `auto^v 以外の値に設定されている場合、`~font特能と異体の解決$secにおける適切な段階にて,~font~fileを検分して、[ ~font内の`有名~instance$のうち,[ その地域化d名は、`地域化d名の照合$secに与えた規則に則って,所与の `string^t に等しいもの ]のうち,最初のものを見出す。 そのような有名~instanceは存在しない場合、この記述子は値 `auto^v にされていたかのように扱われる。 他の場合、この有名~instanceの異体~軸~値は、`~font特能と異体の解決$sec内の この位置【?】に適用される。 【 “`有名~instance$( `named instance^en )” の概念が何を意味するのかは、何も述べられていない。】 ◎ If the font-named-instance descriptor is set to a value other than auto, then the appropriate stage in the §7 Font Feature and Variation Resolution will inspect the font file to find the first named instance in the font which has a localized name equal to the given according to the rules given in §5.1 Localized name matching. If no such named instance exists, this descriptor is treated as if it has a value of auto. Otherwise, this named instance’s variation axis values are applied a this position in the §7 Font Feature and Variation Resolution.
例えば、次の `font-face$at ~blockは、名前 `Grotesque^F の~instanceを適用しつつ, `XHGT^tag 軸の値は 0.7 をとるよう上書きすることになる。 ◎ For example, the following @font-face block will apply the instance named "Grotesque" but will override the "XHGT" axis to have a value of 0.7.
@font-face { font-family: "AccuroVar"; src: url("accurovar.otf") format("opentype"); font-named-instance: "Grotesque"; font-variation-settings: "XHGT" 0.7; }
注記: [ `font-weight$p / `font-stretch$p / `font-style$p ]~prop内に給される異体~軸~値は, `font-named-instance$d 記述子~内の値より前に適用されるので、`有名~instance$が欲されるときは,それらの~propの値を変更する必要は無い。 ◎ Note: Because the variation axis values supplied in the font-weight, font-stretch, and font-style properties are applied before the value in the font-named-instance descriptor, there is no need to change the value of those properties when a named instance is desired.
4.8. ~font要請の指針
4.8.1. ~font読込みの指針
`font-face$at 規則は、~lazyな読込み — ~font資源は、文書~内で利用されるときに限り~downloadされる — を許容するように設計されている。 ~stylesheetには、[ 選定された集合のみを利用するような,~fontの~library ]用に, `font-face$at 規則を含ませれる。 ~UAは、[ ~style規則~内から参照rされている~font ]のうち,[ 所与の頁に適用-可能なもの ]のみを~downloadし~MUST。 [ それらの~fontが頁~内で~~実際に利用されるかどうか ]について考慮せずに,[ `font-face$at 規則にて定義される~font ]すべてを~downloadする~UAは、不適合と見なされる。 [ 文字~fallbackが生じる場合に~fontが~downloadされ得る ]下では、~UAは[[[ 所与の~text連なりに対する `font-family$p ]の算出値 ]に包含されている~font ]を~downloadしても~MAY。 ◎ The @font-face rule is designed to allow lazy loading of font resources that are only downloaded when used within a document. A stylesheet can include @font-face rules for a library of fonts of which only a select set are used; user agents must only download those fonts that are referred to within the style rules applicable to a given page. User agents that download all fonts defined in @font-face rules without considering whether those fonts are in fact used within a page are considered non-conformant. In cases where a font might be downloaded in character fallback cases, user agents may download a font if it’s contained within the computed value of font-family for a given text run.
@font-face { font-family: GeometricModern; src: url(font.woff); } p { /* ~fontは、`p^e 要素を伴う頁に対しては~downloadされることになる ◎ font will be downloaded for pages with p elements */ font-family: GeometricModern, sans-serif; } h2 { /* `h2^e 要素を伴う頁に対しては、`Futura^F が~localに可用であっても,~fontが~downloadされ得る ◎ font may be downloaded for pages with h2 elements, even if Futura is available locally */ font-family: Futura, GeometricModern, sans-serif; }
~download可能な~fontが可用になる前に,~textual内容が読込まれた所では、~UAは, `font-face$at ~blockを成す `font-display$d 記述子に則って ~textを描画し~MUST。 ~UAは、~fontの~downloadに失敗した所では,~textを可視になるよう表示し~MUST 作者には,巨大~頁の~reflowを避けるため、アリな所では,~fallback~fontには[ ~font~listの中の,~download可能な~fontの計量に近く合致するもの ]を利用することを強く勧める。 ◎ In cases where textual content is loaded before downloadable fonts are available, user agents must render text according to the font-display descriptor of that @font-face block. In cases where the font download fails, user agents must display the text visibly. Authors are advised to use fallback fonts in their font lists that closely match the metrics of the downloadable fonts to avoid large page reflows where possible.
4.8.2. ~font~fetchingに課される要件
~UAは、 `font-face$at 規則~内で定義される~URLに対する~fontの読込みには,[ `~CORSもあり得る~fetch$† `HTML5$r ]を利用し~MUST — ( url , 行先, ~CORS属性~状態 ) として ( ~stylesheetの~URL, `style^l, Anonymous ) を与える下で。 ◎ For font loads, user agents must use the potentially CORS-enabled fetch method defined by the [HTML5] specification for URL’s defined within @font-face rules. When fetching, user agents must use "Anonymous" mode, set the referrer source to the stylesheet’s URL and set the origin to the URL of the containing document.
【† この用語 “`potentially CORS-enabled fetch^en” の 原文による~link先 では~~意味が通らないので、この訳では想像により補完している。 】
注記: 作者にとってこれが含意する所は、作者がそれを許可する手続きを特に踏まない限り,非同一生成元からの~fontは,概ね読込まれなくなることである。 ~siteは `Access-Control-Allow-Origin^h ~HTTP~headerの利用により,~siteをまたがる~font~dataの読込みを明示的に許容できる。 他の【 HTTP(S) 以外の 】~schemeに対しては、 `~CORSもあり得る~fetch$により許可されるものを超えて[ 定義される または要求される ]ような,[ 非同一生成元からの読込みを許容する明示的な仕組み ]は存在しない。 ◎ Note: The implications of this for authors are that fonts will typically not be loaded cross-origin unless authors specifically takes steps to permit cross-origin loads. Sites can explicitly allow cross-site loading of font data using the Access-Control-Allow-Origin HTTP header. For other schemes, no explicit mechanism to allow cross-origin loading, beyond what is permitted by the potentially CORS-enabled fetch method, is defined or required.
下に与える例では、文書の所在が https://example.com/page.html であり, かつ すべての~URLの~linkは[ ~UAから~supportされる妥当な~font資源 ]を指しているとする。 ◎ For the examples given below, assume that a document is located at https://example.com/page.html and all URL’s link to valid font resources supported by the user agent.
下の[ 各種 `src$d 記述子 の値 ]により定義される~fontは,読込まれることになる: ◎ Fonts defined with the src descriptor values below will be loaded:
/* 同一生成元(すなわち,[ ~domain, ~scheme, ~port ]が文書のそれに合致する) ◎ same origin (i.e. domain, scheme, port match document) */ src: url(fonts/simple.woff); /* ~redirectを伴わないdata:
~URLは,同一生成元として扱われる ◎ data url’s with no redirects are treated as same origin */ src: url("data:application/font-woff;base64,..."); /* 非同一生成元 — ~domainが異なる ◎ cross origin, different domain */ /* が, `Access-Control-Allow-Origin^h 応答~headerは '*
' に設定されているとする ◎ Access-Control-Allow-Origin response header set to '*' */ src: url(http://another.example.com/fonts/simple.woff);
下の[ 各種 `src$d 記述子の値 ]により定義される~fontの読込みは,失敗することになる(いずれも,応答の中に `Access-Control-…^^h ~headerは~~無いとする): ◎ Fonts defined with the src descriptor values below will fail to load:
/* 非同一生成元 — ~schemeが異なる ◎ cross origin, different scheme ◎ no Access-Control-xxx headers in response */ src: url(https://example.com/fonts/simple.woff); /* 非同一生成元 — ~domainが異なる ◎ cross origin, different domain ◎ no Access-Control-xxx headers in response */ src: url(http://another.example.com/fonts/simple.woff);
4.9. `font-face^at ごとの~font表示-の制御-法: `font-display^d 記述子
`font-face$at 用の `font-display$d 記述子は、ある書体-を,それが[ いつ~downloadされ利用するに準備済みになったか ]に基づいて,どう表示するかを決定する。 ◎ The font-display descriptor for @font-face determines how a font face is displayed, based on whether and when it is downloaded and ready to use.
◎述 `font-display@d ◎用 `font-face$at ◎値 `auto^v | `block$v | `swap$v | `fallback$v | `optional$v ◎初 `auto^v ◎表終注記: ~UAは、これらのどの値に対しても, `font-display$d 構文では直に表せないような[ 少しばかり異なる所要時間 / より洗練された挙動 ]を利用して,利用者にとってより有用な挙動を供しても~MAY。 また、作者が選んだ挙動を何かより望ましい挙動で上書きする能を,利用者に供しても~MAY — 例えば, すべての~fontに対し`阻み期間$を 0 秒にするよう強制するなど。 ◎ Note: For all of these values, user agents may use slightly different durations, or more sophisticated behaviors that can’t be directly expressed in the font-display syntax, in order to provide more useful behavior for their users. They may also provide the ability for users to override author-chosen behavior with something more desirable; for example, forcing all fonts to have a 0s block period.
- `auto^v
- ~UAが,~font表示-施策を定義する。 ◎ The font display policy is user-agent-defined.
- 注記: 多くの~browserは、 `block$v が指定するものと類似する施策を,既定にしている。 ◎ Note: Many browsers have a default policy similar to that specified by block.
- `block@v
- 短い`阻み期間$(ほとんどの事例では、 3 秒が推奨される)と無限の`入替~期間$を,書体-に与える。 ◎ Gives the font face a short block period (3s is recommended in most cases) and an infinite swap period.
- 注記: 言い換えれば,~browserは、[ 読込まれていない場合は、先ず “不可視” ~textを描く ]が,書体-が読込まれ次第 入替える。 ◎ Note: In other words, the browser draws "invisible" text at first if it’s not loaded, but swaps the font face in as soon as it loads.
- この値は、[ 頁が利用-可能になるためには、特定0の~fontで~textを描画することが要求される ]ときに限り,利用され~MUST。 それは、小さな~text片に限り利用され~MUST。 ◎ This value must only be used when rendering text in a particular font is required for the page to be usable. It must only be used for small pieces of text.
-
例えば,不良に設計された “~icon~font” は、 "⎙" (印刷)~iconを "C" の様な無関係な文字に結付けるかもしれない。 そのようなとき,~textが~fallback~fontで表示される場合、欲される~iconでなく,意味不明な普通字が頁に散在することになる。 この事例では、一時的に虫食いにした方が~fallback~fontを利用するより良くなる。 ◎ For example, badly designed "icon fonts" might associate a "⎙" (print) icon with an unrelated character like "C", so if the text is displayed with a fallback font instead there will be confusing letters scattered around the page rather than the desired icon. In this case, temporary blank spots are better than using a fallback font.
(しかしながら,最終的には ~fallback~fontが利用される — ~linkその他が全く示されないより,頁に意味不明な普通字が散在する方が良いので) ◎ (However, the fallback font is used eventually, as having confusing letters scattered around the page is better than having links and such never show up at all.)
- `swap@v
- 極めて短い`阻み期間$(ほとんどの事例では、 0.1 秒~以下が推奨される)と無限の`入替~期間$を,書体-に与える。 ◎ Gives the font face an extremely small block period (100ms or less is recommended in most cases) and an infinite swap period.
- 注記: 言い換えれば,~browserは、[ 書体-が読込まれていない場合には、即時に~fallbackで~textを描く ]が,書体-が読込まれ次第 入替える。 ◎ Note: In other words, the browser draws the text immediately with a fallback if the font face isn’t loaded, but swaps the font face in as soon as it loads.
- この値は、[ 頁にとって特定0の~fontによる~textの描画がごく重要であるが,どの~fontによる描画も 依然として正しい~messageを~~伝えるとき ]に限り,利用されるべきである。 それは、小さな~text片に限り利用されるべきである。 ◎ This value should only be used when rendering text in a particular font is very important for the page, but rendering in any font will still get a correct message across. It should only be used for small pieces of text.
- 例えば,ある~web~siteが ~logoの描画~用に~custom~fontを用いる場合、その~logoを正しく描画することは,~brandingの目的には それなりに重要になるが、他の~fontで~logoを表示しても,少なくとも~~要点はきちんと~~伝わるとき。 ◎ For example, if a website has a custom font for rendering their logo, rendering that logo correctly is fairly important for branding purposes, but displaying the logo in any font will at least get the point across without confusion.
- `fallback@v
- 極めて短い`阻み期間$(ほとんどの事例では、 0.1 秒~以下が推奨される)と 短い`入替~期間$(ほとんどの事例では、 3 秒が推奨される)を,書体-に与える。 ◎ Gives the font face an extremely small block period (100ms or less is recommended in most cases) and a short swap period (3s is recommended in most cases).
- 注記: 言い換えれば、[ 書体-が読込まれなかった場合は、先ず~fallbackで描画される ]が,読込まれ次第 入替える。 しかしながら,それまでに時間がかかり過ぎた場合、それ以降も その頁が存続する限り~fallbackが利用されることになる。 ◎ Note: In other words, the font face is rendered with a fallback at first if it’s not loaded, but it’s swapped in as soon as it loads. However, if too much time passes, the fallback will be used for the rest of the page’s lifetime instead.
- この値は、[ ~fontの利用が有用で欲されるが、利用者にとって,~fallback~fontで~textを見ることも受容-可能である所 ]で,本文その他の~text用に利用されるべきである。 この値は、大きな~text片に利用するのが適切になる。 ◎ This value should be used for body text, or any other text where the use of the chosen font is useful and desired, but it’s acceptable for the user to see the text in a fallback font. This value is appropriate to use for large pieces of text.
- 例えば,大きな本文~text片においては、利用者がアリな限り素早く読み始めれるよう,単に~textが素早く描画されることが最も重要になる。 更に,利用者が読み始めて以降は、新たな~fontに入替わるに伴い ~textが不意に “ズレる” ことにより妨害されるべきでない — 読んでいた箇所を見つけ直すのは、~~面倒なので。 ◎ For example, in large pieces of body text, it’s most important just to get the text rendered quickly, so the user can begin to read as quickly as possible. Further, once the user has started reading, they shouldn’t be disturbed by the text suddenly "shifting" as a new font is swapped in, as that’s distracting and annoying to re-find where one was in the text.
- `optional@v
- 極めて短い`阻み期間$(ほとんどの事例では、 0.1 秒~以下が推奨される)と 0 秒の`入替~期間$を,書体-に与える。 ◎ Gives the font face an extremely small block period (100ms or less is recommended in most cases) and a 0s swap period.
- この 2 つの期間内に,~fontが検索取得されなかった場合、~UAは[ ~font~downloadを中止する/ごく低優先度で~downloadする ]ことにしても~MAY。 ~UAは、利用者にとって有用になると予見する場合には,[ ~font~downloadを開始するのを避けて,~fallback~fontを即時に利用する ]ことにしても~MAY。 ◎ If the font is not retrieved before the two durations expire, the user agent may choose to abort the font download, or download it with a very low priority. If the user agent believes it would be useful for the user, it may avoid even starting the font download, and proceed immediately to using a fallback font.
- 注記: 言い換えれば、~fontは,すでに~downloadされていて可用ならば利用されるが、さもなければ,それ以降も頁が存続する限り~fallbackが利用される。 ~fontは、~~裏で~downloadされ,未来の頁の読込-時には可用になるかもしれないが、~UAは,利用者の帯域幅はごく制限されていることを検出したときは、単純に,決して~fontを~downloadして利用しないことを選ぶかもしれない。 ◎ Note: In other words, the font is used if it’s already downloaded and available, but otherwise a fallback is used for the rest of the page’s lifetime instead. The font might download in the background and be available to future page loads, but if the user-agent detects that the user has very limited bandwidth, it might choose to simply never download and use the font.
- この値は、[ 選ばれた~fontは純粋に装飾的で, “あったらいい感じ” になる所 ]で,本文その他の~text用に利用されるべきである。 それは、利用者が~web頁を最初に訪問したとき,[ 何もかもが~~一挙に完璧に見えるまで長く待機するより,素早く描画する方が重要である ]ときには、いつでも利用されるべきである。 ◎ This value should be used for body text, or any other text where the chosen font is purely a decorative "nice-to-have". It should be used anytime it is more important that the web page render quickly on first visit, than it is that the user wait a longer time to see everything perfect immediately.
-
例えば、本文~textは、~browserの既定の~fontで完璧に読める — ~download可能な書体-の方が、より見栄えして,~siteの美観にも良くかみ合うかもしれないが。 ~siteへの初回の訪問者は、一般に,~siteの表示が~~美麗になることより,素早く利用-可能になる方をずっと気にする。 `optional$v は、そのための良好な挙動を供する。 後で再訪したときは、欲された書体-を~downloadし終えているかもしれず,初回/後続の訪問を遅めることなく “意図される” 体験を与えれるので。 ◎ For example, body text is perfectly readable in one of the browser default fonts, though a downloadable font face might be more attractive and mesh with the site’s aesthetics better. First time visitors to a site generally care far more about the site being quickly usable than they do about the finer points of its display, and optional provides a good behavior for them. If they return later, the desired font faces might have finished downloading, giving them the "intended" experience without slowing down either their first or subsequent visits.
接続がごく遅い利用者は “意図される” 体験を以後も受取らないかもしれないが、 `optional$v は — 読込むまで長くかかり過ぎたため,あきらめて他所へ行くことなく — ~siteを実際に利用できることを確保する。 ◎ Users on very slow connections might not ever receive the "intended" experience, but optional ensures they can actually use the site, rather than quitting and going elsewhere because the site takes too long to load.
4.9.1. `font-feature-values^at 介する,~font族ごとの~font表示の制御-法
`font-feature-values$at 用の `~font-displayFV$d 記述子は、[ 同じ~font族を対象にしている `font-face$at 規則たち ]用に “既定の” `font-display$d 値を設定することにより,~font族がどう表示されるかを決定する。 `font-face^at 規則~内で `font-display$d が省略されたときは、~UAは,[ `font-feature-values$at を介して `font-display^d 値が設定されている ]ならば,それを関連する~font族~用に利用し、無ければ `font-display$d は既定の `auto^v になる。 ◎ The font-display descriptor for @font-feature-values determines how a font family is displayed, by setting the "default" font-display value for @font-face rules targeting the same font family. When font-display is omitted in an @font-face rule, the user agent uses the font-display value set via @font-feature-values for the relevant font-family if one is set, and otherwise defaults to font-display: auto.
この仕組みは、~font族~全体 用の既定の表示-施策を設定するために利用できる — 開発者は、自身が直に制御していない `font-face$at 規則~用に表示-施策を設定-可能になる。 例えば,~fontが第三者主体~font鋳造所( `foundry^en )から~~配信されているとき、開発者は `font-face^at 規則を制御しなくとも,供された~font族~用に既定の `font-display^d 施策を設定-可能になる。 また,既定の表示-施策は~font族~全体に適用されるので、それを設定する能は, “脅迫状” 効果(すなわち,文字たちが不釣り合いな書体-で表示される)を避けるためにも有用になる。 ◎ This mechanism can be used to set a default display policy for an entire font-family, and enables developers to set a display policy for @font-face rules that are not directly under their control. For example, when a font is served by a third-party font foundry, the developer does not control the @font-face rules but is still able to set a default font-display policy for the provided font-family. The ability to set a default policy for an entire font-family is also useful to avoid the ransom note effect (i.e. mismatched font faces) because the display policy is then applied to the entire font family.
◎述 `~font-displayFV@d ◎用 `font-feature-values$at ◎値 `auto^v | `block^v | `swap^v | `fallback^v | `optional^v ◎初 `auto^v ◎表終4.10. 既定の~font言語の上書き法: `font-language-override^d 記述子
◎述 `font-language-override@d ◎用 `font-face$at ◎値 `normal^v | `string$t ◎初 `normal^v ◎表終この記述子は、[ `font-face@at 規則により定義された~fontが,描画されるとき ]に適用する初期~設定群を定義する。 それは、~font選定には影響しない。 各種 値は、`~CSS全域~keyword$は~~除外されることを除き, `font-language-override$p ~prop用に定義されるものに一致する。 複数の[ ~font特能[ 記述子/~prop/ 異体 ]]が利用されるときの,[ ~text描画における累積的な効果 ]についての詳細は、`~font特能と異体の解決$secにて。 ◎ This descriptor defines initial settings that apply when the font defined by an @font-face rule is rendered. It does not affect font selection. Values are identical to those defined for the font-language-override property defined below except that the value inherit is omitted. When multiple font feature descriptors, properties, or variations are used, the cumulative effect on text rendering is detailed in the section §7 Font Feature and Variation Resolution below.
5. ~font照合~algo
個々の~text連なりが,どのようにして~fontに結付けられるかは、以下の~algoに述べられる。 ~text連なりの中の各~文字ごとに,[ その文字~用の~glyphを包含している~font族 ]が選ばれ,特定0の書体-が選定される。 ◎ The algorithm below describes how fonts are associated with individual runs of text. For each character in the run a font family is chosen and a particular font face is selected containing a glyph for that character.
5.1. 地域化d名の照合
一部の~font~file形式では、書体-が複数の[[ 特定0の文字列(例:族~名や`有名~instance$) ]の地域化版 ]を持つことも許容されている。 ~UAは、それを認識した上で,[ 下層~platformによる地域化名, 利用する~system~API, 文書の符号化法 ]から独立に,これらの名前~すべてを正しく合致させ~MUST。 ◎ Some font file formats allow font faces to carry multiple localizations of a particular string (e.g. family name or named instance). User agents must recognize and correctly match all of these names independent of the underlying platform localization, system API used, or document encoding.
例えば、下に挙げる各~fontに対し,作者は `font-family$p ~prop内で[ ~Latin名, 地域化d名 ]のどちらも利用でき、その結果は,すべての~system上で一致することになる: ◎ For example, for each of the fonts listed below, the author can use either the Latin name or the localized name in the font-family property, and the results will be identical on all systems:
~Latin名 | 地域化d名 |
---|---|
GulimChe | 굴림체 |
Hiragino Kaku Gothic Pro | ヒラギノ角ゴ Pro |
Meiryo | メイリオ |
MingLiu | 細明體 |
MS Mincho | MS 明朝 |
Raanana | רעננה |
~UAは、これらの名前を, Unicode 仕様 `UNICODE$r にて要旨されている[ “`Default Caseless Matching^en” ~algo ]を利用して,文字大小無視の下で照合し~MUST。 この~algoの詳細は、その仕様の[ §3.13 “`Default Case Algorithms^en” ]に示されている。 特に,この~algoは、[ 文字列を正規化することなく, かつ いかなる言語~特有な誂えも適用することなく ]適用され~MUST。 この~algoが指定する大文字正規化~methodは、[ Unicode Character Database の~file "CaseFolding.txt" ]の中の[ "status" ~fieldに[ "C" または "F" ]が伴われた,文字大小~対応付け ]を利用する。 ◎ User agents must match these names case insensitively, using the "Default Caseless Matching" algorithm outlined in the Unicode specification [UNICODE]. This algorithm is detailed in section 3.13 entitled "Default Case Algorithms". Specifically, the algorithm must be applied without normalizing the strings involved and without applying any language-specific tailorings. The case folding method specified by this algorithm uses the case mappings with status field "C" or "F" in the CaseFolding.txt file of the Unicode Character Database.
注記: 作者にとっては、これは次を意味する: ~font族~名は、それらの名前が[ ~platform~fontの中に, または[ ~stylesheetに包含されている `font-face$at 規則 ]の中に ]存在するかどうかに応じて,文字大小無視の下で照合される。 作者は、特に,[ 発音区別符などの結合文字 ]を利用しているときは、[ 名前が,実際の~font族~名に整合する文字~連列になる ]ことが確保されるよう,注意を払うべきである。 例えば、[[ 小文字の "a" ( `0061^U ), `COMBINING RING ABOVE^cn ( `030A^U ) ]の並び ]を包含する族~名は,その結合文字~連列に代えて[ 合成済みの[ 小文字の ring 文字 ( `00E5^U, "å" ) ]]を利用する名前と,見かけ上は一致するが、合致しないことになる。 ◎ Note: For authors this means that font family names are matched case insensitively, whether those names exist in a platform font or in the @font-face rules contained in a stylesheet. Authors should take care to ensure that names use a character sequence consistent with the actual font family name, particularly when using combining characters such as diacritical marks. For example, a family name that contains a lowercase a (U+0061) followed by a combining ring (U+030A) will not match a name that looks identical but which uses the precomposed lowercase a-ring character (U+00E5) instead of the combining sequence.
注記: 実装者は、[ 所与の[ ~caseless文字列~比較の実装 ]が,この精確な~algoを利用しているかどうか ]を検証し,[ 所与の[ ~platformの文字列~照合~algo ]が,それに従っている ]ものと見做さないように、注意を払うべきである — これらの多くが、~locale特有な挙動を備えていたり, あるいは 何らかの~levelの文字列~正規化を利用しているので。 ◎ Note: Implementors should take care to verify that a given caseless string comparison implementation uses this precise algorithm and not assume that a given platform string matching routine follows it, as many of these have locale-specific behavior or use some level of string normalization.
5.2. ~font~styleの照合
~text連なりの中の所与の文字~用に,~fontを選ぶための手順は、次から構成される:
- `font-family$p ~propが与える名前たちが指す,一連の~font族の走査-法。
- [ 他の各種~font~prop ]に基づいて適切な~styleを伴うような,書体-の選定-法。
- 所与の文字~用の~glyphが存在するかどうかの決定-法。 これは、~fontの `文字map@ — すなわち,各~文字をその文字~用の既定の~glyphに対応付ける~data — を利用して行われる。
~fontは、次をいずれも満たすならば,所与の文字 %文字 を `~support@ するものと見なされる:
- %文字 は~fontの`文字map$に包含されている
- %文字 を包含している用字系から要求されている場合は,その文字~用の形状付け情報が【~fontにて】可用である。
旧来の~fontには、所与の文字を`文字map$の中に含みつつ,[ その文字を包含している~text連なり ]を正しく描画するために必要とされる,形状付け情報(例えば, ~OpenType~layout~table や Graphite tables )を欠いているものもある。 ◎ Some legacy fonts might include a given character in the character map but lack the shaping information (e.g. OpenType layout tables or Graphite tables) necessary for correctly rendering text runs containing that character.
[ 基底~文字, 結合文字~連列 ]並びを成す[ 符号位置~連列 ]の扱いは,少しばかり異なる — それについては,`~cluster照合$secにて見れる。 ◎ Codepoint sequences consisting of a base character followed by a sequence of combining characters are treated slightly differently, see the section on cluster matching below.
【以下,この節の内容は、未訳。】5.3. ~cluster照合
~textが結合符などの文字を包含するとき、理想的には,基底~文字と結合符は同じ~fontを利用して描画されるべきである。 これにより,結合符の適正な配置が確保される。 この理由から,~cluster用の~font照合~algoは、一般の,単独の文字~用の照合~algoよりも特化されている。 連列が[ 所与の文字に利用する精確な~glyph ]を指示する異体字~選択子 【`参考^_】 を包含している場合、~UAは — 基底~文字に既定の~glyphを利用する前に — 常に~system~font~fallbackを試みて,適切な~glyphを見出すことになる。 ◎ When text contains characters such as combining marks, ideally the base character should be rendered using the same font as the mark, this assures proper placement of the mark. For this reason, the font matching algorithm for clusters is more specialized than the general case of matching a single character by itself. For sequences containing variation selectors, which indicate the precise glyph to be used for a given character, user agents always attempt system font fallback to find the appropriate glyph before using the default glyph of the base character.
結合符や,他の `modifier^en【 Unicode Modifier Letter (修飾字)?】 を包含している符号位置~連列は、書記素~clusterと呼ばれる(より完全な記述は `CSS-TEXT-3$r, `UAX29$r を見よ)。 所与の並び[ 基底~文字 %基底~文字, 結合文字~連列 ]が成す %~cluster に対しては、次の手続きを利用して照合し~MUST: ◎ A sequence of codepoints containing combining mark or other modifiers is termed a grapheme cluster (see [CSS3TEXT] and [UAX29] for a more complete description). For a given cluster containing a base character, b and a sequence of combining characters c1, c2…, the entire cluster is matched using these steps:
-
~font~listを成す各~族に対し,順に: ◎ For each family in the font list,\
- 前~節に定義した~style選定~規則を利用して,【 %基底~文字 用に?】 1 個の書体を選ぶ ◎ a face is chosen using the style selection rules defined in the previous section.
- ~IF[ 【書体が属する?】~fontは %~cluster を成す すべての文字を完全に~supportしている ] ⇒# %~cluster 用には、その~fontを選定する 【~RET?】 ◎ If all characters in the sequence b + c1 + c2 … are completely supported by the font, select this font for the sequence.
- ~IF[[ 複数個の符号位置が成す連列【すなわち,%~cluster ?】 ]が単独の文字 %x に正準的に等価であって、~fontは %x を`~support$する ] ⇒# %~cluster 用には、その~fontを選定した上で, %x 用の~glyphを利用する; ~RET ◎ If a sequence of multiple codepoints is canonically equivalent to a single character and the font supports that character, select this font for the sequence and use the glyph associated with the canonically equiavlent character for the entire cluster.
-
~IF[ 前~段の~font~listの中から条件を満たす~fontは見出されなかった ]: ◎ If no font was found in the font list in step 1:
-
~IF[ %~cluster を成す 2 個目の符号位置は 異体字~選択子である `UNICODE$r ]:
-
%~cluster ~SET [ %基底~文字, その異体字~選択子 ]が成す並び(最初の 2 個の符号位置)
注記: %~cluster 内に 複数の異体字~選択子が在る場合、符号化法~errorとして扱った上で,残りの異体字~選択子は無視する。
-
~system~font~fallbackを利用した上で:
- ~IF[ ~system上のある~fontは, %~cluster を全部的に`~support$する ] ⇒ その~fontを選定する
- ~ELSE ⇒ 単独の文字の照合~用の通常の手順を利用して, %基底~文字 を合致させる — 異体字~選択子は無視する;
- ~RET
-
- ~UAの任意選択で ⇒ ~system~font~fallbackを利用して, %~cluster を`~support$する~fontに合致させる ◎ Otherwise, the user agent may optionally use system font fallback to match a font that supports the entire cluster.
-
- %残り ~LET 空~文字列 ◎ ↓
-
~WHILE 無条件:
- %~cluster から最後の符号位置を除去して,それを %残り に付加する
- ~Assert: %~cluster は空でない
- %~cluster に対し最初の段と同じ手続きを適用する ⇒ ~IF[ %~cluster 用に~fontが選定された ] ⇒# ~BREAK
- %残り を成す ~EACH( %結合文字 ) に対し ⇒ 単独の文字~用の規則を利用して、 %結合文字 に合致させることを試みる ◎ attempt to match the remaining combining characters separately using the rules for single characters.
5.4. 文字の取扱いの課題
~CSS~font照合は、常に,[ ~Unicode文字 `UNICODE$r を包含している~text連なり ]上で遂行されるので、旧来の符号化法を利用している文書は、~fontを照合する前に符号変換されているものと見做される。 ~Unicode用の他に,旧来の符号化法~用の`文字map$も包含している~fontに対しては、そのような`文字map$の内容が,~font照合~処理の結果に影響しては~MUST_NOT。 ◎ CSS font matching is always performed on text runs containing Unicode characters [UNICODE], so documents using legacy encodings are assumed to have been transcoded before matching fonts. For fonts containing character maps for both legacy encodings and Unicode, the contents of the legacy encoding character map must have no effect on the results of the font matching process.
~font照合~処理は、~text連なりが正規化形か否か,どちらにも見做さない(詳細は `CHARMOD-NORM$r に)。 ~fontは[ 基底~文字, 結合符たち ]が成す連列に分解された形を~supportせずに,合成済みの形のみを~supportしても~MAY。 作者は、内容の文字~streamが正規化形か否かも常に~~考慮に入れて,~fontの候補を誂えるべきである。 ◎ The font matching process does not assume that text runs are in either normalized or denormalized form (see [CHARMOD-NORM] for more details). Fonts may only support precomposed forms and not the decomposed sequence of base character plus combining marks. Authors should always tailor their choice of fonts to their content, including whether that content contains normalized or denormalized character streams.
所与の文字の符号位置が,~Unicode私用領域に属する場合、~UAは: ◎ If a given character is a Private-Use Area Unicode codepoint,\
- [ `font-family^p ~list内で名前が与えられた,汎用~族でない~font族 ]のみに合致させ~MUST。 ◎ user agents must only match font families named in the font-family list that are not generic families.\
- `font-family^p ~list内で名前が与えられたどの族も,その符号位置~用の~glyphを包含していない場合 ⇒ ~UAは、その符号位置~用に~system~font~fallbackを試みることなく,その文字~用に[ 何らかの形の欠落用~glyph記号 ]を表示し~MUST。 ◎ If none of the families named in the font-family list contain a glyph for that codepoint, user agents must display some form of missing glyph symbol for that character rather than attempting system font fallback for that codepoint.\
置換~文字 `FFFD^U に対する照合に際しては、~UAは,~font照合~処理を飛ばして[ 何らかの形の欠落用~glyph記号 ]を即時に表示しても~MAY。 それらについては、[ ~font照合~処理により選定されることになる~font ]からの~glyphを表示することは要求されない。 ◎ When matching the replacement character U+FFFD, user agents may skip the font matching process and immediately display some form of missing glyph symbol, they are not required to display the glyph from the font that would be selected by the font matching process.
一般に,所与のある族~用の~fontたちは、どれも,同じか類似する`文字map$を持つことになる。 ここに要旨する処理は、~font族が~~多様な`文字map$を伴う書体を包含しているときでも,取扱えるように設計されている。 しかしながら,そのような族の利用は、期待されない結果をもたらし得ることも,作者に忠告しておく。 ◎ In general, the fonts for a given family will all have the same or similar character maps. The process outlined here is designed to handle even font families containing faces with widely variant character maps. However, authors are cautioned that the use of such families can lead to unexpected results.
6. ~font特能~prop
現代の~font技術は、種々の[ 先進的~typographicや,言語~特有な~font特能 ]を~supportする。 これらの特能を利用して,単独の~fontが[ 多岐に渡る合字, 文脈依存の~stylistic代替, [ 一定幅/~old-style ]の数字f, 小頭字【“小さく” された大文字】, 自動的~分数, ~swash, 所与の言語~特有な代替 ]用の~glyphを供せる。 作者がこれらの~font能力を制御できるようにするため、 `font-variant$p ~propは拡張0された。 それは今や,[ ~fontの各種~stylistic特能に対する制御を供する各種~prop ]に対する略式~propとして機能する。 ◎ Modern font technologies support a variety of advanced typographic and language-specific font features. Using these features, a single font can provide glyphs for a wide range of ligatures, contextual and stylistic alternates, tabular and old-style figures, small capitals, automatic fractions, swashes, and alternates specific to a given language. To allow authors control over these font capabilities, the font-variant property has been expanded. It now functions as a shorthand for a set of properties that provide control over stylistic font features.
いくつかの下位節を~level 3 から — 勧告案になったなら — 取り込む。 ~font~test用に~link先として追加された~stubは、 ~level 4 に移動された ◎ Import these sections from level 3, once it goes to Proposed Rec; stubs added as link targets for font tests moved to Level 4
6.1. ~glyphの選定と位置決め
~INFORMATIVE~Latin~textの表示に利用される単純な~fontは、ごく基本的な処理~modelを利用する。 ~fontは、各~文字をその文字~用の~glyphに対応付ける,`文字map$を包含する。 後続の文字~用の~glyphは、単純に,~text連なりに沿って他の文字の後に置かれる。 ~OpenTypeや~AAT( Apple Advanced Typography )などの,現代の~font形式は、より多彩な処理~modelを利用する。 所与の文字~用の~glyphは、文字~自身の符号位置のみならず,[ 隣接の文字や[ 言語, 用字系, ~textに対し可能化された各種 特能 ]]に基づいて[ 選ばれ, 位置され ]得る。 ~font特能は、特定の用字系~用に要求されることもあれば,既定で可能化されるよう推奨されることもあれば,作者による制御~用として~~意図された ~stylistic特能のこともある。 全般的な~text処理~演算(~text変形, ~text方位, ~text整列など)において ~font選定, 位置決めがどこで起こるかについては、 各種~text演算の処理~順序 `CSS-TEXT-3$r にて述べられる。 ◎ Simple fonts used for displaying Latin text use a very basic processing model. Fonts contain a character map which maps each character to a glyph for that character. Glyphs for subsequent characters are simply placed one after the other along a run of text. Modern font formats such as OpenType and AAT (Apple Advanced Typography) use a richer processing model. The glyph for a given character can be chosen and positioned not just based on the codepoint of the character itself, but also on adjacent characters as well as the language, script, and features enabled for the text. Font features may be required for specific scripts, or recommended as enabled by default or they might be stylistic features meant to be used under author control. The point at which font selection and positioning happens in the overall order of text processing operations (such as text transformation, text orientation and text alignment) is described in CSS Text 3 § Text Processing Order of Operations.
これらの特能の有益な視覚的~概観は `OPENTYPE-FONT-GUIDE$r にて見れる。 ~OpenType~font用の~glyph処理の詳細な記述は、 `WINDOWS-GLYPH-PROC$r にて見れる。 ◎ For a good visual overview of these features, see the [OPENTYPE-FONT-GUIDE]. For a detailed description of glyph processing for OpenType fonts, see [WINDOWS-GLYPH-PROC].
~fontの~stylistic特能は、大きく 2 つに分類できる: 一つは[ ~kerning, 合字 ]特能などの[ ~glyphの形状と, 周囲の文脈との調和 ]に影響するもの、もう一つは[ ~small-caps, 下上付, 代替 ]特能などの,形状の選定に影響するものである。 ◎ Stylistic font features can be classified into two broad categories: ones that affect the harmonization of glyph shapes with the surrounding context, such as kerning and ligature features, and ones such as the small-caps, subscript/superscript and alternate features that affect shape selection.
下に挙げられる[ `font-variant$p の下位prop ]が、これらの[ ~fontの~stylistic特能 ]を制御するために利用される。 それらは、 ~Arabicや~Indicの言語~textを表示する際に利用される 各種~OpenType特能など,ある種の用字系の表示に要求される特能は制御しない。 それらは、~glyphの[ 選定と位置決め ]に影響するが,`~font照合~algo$secに述べた~font選定には影響しない(ただし, CSS 2.1 との互換性を得るために要求される場合は除く)。 ◎ The subproperties of font-variant listed below are used to control these stylistic font features. They do not control features that are required for displaying certain scripts, such as the OpenType features used when displaying Arabic or Indic language text. They affect glyph selection and positioning, but do not affect font selection as described in the font matching section (except in cases required for compatibility with CSS 2.1).
~UA間に渡る挙動の一貫性を確約するため、個々の~propに対し,等価な[ ~OpenType~prop設定群 ]が挙げられ,規範的とされる。 他の~font形式の利用に際しては、これらは,各種[ ~CSS~font特能~prop値 ]を特定の~font特能へ対応付けるための指針として、利用されるべきである。 ◎ To assure consistent behavior across user agents, the equivalent OpenType property settings are listed for individual properties and are normative. When using other font formats these should be used as a guideline to map CSS font feature property values to specific font features.
6.2. 言語~特有な表示
~OpenTypeは、[ 言語が規定する,特定の[ 表示の挙動 ]]に従って,~textを正しく表示できるようにするために、言語~特有な,~glyphの[ 選定と位置決め ]も~supportする。 多くの言語が同じ用字系を共有するが、ある種の普通字の形状は,言語ごとに変わり得る。 例えば,ある種の~Cyrillic普通字の形状は、~Russian~textと~Bulgarian~textとでは互いに異なる。 ~Latin~textにおいては、 "fi" は[ 小文字 "i" の上の~dotを欠く明示的な fi-合字 ]で共通的に描画される。 しかしながら、 ~dot付き "i" と~dotなし "i" の両者を利用する~Turkishなどの言語においては、 この合字を利用しないか, あるいは[ "i" の上に~dotを包含する,特化された~versionの合字 ]を利用することが重要になる。 下の例に[ ~Spanish, ~Italian, ~French ]の正書法にて見出される,[ ~stylistic伝統様式に基づく,言語~特有な異体 ]を示す: ◎ OpenType also supports language-specific glyph selection and positioning, so that text can be displayed correctly in cases where the language dictates a specific display behavior. Many languages share a common script, but the shape of certain letters can vary across those languages. For example, certain Cyrillic letters have different shapes in Russian text than in Bulgarian. In Latin text, it’s common to render "fi" with an explicit fi-ligature that lacks a dot on the "i". However, in languages such as Turkish which uses both a dotted-i and a dotless-i, it’s important to not use this ligature or use a specialized version that contains a dot over the "i". The example below shows language-specific variations based on stylistic traditions found in Spanish, Italian and French orthography:
要素の内容~言語が`文書~言語$の規則に則って既知である場合、~UAには,内容~言語から~OpenType言語~systemを推定した上で、 ~OpenType~fontを利用する~glyphの[ 選定-法と位置決め ]に,その言語~systemを利用することが要求される。 ◎ If the content language of the element is known according to the rules of the document language, user agents are required to infer the OpenType language system from the content language and use that when selecting and positioning glyphs using an OpenType font.
~OpenType~fontに対しては、利用する~OpenType言語の明示的な宣言が必要とされる場合がある — 例えば,[ 別の言語の~typographic規約を利用する~textを,所与の言語で表示させる ]ときや、[ ~fontが所与の言語を明示的に~supportしていないが,同じ~typographic規約を共有する言語は~supportする ]ときなど。 `font-language-override$p ~propが,この目的に利用される。 ◎ For OpenType fonts, in some cases it may be necessary to explicitly declare the OpenType language to be used, for example when displaying text in a given language that uses the typographic conventions of another language or when the font does not explicitly support a given language but supports a language that shares common typographic conventions. The font-language-override property is used for this purpose.
6.3. ~kerning: `font-kerning^p ~prop
【未策定:~level 3 の対応する節 を見よ。】6.4. 合字: `font-variant-ligatures^p ~prop
【未策定:~level 3 の対応する節 を見よ。】6.5. 下上付~形: `font-variant-position^p ~prop
【未策定:~level 3 の対応する節 を見よ。】6.6. 頭字化: `font-variant-caps^p ~prop
【未策定:~level 3 の対応する節 を見よ。】6.7. 数量的な整形: `font-variant-numeric^p ~prop
【未策定:~level 3 の対応する節 を見よ。】6.8. 代替と~swash: `font-variant-alternates^p ~prop
◎名 `font-variant-alternates@p ◎値 normal | [ stylistic(`feature-value-name$t) || historical-forms || styleset(`feature-value-name$t#) || character-variant(`feature-value-name$t#) || swash(`feature-value-name$t) || ornaments(`feature-value-name$t) || annotation(`feature-value-name$t) ] ◎初 `normal$v1 ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎ア 不可 ◎表終`feature-value-name@t = `ident$t
~fontは、所与のどの文字に対しても,その文字~用の既定の~glyphに加えて,種々の代替~glyphを供し得る。 この~propは、これらの代替~glyphの選定に対する制御を供する。 ◎ For any given character, fonts can provide a variety of alternate glyphs in addition to the default glyph for that character. This property provides control over the selection of these alternate glyphs.
下に挙げる~prop値の多くに対し,いくつかの異なる代替~glyphが可用になる。 可用な代替の[ 個数, それぞれが表現するもの ]は,~font特有~なので、これらはそれぞれ,下の各種 ~値~定義の中で `~font特有@ と記される。 これらの代替は,その資質から~font特有~なので、【作者は】特定の[ ~font族またはその集合 ]用に, `font-feature-values$at 規則を利用して[ ~font特有な数量的な`特能~index$と ~custom`特能~値~名$との結び付け ]をいくつか定義した上で、それらの~custom名を,この~propにおける特定の代替を選定するために利用する: ◎ For many of the property values listed below, several different alternate glyphs are available. How many alternates are available and what they represent is font-specific, so these are each marked font specific in the value definitions below. Because the nature of these alternates is font-specific, the @font-feature-values rule is used to define values for a specific font family or set of families that associate a font-specific numeric <feature-index> with a custom <feature-value-name>, which is then used in this property to select specific alternates:
@font-feature-values Noble Script { @swash { swishy: 1; flowing: 2; } }
p {
font-family: Noble Script;
font-variant-alternates: swash(flowing); /*
~swashの 2 番目の代替を利用
◎
use swash alternate #2
*/
}
特定0の`特能~値~名$が[ 所与の族, あるいは 特定0の特能~型 ]用に定義されていないときの, `font-variant-alternates$p の算出値は、それが定義されていたとするときの算出値と同じになら~MUST。 しかしながら,~UAは、~glyphを選ぶ際には,そのような未定義の`特能~値~名$を包含する~prop値を無視し~MUST。 ◎ When a particular <feature-value-name> has not been defined for a given family or for a particular feature type, the computed value must be the same as if it had been defined. However, property values that contain these undefined <feature-value-name> identifiers must be ignored when choosing glyphs.
/* 次の 2 つの~style規則は、実質的に同じ: ◎ these two style rules are effectively the same */ p { font-variant-alternates: swash(unknown-value); } /* 定義された値でないので,無視される ◎ not a defined value, ignored */ p { font-variant-alternates: normal; }
これにより、値は,所与の~font族の集合~用には定義されて利用される一方、~fallbackが生じたときには,~font族~名が異なるので無視されるようになる。 所与の値が,所与の~fontから~supportされる範囲に入らない場合、その値は無視される。 これらの値は、汎用~font族には決して適用されない。 ◎ This allows values to be defined and used for a given set of font families but ignored if fallback occurs, since the font family name would be different. If a given value is outside the range supported by a given font, the value is ignored. These values never apply to generic font families.
各種~値の意味は,次で与えられる: ◎ Individual values have the following meanings:
- `normal@v1
- 下に挙げられるどの特能も,可能化されない。 ◎ None of the features listed below are enabled.
- `historical-forms@v
- 歴史的~形( ~OpenType特能: `hist^tag )による表示を可能化する。 ◎ Enables display of historical forms (OpenType feature: hist).
- `hist^png
- `stylistic@v(`feature-value-name$t)
- ~stylistic代替( `~font特有$, ~OpenType特能: `salt^tag `feature-index$t )による表示を可能化する。 ◎ Enables display of stylistic alternates (font specific, OpenType feature: salt <feature-index>).
- `salt^png
- `styleset@v(`feature-value-name$t#)
- ~stylistic~~設定( “`stylistic sets^en” )( `~font特有$, ~OpenType特能: `ss^tag `feature-index$t )による表示を可能化する( ~OpenTypeは 現在 `ss01^tag から `ss20^tag までを定義している)。 ◎ Enables display with stylistic sets (font specific, OpenType feature: ss<feature-index> OpenType currently defines ss01 through ss20).
- `ssnn^png
- `character-variant@v(`feature-value-name$t#)
- 特定の異体文字( `~font特有$, ~OpenType特能: `cv^tag `feature-index$t )による表示を可能化する( ~OpenTypeは 現在 `cv01^tag から `cv99^tag までを定義している)。 ◎ Enables display of specific character variants (font specific, OpenType feature: cv<feature-index> OpenType currently defines cv01 through cv99).
- `swash@v(`feature-value-name$t)
- ~swash~glyph( `~font特有$, ~OpenType特能: `swsh^tag `feature-index$t, `cswh^tag `feature-index$t )による表示を可能化する。 ◎ Enables display of swash glyphs (font specific, OpenType feature: swsh <feature-index>, cswh <feature-index>).
- `swsh^png
- `ornaments@v(`feature-value-name$t)
- ~fontにて供されているならば、既定の~glyphに対する,装飾体による置換を可能化する( `~font特有$, ~OpenType特能: `ornm^tag `feature-index$t )。 ~fontには、広範の文字~用に,代替として装飾体~glyphを提供するものもある。 しかしながら、恣意的な範囲の文字(例えば,英数字)を装飾体として表示させることは、~dataの意味論を歪めるので,拙い実践である。 ~font~designerには、作者が `ornaments()^v を利用して 欲する~glyphを選定できるように,すべての装飾体(~Unicode~Dingbats~block【 `2700^U 〜 `27BF^U 】の中で明示的に符号化されたもの, 等々を除く)を[ ~bullet文字 ( `2022^U )用の代替 ]として符号化しておくことが奨励される。 ◎ Enables replacement of default glyphs with ornaments, if provided in the font (font specific, OpenType feature: ornm <feature-index>). Some fonts may offer ornament glyphs as alternates for a wide collection of characters; however, displaying arbitrary characters (e.g., alphanumerics) as ornaments is poor practice as it distorts the semantics of the data. Font designers are encouraged to encode all ornaments (except those explicitly encoded in the Unicode Dingbats blocks, etc.) as alternates for the bullet character (U+2022) to allow authors to select the desired glyph using ornaments().
- `ornm^png
- `annotation@v(`feature-value-name$t)
- 代替~annotation形( `~font特有$, ~OpenType特能: `nalt^tag `feature-index$t )による表示を可能化する。 ◎ Enables display of alternate annotation forms (font specific, OpenType feature: nalt <feature-index>).
- `nalt^png
6.9. ~font特有な代替の定義-法: `font-feature-values^at 規則
上に挙げられた[ `font-variant-alternates$p にアリな値 ]のいくつかは、`~font特有$とされている。 ~fontは、これらの特能~用に,単独の~glyphのみならず[ 代替~glyphの集合 ]を — それぞれの代替を選定するための~indexも伴わせて — 定義することもある。 これらは,~font族~特有~なので、所与の族~用に,これらの~indexを命名する値 — `特能~値~名$ — を定義するために、 【すなわち、利用する代替~glyphを,~indexではなく,名前を通して選定できるようにするために、】 `font-feature-values@at 規則が利用される。 ◎ Several of the possible values of font-variant-alternates listed above are labeled as font specific. For these features fonts may define not just a single glyph but a set of alternate glyphs with an index to select a given alternate. Since these are font family specific, the @font-feature-values rule is used to define named values for these indices for a given family.
前~節に示された `swash$v "Q" の事例では、 ~swashは,次の~style規則を利用して指定できる: ◎ In the case of the swash Q in the example shown above, the swash could be specified using these style rules:
@font-feature-values Jupiter Sans {
@swash {
delicate: 1;
flowing: 2;
}
}
h2 { font-family: Jupiter Sans, sans-serif; }
/*
h2 ~headingの中では, 2 番目の(~index 2 の)~swash異体字が示されるようにする
◎
show the second swash variant in h2 headings
*/
h2:first-letter { font-variant-alternates: swash(`flowing^v); }
<h2>Quick</h2>
`Jupiter_Sans^F が在るときは, 2 番目の~swash代替が表示され、無いときは,どの~swash文字も示されないことになる — `特能~値~名$ "`flowing^v" は、 `Jupiter_Sans^F 族~用に限り,特に定義されているので。 "@" ~markは,`特能~値~名$を引数にとる~prop値の名前を指示し、 "`flowing^css" が,作者から選ばれる名前である。 各~代替を表現する~indexは、当の~fontの~data内にて定義される。 ◎ When Jupiter Sans is present, the second alternate swash alternate will be displayed. When not present, no swash character will be shown, since the specific named value "flowing" is only defined for the Jupiter Sans family. The @-mark indicates the name of the property value for which a named value can be used. The name "flowing" is chosen by the author. The index that represents each alternate is defined within a given font’s data.
6.9.1. 基本的な構文
`font-feature-values$at 規則は、`~font族~名~list$と後続する~blockで構成される。 ~blockは,何個かの[ ~at-規則の形をとる,`特能~値~block$ ]からなる。 ◎ An @font-feature-values rule is composed of a list of font families followed by a block containing individual feature value blocks that take the form of @-rules.\
各 `特能~値~block@ は、一連の`特能~値の定義$ — `~font族~名~list$に与えられた~font族たちを利用する下での,特定の~font特能~用の一連の`特能~値~名$ — からなる集合を定義する。 この集合は、実質的に, ( 族~名, `特能~種別$, `特能~値~名$ ) が成す組から`特能~index$ — [ 所与の~font用に定義される特定の特能 ]に利用されている,一連の数量~index — への対応付けを定義する†。 ◎ Each block defines a set of named values for a specific font feature when a given set of font families is used. Effectively, they define a mapping of ⟨family, feature, ident⟩ → ⟨values⟩ where ⟨values⟩ are the numeric indices used for specific features defined for a given font.
【† 上位節の冒頭の例では、 `font-feature-values^at における ( 族~名 `Jupiter Sans^v, 特能~種別 `swash^v, 特能~値~名 `delicate^v ) が成す組は,値 `delicate^v へ対応付けられる(特能~値~名 `flowing^v についても同様に対応付けられる)。 】
@font-feature-values = @font-feature-values `family-name$t# { `rule-list$t } `family-name$t 【族~名】 = `string$t | `custom-ident$t+ `feature-value-block$t 【 `rule-list^t を成す各 `特能~値~block$ 】 = `feature-type$t { `declaration-list$t } `feature-type$t 【 `特能~種別$ 】 = @stylistic | @historical-forms | @styleset | @character-variant | @swash | @ornaments | @annotation `feature-value^t 【 `特能~index$ 】 = `integer$t+
各 `特能~値~block$は、~at-規則として取扱われ,[ 次にある[ ~blockまたは~semi-colon ]のうち,最初に来る方 ]までのすべてからなる。 ◎ Feature value blocks are handled as at-rules, they consist of everything up to the next block or semi-colon, whichever comes first.
`~font族~名~list@ は、一連の~font族~名( `family-name^t )からなる,~comma区切りの~listである — その各~font族~名は[ `font-family$p ~prop用の `family-name$t の定義 ]に合致するような。 これは、有名~font族のみが許容されることを意味する — ~listの中に[ 汎用~族~名や~system~font~名 ]を含む規則は,構文~errorとする。 しかしながら,~UAが汎用~fontを[ 特定の有名~font(例: `Helvetica^F ) ]であるものと定義する場合、その族~名に結付けられている設定群が,利用されることになる。 `~font族~名~list$内に構文~errorがある場合、当の規則~全体が無視され~MUST。 ◎ The font family list is a comma-delimited list of font family names that match the definition of <family-name> for the font-family property. This means that only named font families are allowed, rules that include generic or system fonts in the list of font families are syntax errors. However, if a user agent defines a generic font to be a specific named font (e.g. Helvetica), the settings associated with that family name will be used. If syntax errors occur within the font family list, the entire rule must be ignored.
`特能~値~block$内の
`特能~種別@
( `feature-type^t )は、先頭の文字 @
と後続する[
`font-variant-alternates$p の[
`~font特有な$各種~prop値
]を成すいずれかの名前(例: `swash$v )
]で与えられる。
◎
Within feature value blocks, the feature type is '@' followed by the name of one of the font specific property values of font-variant-alternates (e.g. @swash).\
`特能~値~block$内の `特能~値の定義@ の中で利用される識別子( `feature-value-name$t )は、 `特能~値~名@ を定義する: ◎ \
- この識別子は、~CSS利用者~識別子の規則に従う。 また、文字大小は区別される。 ◎ The identifiers used within feature value definitions follow the rules of CSS user identifiers and are case-sensitive.\
- 識別子が一意になるのは、所与の[ ~font族, `特能~種別$ ]の組~内に限られ、同じ識別子は,`特能~種別$ごとに別個の値として扱われる。 ◎ They are unique only for a given set of font families and feature type. The same identifier used with a different feature type is treated as a separate and distinct value.\
- 所与の[ ~font族, `特能~種別$ ]の組~用に,同じ識別子が複数回 定義されている場合、それらのうち最後の値が利用される。 ◎ If the same identifier is defined multiple times for a given feature type and font family, the last defined value is used.\
各 `特能~値~名$に結付けられる 1 〜 2 個の整数( `integer^t )は、いずれも 0 以上に制限され,それらの組として `特能~index@ ( `feature-index^t )を与える。 ◎ Values associated with a given identifier are limited to integer values 0 or greater.
妥当でない[ 識別子や値 ]など,`特能~値の定義$ 内に構文~errorがあるときは、~style宣言における構文~errorの取扱いと同様に,`特能~値の定義$ 全体が~~除外され~MUST。 `特能~種別$が妥当でないときは、当の`特能~値~block$全体が無視され~MUST。 ◎ When syntax errors occur within a feature value definition, such as invalid identifiers or values, the entire feature value definition must be omitted, just as syntax errors in style declarations are handled. When the feature type is invalid, the entire associated feature value block must be ignored.
構文~errorが含まれている規則: ◎ Rules that are equivalent given syntax error handling:
@font-feature-values Bongo {
@swash { ornate: 1; }
annotation { boxed: 4; } /*
@annotation
とされるべき
◎
should be @annotation!
*/
@swash { double-loops: 1; flowing: -1; } /*
値が負
◎
negative value
*/
@ornaments ; /*
不完全な定義
◎
incomplete definition
*/
@styleset { double-W: 14; sharp-terminals: 16 1 } /*
~semi-colon( `;^l )が抜けている
◎
missing ;
*/
redrum /*
でたらめな編集上の誤り
◎
random editing mistake
*/
}
上の例は次と等価になる: ◎ The example above is equivalent to:
@font-feature-values Bongo { @swash { ornate: 1; } @swash { double-loops: 1; } @styleset { double-W: 14; sharp-terminals: 16 1; } }
所与の族~用に,複数の `font-feature-values$at 規則が定義されている場合、結果の[ 値~定義 ]は、これらの規則に包含されている一連の定義の和集合になる。 これにより、[ 所与の~font族~用の`特能~値~名$の集合 ]を,[ ~site用の大域的なもの ]と[ 頁~別の特定の追加 ]に分けて定義できるようになる。 ◎ If multiple @font-feature-values rules are defined for a given family, the resulting values definitions are the union of the definitions contained within these rules. This allows a set of named values to be defined for a given font family globally for a site and specific additions made per-page.
~site全体, および 頁ごと,における特能~値の利用: ◎ Using both site-wide and per-page feature values:
site.css: @font-feature-values Mercury Serif { @styleset { stacked-g: 3; /* "g", "a" の“二階建て” ~version ◎ "two-storey" versions of g, a */ stacked-a: 4; } } page.css: @font-feature-values Mercury Serif { @styleset { geometric-m: 7; /* "m" の代替~version ◎ alternate version of m */ } } body { font-family: Mercury Serif, serif; /* stacked "g" と代替 "m" の両者の利用を可能化する: ◎ enable both the use of stacked g and alternate m */ font-variant-alternates: styleset(stacked-g, geometric-m); }
各~fontに共通の`特能~値~名$を利用することにより、作者は,~fontごとに下層の異体字~選択子が異なるときでも,それを単独の~style規則に受持たすことが~~可能になる。 下の例における いずれかの~fontが見出されたなら、丸付き数字~glyphが利用されることになる: ◎ Using a commonly named value allows authors to use a single style rule to cover a set of fonts for which the underlying selector is different for each font. If either font in the example below is found, a circled number glyph will be used:
@font-feature-values Taisho Gothic {
@annotation { boxed: 1; circled: 4; }
}
@font-feature-values Otaru Kisa {
@annotation { circled: 1; black-boxed: 3; }
}
h3.title {
/*
両~font用に定義される丸付き形
◎
circled form defined for both fonts
*/
font-family: Taisho Gothic, Otaru Kisa;
font-variant: annotation(circled);
}
6.9.2. 複数個の値をとれる特能~値の定義
`font-variant-alternates$p ~propがとり得る`~font特有な$ 関数形の値のほとんどは, 1 個の引数をとるが(例えば, `swash$v )、~prop値 `character-variant$v は 2 個の引数をとれ, `styleset$v は 何個でも引数をとれる。 ◎ Most font specific functional values of the font-variant-alternates property take a single value (e.g. swash()). The character-variant() property value allows two values and styleset() allows an unlimited number.
~prop値 `styleset^f に対する複数個の値は、可能化される一連の[ ~style集合 ]を指示する。 1 から 99 までの値は,[ `ss01^tag から `ss99^tag まで ]の ~OpenType特能を可能化する。 ただし,~OpenType標準が公用に定義するのは[ `ss01^tag から `ss20^tag まで ]である。 ~OpenType~fontに対しては、値が[ 0 である, または 99 より大きい ]場合でも,構文解析-時に構文~errorは生成されないが、いかなる ~OpenType特能も可能化されない。 ◎ For the styleset property value, multiple values indicate the style sets to be enabled. Values between 1 and 99 enable OpenType features ss01 through ss99. However, the OpenType standard only officially defines ss01 through ss20. For OpenType fonts, values greater than 99 or equal to 0 do not generate a syntax error when parsed but enable no OpenType features.
@font-feature-values Mars Serif { @styleset { alt-g: 1; /* `ss01^tag = 1 を含意する ◎ implies ss01 = 1 */ curly-quotes: 3; /* `ss03^tag = 1 を含意する ◎ implies ss03 = 1 */ code: 4 5; /* `ss04^tag = 1, `ss05^tag = 1 を含意する ◎ implies ss04 = 1, ss05 = 1 */ } @styleset { dumb: 125; /* 99 を超えるので無視される ◎ >99, ignored */ } @swash { swishy: 3 5; /* ~swashに対する複数個の値は、構文~error ◎ more than 1 value for swash, syntax error */ } } p.codeblock { /* `ss03^tag = 1, `ss04^tag = 1, `ss05^tag = 1 を含意する ◎ implies ss03 = 1, ss04 = 1, ss05 = 1 */ font-variant-alternates: styleset(curly-quotes, code); }
`character-variant$v に対する[ 1 から 99 まで ]の単独の値は、対応する[ `cv01^tag から `cv99^tag まで ]の ~OpenType特能を可能化するよう指示する。 ~OpenType~fontに対しては、[ 0 である, または 99 より大きい ]値は無視され,構文解析-時に構文~errorは生成されないが、いかなる~OpenType特能も可能化されない。 2 個の値が与えられたときは、 1 個目の値が利用される特能を指示し, 2 個目のものが その特能に渡される値になる。 所与の名前に対し 3 個~以上の値があてがわれた場合、構文~errorが生じ,`特能~値の定義$ 全体が無視される。 ◎ For character-variant, a single value between 1 and 99 indicates the enabling of OpenType feature cv01 through cv99. For OpenType fonts, values greater than 99 or equal to 0 are ignored but do not generate a syntax error when parsed but enable no OpenType features. When two values are listed, the first value indicates the feature used and the second the value passed for that feature. If more than two values are assigned to a given name, a syntax error occurs and the entire feature value definition is ignored.
@font-feature-values MM Greek { @character-variant { alpha-2: 1 2; } /* `cv01^tag = 2 を含意する ◎ implies cv01 = 2 */ @character-variant { beta-3 : 2 3; } /* `cv02^tag = 3 を含意する ◎ implies cv02 = 3 */ @character-variant { epsilon: 5 3 6; } /* 3 個の値, 構文~error, 定義は無視される ◎ more than 2 values, syntax error, definition ignored */ @character-variant { gamma : 12; } /* `cv12^tag = 1 を含意する ◎ implies cv12 = 1 */ @character-variant { zeta : 20 3; } /* `cv20^tag = 3 を含意する ◎ implies cv20 = 3 */ @character-variant { zeta-2 : 20 2; } /* `cv20^tag = 2 を含意する ◎ implies cv20 = 2 */ @character-variant { silly : 105; } /* 99 を超えるので無視される ◎ >99, ignored */ @character-variant { dumb : 323 3; } /* 99 を超えるので無視される ◎ >99, ignored */ } #title { /* 3 番目の代替 beta, 1 番目の代替 gamma を利用 ◎ use the third alternate beta, first alternate gamma */ font-variant-alternates: character-variant(beta-3, gamma); } p { /* zeta-2, zeta の並び, `cv20^tag = 2 を含意する ◎ zeta-2 follows zeta, implies cv20 = 2 */ font-variant-alternates: character-variant(zeta, zeta-2); } .special { /* zeta, zeta-2 の並び `cv20^tag = 3 を含意する ◎ zeta follows zeta-2, implies cv20 = 3 */ font-variant-alternates: character-variant(zeta-2, zeta); }
上の図の赤色の~textは,[[[[ A.D 8 世紀の Byzantine seal ]上に見出される文字~形 ]を模倣する異体文字 ]を包含している~font ]を利用して描画されたものである。 その下の黒色の 2 行は、同じ~textを異体字を伴わない~fontで表示したものである。 seal 上では, "U" と "N" 用に 2 個の異体字が利用されていることに注意。 ◎ In the figure above, the text in red is rendered using a font containing character variants that mimic the character forms found on a Byzantine seal from the 8th century A.D. Two lines below is the same text displayed in a font without variants. Note the two variants for U and N used on the seal.
@font-feature-values Athena Ruby { @character-variant { leo-B: 2 1; leo-M: 13 3; leo-alt-N: 14 1; leo-N: 14 2; leo-T: 20 1; leo-U: 21 2; leo-alt-U: 21 4; } } p { font-variant: discretionary-ligatures character-variant(leo-B, leo-M, leo-N, leo-T, leo-U); } span.alt-N { font-variant-alternates: character-variant(leo-alt-N); } span.alt-U { font-variant-alternates: character-variant(leo-alt-U); } <p>ENO....UP͞RSTU<span class="alt-U">U</span>͞<span class="alt-U">U</span>ΚΑΙTỤẠG̣IUPNS</p> <p>LEON|ΚΑΙCONSTA|NTI<span class="alt-N">N</span>OS..|STOIBAṢ.|LIṢROM|AIO<span class="alt-N">N</span></p>
6.10. ~East-Asian~textの描画: `font-variant-east-asian^p ~prop
【未策定:~level 3 の対応する節 を見よ。】6.11. ~font描画~用の全般的な略式: `font-variant^p ~prop
【未策定:~level 3 の対応する節 を見よ。】6.12. 低次の~font特能~設定群の制御: `font-feature-settings^p ~prop
【未策定:~level 3 の対応する節 を見よ。】6.13. ~font言語の上書き: `font-language-override^p ~prop
◎名 `font-language-override@p ◎値 `normal$v1 | `string$vt ◎初 `normal$v1 ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎ア 不可 ◎表終`言語~特有な表示$secで述べたように、作者は,通常は[ 要素の内容~言語 ]の設定を通して,[ 言語~特有な[ ~glyph代用と位置決め ]]の利用を制御できる: ◎ Normally, authors can control the use of language-specific glyph substitutions and positioning by setting the content language of an element, as described above:
<!--
S’gaw Karen 【カレン諸語の一つ,スゴウ=ブゲ諸語】に固有の特能を利用して~textを表示する
◎
Display text using S’gaw Karen specific features -->
<p lang="ksw">...</p>
一部の事例では、作者は,内容~言語と異なる言語~systemを指定する必要が生じ得る — 例えば,別の言語の~typographic伝統様式を模倣するために。 `font-language-override$p ~propは、作者が[ 内容~言語により黙示される言語~system ]を上書きして,~fontの言語~systemを明示的に指定できるようにする。 ◎ In some cases, authors may need to specify a language system that differs from the content language, for example due to the need to mimic another language’s typographic traditions. The font-language-override property allows authors to explicitly specify the language system of the font, overriding the language system implied by the content language.
各種~値の意味は,以下に与えられる: ◎ Values have the following meanings:
- `normal@v1
- ~OpenType~fontによる描画の際の,~OpenType言語~systemの推定-に、要素の内容~言語を利用するものと指定する。 ◎ specifies that when rendering with OpenType fonts, the content language of the element is used to infer the OpenType language system
- `string$t
- 1 個の[ 文字大小が区別され, 3 字で記される[ ~OpenType 言語~system~tag ]]であって、[ 要素の言語により黙示される言語~system ]の代わりに利用する,~OpenType言語~systemを指定する。 ◎ single three-letter case-sensitive OpenType language system tag, specifies the OpenType language system to be used instead of the language system implied by the language of the element
未知の~OpenType言語~system~tagは、黙って無視され、~glyphの[ 選定と配置 ]には影響しない。 ◎ Unknown OpenType language system tags are silently ignored, and do not affect glyph selection and placement.
世界人権宣言 は、様々な言語に翻訳されている。 ~Turkishでは、この文書の第 9 条は,次の様に~markupされるであろう: ◎ The Universal Declaration of Human Rights has been translated into a wide variety of languages. In Turkish, Article 9 of this document might be marked up as below:
<body lang="tr">
<h4>Madde 9</h4>
<p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.</p>
ここでは、~UAは,~textの描画-時に `lang^a 属性の値を利用し, “fi” 合字なしに,この~textを適切に描画する。 `font-language-override$p ~propを利用する必要はない。 ◎ Here the user agent uses the value of the lang attribute when rendering text and appropriately renders this text without fi ligatures. There is no need to use the font-language-override property.
しかしながら、所与の~fontが,特定の言語~用の~supportを欠いていることもある。 この状況~下では、作者は,[ その~fontから~supportされている言語 ]に関係する~typographic規約を利用する必要があり得る。 ◎ However, a given font may lack support for a specific language. In this situation authors may need to use the typographic conventions of a related language that are supported by that font:
<body lang="mk"> <!-- ~Macedonianの言語( `lang^en )~code ◎ Macedonian lang code --> body { font-language-override: "SRB"; /* ~Serbian~OpenType言語~tag ◎ Serbian OpenType language tag */ } <h4>Члeн 9</h4> <p>Никoj чoвeк нeмa дa бидe пoдлoжeн нa прoизвoлнo aпсeњe, притвoр или прoгoнувaњe.</p>
内容~作者は,指定された~fontが~Serbianを~supportすることを知っており、ここでの~Macedonian~textは,~Serbian~typographic規約を利用して描画されることになる。 ◎ As the content creator knows that font specified supports Serbian, the Macedonian text here will be rendered using Serbian typographic conventions.
7. ~font特能と異体の解決
前~節にて述べた様に、~fontの特能と異体は,[ ~style規則の中, あるいは`font-face$at 規則~内 ]における[ `font-variant$p / `font-feature-settings$p / `font-variation-settings$p ]の利用を介して,種々の仕方で可能化され得る。 これらの設定の和集合に対する解決の順序は、以下に定義される。 ~CSS~propを介して定義される各種~特能は、~layout~engineの既定の特能の上層で適用される。 ◎ As described in the previous section, font features and variations can be enabled in a variety of ways, either via the use of font-variant, font-feature-settings, fontfont-variation-settings in a style rule or within an @font-face rule. The resolution order for the union of these settings is defined below. Features defined via CSS properties are applied on top of layout engine default features.
7.1. 既定の特能
~OpenType~fontに対しては、~UAは,[ ~OpenType の文献にて,[ 所与の[ 用字系, および書字mode ]]に対し定義されている既定の特能 ]を可能化し~MUST。 要求される[ 合字, 共通合字, 文脈依存の形( ~OpenType特能: `rlig^tag, `liga^tag, `clig^tag, `calt^tag )]は、[ 地域化された形( ~OpenType特能: `locl^tag )], および[[ 組にされた[ 文字や~mark( ~OpenType特能: `ccmp^tag, `mark^tag, `mkmk^tag )]の適正な表示 ]のために要求される特能 ]に沿うように,既定で可能化され~MUST。 これらの特能は、[ `font-variant$p, `font-feature-settings$p ]~propの値が `normal^v のときでも,常に可能化され~MUST。 個々の特能は、[ `font-variant-ligatures$p が `no-common-ligatures$v に設定されたとき ]など,作者から明示的に上書きされているときにのみ,不能化される。 ◎ For OpenType fonts, user agents must enable the default features defined in the OpenType documentation for a given script and writing mode. Required ligatures, common ligatures and contextual forms must be enabled by default (OpenType features: rlig, liga, clig, calt), along with localized forms (OpenType feature: locl), and features required for proper display of composed characters and marks (OpenType features: ccmp, mark, mkmk). These features must always be enabled, even when the value of the font-variant and font-feature-settings properties is normal. Individual features are only disabled when explicitly overridden by the author, as when font-variant-ligatures is set to no-common-ligatures.
[ Arabic, Mongolian, Devanagari ]などの複層的な用字系を取扱うためには、追加の特能が要求される。 縦書きの~text連なり内の正立~text用には、縦書きの代替( ~OpenType特能: `vert^tag )が可能化され~MUST。 【 正立( `upright^en ) — 例えば括弧類は横書きのものと異ならせる必要がある。】 ◎ For handling complex scripts such as Arabic, Mongolian or Devanagari additional features are required. For upright text within vertical text runs, vertical alternates (OpenType feature: vert) must be enabled.
7.2. 特能と異体の優先順位
[ 一般の/`~font特有な$ ]~font特能~prop設定群は、下に与える順序で解決される — 後のもの程、優先順位は高くなる。 この順序付けは、所与の~text連なりに影響するような[ 一連の~font特能からなる,一つに組合された~list ]を構築するために利用される。 ◎ General and font specific font feature property settings are resolved in the order below, in ascending order of precedence. This ordering is used to construct a combined list of font features that affect a given text run.
- 既定で可能化される~font特能は、所与の用字系に要求される特能も含め,適用される。 ◎ Font features enabled by default are applied, including features required for a given script.
-
[ `font-weight$p, `font-stretch$p, `font-style$p ]~propにより可能化される~font異体は、適用される: ◎ Font variations as enabled by the font-weight, font-stretch, and font-style properties are applied.
- `font-style$p により可能化される値の適用には、~font選定も影響する — この~propは、~italicや~oblique~fontを選定することもあるので。 `~font~style照合$secにより決定される値に最も近く合致する値が適用される。 ~UAは、 `font-style^p ~propに因る値のうち適用するのは, 1 個までにし~MUST — `ital^l, `slnt^l 両~値とも設定されては~MUST_NOT。 ◎ The application of the value enabled by font-style is affected by font selection, because this property might select an italic or an oblique font. The value applied is the closest matching value as determined by the font matching algorithm. User Agents must apply at most one value due to the font-style property; both "ital" and "slnt" values must not be set together.
- 選定された~fontが `font-face$at 規則~内に定義されるものである場合、この段にて適用される値は,その規則~内の[ `font-weight$d, `font-stretch$d, `font-style$d ]記述子の値で切詰められるべきである。 ◎ If the selected font is defined in an @font-face rule, then the values applied at this step should be clamped to the value of the font-weight, font-stretch, and font-style descriptors in that @font-face rule.
- さらに、この段にて適用される値は,当の~fontが~supportする値に切詰められるべきである。 ◎ Then, the values applied in this step should be clamped (possibly again) to the values that are supported by the font.
- 継承した `lang^a / `xml:lang^a 値により指定される言語は、適用される。 ◎ The language specified by the inherited value of lang/xml:lang is applied.
- ~fontが `font-face$at 規則を介して定義される場合、[ その規則の中の `font-language-override$d 記述子 ]により黙示される~font言語~上書きは,適用される。 ◎ If the font is defined via an @font-face rule, the font language override implied by the font-language-override descriptor in the @font-face rule are applied.
- ~fontが `font-face$at 規則を介して定義されていて,その規則は `none^v 以外の値をとる妥当な `font-named-instance$d 記述子を 1 個は含んでいて,読込まれた~font資源は `地域化d名の照合$sec規則に則って,その名前の`有名~instance$を含む場合、その有名~instanceが表現する すべての異体~値が適用される。 これらの値は、当の~fontが~supportする値に切詰められる。 ◎ If the font is defined via an @font-face rule, that @font-face rule includes at least one valid font-named-instance descriptor with a value other than none, and the loaded font resource includes a named instance with that name according to the §5.1 Localized name matching rules, then all the variation values represented by that named instance are applied. These values are clamped to the values that are supported by the font.
- ~fontが `font-face$at 規則を介して定義される場合、[ その規則の中の `font-variation-settings$d 記述子 ]により黙示される ~font異体は,適用される。 ◎ If the font is defined via an @font-face rule, the font variations implied by the font-variation-settings descriptor in the @font-face rule are applied.
- ~fontが `font-face$at 規則を介して定義される場合、[ その規則の中の `font-feature-settings$d 記述子 ]により黙示される ~font特能は,適用される。 ◎ If the font is defined via an @font-face rule, the font features implied by the font-feature-settings descriptor in the @font-face rule are applied.
- `font-language-override$p ~propの値により黙示される~font言語~上書きは,適用される。 ◎ The font language override implied by the value of the font-language-override property is applied.
- `font-optical-sizing$p ~propの値により黙示される~font異体は,適用される。 ◎ Font variations implied by the value of the font-optical-sizing property are applied.
- [[ `font-variant$p ~propとその各種 下位prop ], および[ OpenType特能を利用する(例えば,`font-kerning$p ~prop)他の~CSS~prop ]]の値により黙示される ~font特能は,適用される。 ◎ Font features implied by the value of the font-variant property, the related font-variant subproperties and any other CSS property that uses OpenType features (e.g. the font-kerning property) are applied.
- [ `font-variant$p や `font-feature-settings$p ]以外の~propにより決定される特能~設定群は,適用される。 例えば, `letter-spacing^p ~propに対し非~既定の値を設定することにより、共通合字は不能化される。 ◎ Feature settings determined by properties other than font-variant or font-feature-settings are applied. For example, setting a non-default value for the letter-spacing property disables common ligatures.
- `font-variation-settings$p ~propの値により黙示される~font異体は,適用される。 これらの値は、当の~fontにより~supportされる値で切詰められるべきである。 ◎ Font variations implied by the value of the font-variation-settings property are applied. These values should be clamped to the values that are supported by the font.
- `font-feature-settings$p ~propの値により黙示される~font特能は,適用される。 ◎ Font features implied by the value of font-feature-settings property are applied.
この順序付けにより,作者は、 `font-face$at 規則の中の~font用に,一般の各種~既定を与えた上で、特定の要素に対しては,~prop設定群で それらを上書きできるようになる。 一般~prop設定群は, `font-face$at 規則の中の設定群を上書きし、低次の~font特能~設定群は, `font-variant$p ~prop設定群を上書きする。 ◎ This ordering allows authors to set up a general set of defaults for fonts within their @font-face rules, then override them with property settings for specific elements. General property settings override the settings in @font-face rules and low-level font feature settings override font-variant property settings.
[ 一連の~font特能からなる,一つに組合された~list ]が,同じ特能に対し複数の値を包含するような状況~下では、その最後の値が利用される。 ~fontが[ 所与の下層の~font特能 ]用の~supportを欠いているときは、 ~textは、単純に,その~font特能が可能化されなかったかのように,描画される — 特定の~prop用に明示的に定義されている所を除き,~font~fallbackは生じず, 特能の合成-は試みられない。 ◎ For situations where the combined list of font feature settings contains more than one value for the same feature, the last value is used. When a font lacks support for a given underlying font feature, text is simply rendered as if that font feature was not enabled; font fallback does not occur and no attempt is made to synthesize the feature except where explicitly defined for specific properties.
7.3. 特能の優先順位の例
下の一連の~styleにより,一連の数字は、 段落~内で利用されるときには均衡幅に描画される一方で,価格表( table.prices )内では一定幅~形で示される。 ◎ With the styles below, numbers are rendered proportionally when used within a paragraph but are shown in tabular form within tables of prices:
body { font-variant-numeric: proportional-nums; } table.prices td { font-variant-numeric: tabular-nums; }
`font-variant$d 記述子が `font-face$at 規則~内で利用されるときは、その規則により定義される~fontにのみ適用される。 ◎ When the font-variant descriptor is used within an @font-face rule, it only applies to the font defined by that rule.
@font-face { font-family: MainText; src: url(http://example.com/font.woff); font-variant: oldstyle-nums proportional-nums styleset(1,3); } body { font-family: MainText, Helvetica; } table.prices td { font-variant-numeric: tabular-nums; }
この事例では、~old-style命数法は,全体を通して, しかし~font `MainText^F が利用される所でのみ,利用されることになる。 前の例とちょうど同様に、価格表の中では,一定幅の値が利用されることになる — `tabular-nums$v が一般~style規則の中に出現し,その利用は `proportional-nums$v と相互排他的なので。 ~stylistic代替~集合は、`MainText^F が利用される所でのみ,利用されることになる。 ◎ In this case, old-style numerals will be used throughout but only where the font "MainText" is used. Just as in the previous example, tabular values will be used in price tables since tabular-nums appears in a general style rule and its use is mutually exclusive with proportional-nums. Stylistic alternate sets will only be used where MainText is used.
`font-face$at 規則は、[ `font-face$at 定義の`src$d 記述子における `local$f の利用 ]を介して[ ~localに可用にされた~font ]の中の~font特能に~accessするために利用することもできる: ◎ The @font-face rule can also be used to access font features in locally available fonts via the use of local() in the src descriptor of the @font-face definition:
@font-face {
font-family: BodyText;
src: local("HiraMaruPro-W4");
font-variant: proportional-width;
font-feature-settings: "ital"; /*
~CJK~text特能~内の~Latin~italic
◎
Latin italics within CJK text feature
*/
}
body { font-family: BodyText, serif; }
可用なら、~Japanese~font "`Hiragino_Maru_Gothic^F" が利用されることになる。 ~text描画が生じたときは、~Japanese仮名は均衡幅に~spaceが空けられ,~Latin~textは~italic化されることになる。 ~fallback~serif~fontにより描画される~textは、既定の描画~propを利用することになる。 ◎ If available, a Japanese font "Hiragino Maru Gothic" will be used. When text rendering occurs, Japanese kana will be proportionally spaced and Latin text will be italicised. Text rendered with the fallback serif font will use default rendering properties.
下の例の中の随意合字は、~download可能な~fontに対してのみ可能化されるが,[ ~class `special^css の `span^e ]内では不能化される: ◎ In the example below, discretionary ligatures are enabled only for a downloadable font but are disabled within spans of class "special":
@font-face { font-family: main; src: url(fonts/ffmeta.woff) format("woff"); font-variant: discretionary-ligatures; } body { font-family: main, Helvetica; } span.special { font-variant-ligatures: no-discretionary-ligatures; }
随意合字を可能化するために, `font-feature-settings^p を利用して規則を追加したとする: ◎ Suppose one adds a rule using font-feature-settings to enable discretionary ligatures:
body { font-family: main, Helvetica; } span { font-feature-settings: "dlig"; } span.special { font-variant-ligatures: no-discretionary-ligatures; }
この事例では、随意合字は,[ ~class `special^css の `span^e ]内で描画されることになる。 何故なら、[ `font-feature-settings$p, `font-variant-ligatures$p ]~propの両者が,これらの `span^e に適用されるので。 `font-variant-ligatures$p の設定 `no-discretionary-ligatures^v は, ~OpenType `dlig^tag 特能を実質的に不能化するが、その後に `font-feature-settings$p が解決されるので,値 `dlig^v が随意合字を可能化し直すことになる。 ◎ In this case, discretionary ligatures will be rendered within spans of class "special". This is because both the font-feature-settings and font-variant-ligatures properties apply to these spans. Although the no-discretionary-ligatures setting of font-variant-ligatures effectively disables the OpenType "dlig" feature, because the font-feature-settings is resolved after that, the "dlig" value reenables discretionary ligatures.
8. ~font異体~prop
注記: この節にて利用される技術は、 “~font異体( `font variations^en )” と総称される。 そのような技術を~supportする個々の~fontは、 “可変~font( `variable font^en )” と呼ばれる。 ◎ Note: The technology in use in this section is named "font variations." An instance of one such font as a "variable font."
8.1. 外見的~sizingを制御する: `font-optical-sizing^p ~prop
◎名 `font-optical-sizing@p ◎値 `auto$v1 | `none$v1 ◎初 `auto^v ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎順 文法に従う ◎ア 不可 ◎表終異なる~sizeで描画された~textは、視覚的な表現を少しばかり違えることで,~typographic的に便益が得られることが多い。 例えば,~sizeが小さい~textは、読み易くなるよう,描線は太く~serifも大きくされることが多い。 対して,より大きい~textは、より優美で描線の太さの対比が~~強い造形になることが多い。 ◎ Typographically, text rendered at different sizes often benefits from slightly different visual representations. For example, to aid reading at small text sizes, strokes are often thicker with larger serifs. Larger text often has a more delicate figure with more contrast between thicker and thinner strokes.
- `auto@v1
- ~UAは、~font-sizeと~screenの画素~密度に基づいて,~glyphが成す形状を改変しても~MAY。 ~font異体を利用している[ ~OpenType/~TrueType ]~font用には、これは `opsz^tag ~font異体を利用して行われることが多い。 ◎ The user agent may modify the shape of glyphs based on the font-size and the pixel density of the screen. For OpenType and TrueType fonts using font variations, this is often done by using the "opsz" font variation.
- `none@v1
- ~UAは、外見的~sizeに応じて~glyphの形状を改変しては~MUST_NOT。 ◎ The user agent must not modify the shape of glyphs for optical size.
`opsz^tag 軸~用に異体~値を選定するときには、 `font-size$p も考慮され~MUST — また、他の~~設定も考慮されても~MAY。 ◎ font-size must be considered when selecting a variation value for the "opsz" axis, but other signals may also be considered.
注記: ~UAには、 `font-size$p 用の使用値に近い `opsz^tag 軸~用の値を給することが期待される。 しかしながら,~UAは、他の要因も考慮したいと望むであろう —[ ~screenの画素~密度 / 閲覧者の目からの~textの立体角 【すなわち,当の~textを成す文字の実際の~sizeは、(視野角を基準にする) `px^u 単位でいくつになるか】 ]などの。 しかしながら,~UAが,この値を選定するときには、[ これらの他の副次的な要因は無視rして、 `font-size^p のみ利用する ]ことが,最善な仕方になるであろうことが 試験により示されている。 ◎ Note: User Agents are expected to supply a value for the "opsz" axis which is close to the used value for font-size. However, User Agents might wish to consider other factors such as pixel density of the screen, or the solid angle the text subtends in the viewer’s retina. Experiments have shown, however, that disregarding these other ancillary factors and using only font-size might be the best way for a User Agent to select this value.
画素~密度, および ~textの視覚的~sizeは、 `font-optical-sizing$p 用に選ばれる異体~値に波及し得る。 [ 画素~密度/~textの視覚的~size ]が利用者による操作や~style変更に呼応して変化したときは、~UAは — その変化が~layoutを呼ぶものでない限り — この異体~値~用に新たな値を選んでは~MUST_NOT。 ~UAは、どの変化が~layoutを呼ぶものとするか決定する自由がある。 ◎ Pixel density as well as visual size of the text may influence the variation value chosen for font-optical-sizing. When either pixel density or visual size of the text changes in response to a user operation or style change, user agents must not choose a new value for this variation value unless the change is layout-causing. User agents are free to determine which changes are layout-causing.
注記: `pinch-zoom^en 【“つまんで拡大する”】など,利用者による操作のうち一部は、~textを~reflowさせないならば,~layoutを呼ぶものでないと見なせる。 しかしながら,~text~sizeを増やすなどの利用者による他の操作は、~textを~reflowさせるので,~accessiblity目的においては ~layoutを呼ぶものと見なせる。 同様に, `transform$p ~propは,~layoutを呼ぶものでないと見なせる — それによる変形-は一般に~textを~reflowさせないので。 各~UAは、どの操作が~layoutを変化させるか裁定する自由がある。 ◎ Note: Some user operations, such as pinch-zoom, can be considered not-layout-causing if they do not cause text to reflow. However, other user operations, such as increasing text size for accessiblity purposes, can be considered layout-causing because they cause text to reflow. Similarly, the transform property can be considered not-layout-causing because transforms generally do not cause text to reflow. Each user-agent is free to decide whether or not each operation is layout-changing or not.
~UAは、~fontにより直に遂行されていない外見的~sizingを合成しては~MUST_NOT。 ◎ User Agents must not synthesize optical sizing when it is not performed by the font directly.
~UAは、 `opsz^tag 軸~用の値として,~text描画に利用されている~fontが~supportしないものを選定しては~MUST_NOT。 これは、選ばれた値を~fontが~supportする範囲に切詰めることで~~達成できる。 ◎ User Agents must not select a value for the "opsz" axis which is not supported by the font used for rendering the text. This can be accomplished by clamping a chosen value to the range supported by the font.
8.2. 低次の~font異体~設定群の制御: `font-variation-settings^p ~prop
◎名 `font-variation-settings@p ◎値 `normal$v1 | [ `string$t `number$t] # ◎初 `normal^v ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎順 文法に従う ◎ア 可(下を見よ) ◎表終この~propは、[ ~OpenType/~TrueType ]~font異体についての低次の制御を供する。 [ 広く利用されていないが,特定0の利用事例には必要になる~font異体 ]への~accessを供する仕方として意図されている。 ◎ This property provides low-level control over OpenType or TrueType font variations. It is intended as a way of providing access to font variations that are not widely used but are needed for a particular use case.
作者は、一般に,アリなら~font異体に関係する他の~propを利用して( `font-optical-sizing$p など)、[ たまにしか利用されない,特定0の~font異体に~accessするためには、他に仕方がない ]ような 特別な事例に限り,この~propを利用するべきである。 ◎ When possible, authors should generally use the other properties related to font variations (such as font-optical-sizing) whenever possible and only use this property for special cases where its use is the only way of accessing a particular infrequently used font variation.
- `normal@v1
- 値 `normal^v は、この~propに因り,~glyphの[ 形状 / 照合 / 位置決め ]は変化しないことを意味する。 ◎ A value of normal means that no change in glyph shape, matching, or positioning occurs due to this property.
- `string$t `number$t
- `string^t, `number^t は、順に[ ~OpenType/~TrueType ]異体~軸の名前, 値を与える。 軸~名の文字大小は区別される。 [ ~OpenType/~TrueType ]仕様に指定されるように、軸~名は 4 個の~ASCII文字からなる。 [ ~~長さが 4 文字でない / 符号位置の範囲 `U+20–7E^v に入らない文字を包含している ]軸~名は、無効になる。 軸~名は、~font内に定義された軸~tagに限り合致する必要があるので、明示的に登録された[ ~OpenType/~TrueType ]異体~軸には制限されない。 ~custom軸~名を定義している~fontは、~OpenType仕様に定義される 命名~規則 に従うべきである。 ◎ The <string> is a case-sensitive OpenType or TrueType variation axis name. As specified in the OpenType / TrueType specifications, axis names contain four ASCII characters. Axis name strings longer or shorter than four characters, or containing characters outside the U+20–7E codepoint range are invalid. Axis names need only match an axis tag defined in the font, so they are not limited to explicitly registered OpenType / TrueType variation axes. Fonts defining custom axis names should follow the name rules defined in the OpenType specification.
- ~font内に無い軸~名は、無視されるので,その効果は無い。 ~UAは、これらの軸~tagに基づいて,~fallbackの挙動を合成しようと試みては~MUST_NOT。 同じ `font-variation-settings$p 宣言の中の他の軸~値は、無視されない。 ◎ Axis values not present in the font are ignored and therefore have no effect; a user agent must not attempt to synthesize fallback behavior based on these axis tags. Other axis values within the same CSS font-variation-settings statement are not ignored.
- ~fontが~supportする範囲に入らない軸~値は、その範囲に入る最も近い値に切詰められる。 ◎ Axis values greater or less than the range supported by the font are clamped to the closest value supported by the font.
- 小数や負の値も許容される。 ◎ Values are allowed to be fractional or negative.
同じ軸~名が複数回~出現した場合、その軸~用には,最後の出現に伴われた値のみが利用される(他は~~無視される)。 この~~~縮約化は、この~propの算出値に~accessすれば,観測-可能になる。 ◎ If the same axis name appears more than once, the value associated with the last appearance supersedes any previous value for that axis. This deduplication is observable by accessing the computed value of this property.
異体~軸は,特定的には[ ~OpenType/~TrueType ]異体~用に定義されているが、将来には,~font異体を~supportする他の現代の~font形式も追加されるかもしれない。 他の~font形式~用に定義される異体は、登録-済みの異体~軸の~patternに,アリな限り従うよう試みるべきである。 ◎ Although specifically defined for OpenType / TrueType variations, variation axes for other modern font formats that support font variations might be added in the future. Where possible, variations defined for other font formats should attempt to follow the pattern of registered variation axes.
`font-variation-settings^p の~animate法は、次の仕組みを利用してアリになる。 【以下、この段落の内容は未訳。】 ◎ Animating font-variation-settings is possible using the following mechanism. Two declarations of font-feature-settings can be animated between if they are "like". "Like" declarations are ones where the same set of properties appear (in any order). Because succesive duplicate properties are applied instead of prior duplicate properties, two declarations can be "like" even if they have differing number of properties. If two declarations are "like" then animation occurs pairwise between corresponding values in the declarations. Otherwise, animation is not possible. In this situation, the "from" values of the animation are swapped to the "to" values at an unspecified time during the animation.
9. 色~fontの~support
色~font†は、~glyphが成す辺を述べる輪郭のみならず ~glyphの内側に色が在ることも,~font~fileに許容する。 【† `color font^en, 色を~supportする~font( “`colored^en (~~有色)” とは少し意味合いが異なるようだ) 】 ◎ Color fonts allow for font files to describe not just the contours describing the edges of glyphs, but also the colors present inside the glyphs.
絵図を追加する。 ◎ Add a picture.
9.1. 色~font~paletteの制御-法: `font-palette^p ~prop
多くの色~font~file形式では、~glyphの中の色の~parameter化が許容されている。 これらの~font内では、各~glyphの幾何を述べるときに,各~色は~indexで参照される。 これらの~indexは、~font内に在る表引き~tableを利用して,現在~作動中の~paletteの中で解決される。 しかしながら,多くの~fontは、複数の~paletteを包含する — それぞれが、快適な視覚的~結果を供するために,~font~designerにより選ばれた補色の集合を包含しているような。 ◎ Many color font file formats allow colors within glyphs to be parameterized. In these fonts, colors are referenced by index when describing the geometry of each glyph. These indices are resolved within a current active palette using a lookup table present inside the font. However, many fonts contain multiple palettes, each containing a set of complimentary colors chosen by the font designer to provide pleasing visual results.
◎名 `font-palette@p ◎値 `normal$v1 | `light$v | `dark$v | `palette-identifier$t ◎初 `normal^v ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎順 文法に従う ◎ア 不可(下を見よ) ◎表終- `normal@v1
- ~UAは、色~fontを,色のない~fontにアリな限り近くなるように扱おうと試みる。 特に,~UAは、読むのに最良な結果が既定で得られるような~paletteを利用する。 ~UAは、この裁定を下すときに `color$p ~propの算出値を考慮に入れても~MAY。 ~UAはまた、~font内に定義されていない~paletteを構築して利用しても~MAY。 ◎ User-Agents attempt to treat the color font as closely as possible to a non-color font. In particular, user-agents use a palette which will yield the best default result for reading. User-agents may take the computed value of the color property into consideration when making this decision. User agents may also construct and use a palette not defined in the font.
- `light@v
- 一部の色~font形式は、[ ある種の~paletteを,背景が明るい(白に近い)ときに適用-可能 ]と~~定める~metadataを含む。 この~keywordは、~UAに,~font~file内の そのような~paletteのうち,最初に可用なものを利用させる。 [ ~font~file形式が この~metadataを織り込まない / ~font内に そのような~paletteは無い ]場合、この値は `normal$v1 として挙動する。 ◎ Some color font formats include metadata marking certain palettes as applicable on a light (close to white) background. This keyword causes the user-agent to use the first available palette in the font file marked this way. If the font file format does not account for this metadata, or no palette in the font is marked this way, this value behaves as normal.
- `dark@v
- “背景が明るい(白に近い)” に代えて “背景が暗い(黒に近い)” とすることを除き, `light$v の記述と同じ。 ◎ Some color font formats include metadata marking certain palettes as applicable on a dark (close to black) background. This keyword causes the user-agent to use the first available palette in the font file marked this way. If the font file format does not account for this metadata, or no palette in the font is marked this way, this value behaves as normal.
- `palette-identifier@t
- この値は、利用する作者~定義な~paletteを識別する。 作者は、 `font-palette-values$at 規則を利用して~paletteを定義できる。 適用-可能な `font-palette-values^at 規則は無い場合、この値は `normal$v1 として挙動する。 ◎ This value identifies an author-define palette to use. Users can define a palette by using the @font-palette-values rule. If no applicable @font-palette-values rule is present, this value behaves as normal.
- 【 値の構文, および 値として何を与えるかが述べられていないが、おそらく, `font-palette-values^at に付与した名前( `custom-ident^t )を指定する。 】
例と絵図を追加する。 ◎ Add examples and pictures.
9.2. 利用者~定義な~font色~palette: `font-palette-values^at 規則
`font-palette-values@at 規則は、色~paletteを定義した上で,その色~paletteを特定の~fontに結付ける。 ~web作者は、色~fontに利用する色を — ~font~file内に予め存在する~paletteに制限されることなく — 任意に選定できるようになる。 加えて,この規則で特定の~fontに結付けることで、同じ要素~内に複数の~font【のうちどれか】が利用されるときに(すなわち、~font~fallback用に),ある~paletteの名前を異なる~fontに 異なるように【元の~paletteと?】適用できるようにして、類似する色を複数の~fontに渡って利用できるようにする。 ◎ The @font-palette-values rule defines a color palette and associates that color palette with a specific font. This allows a web author to select arbitrary colors to use inside a color font rather than being limited to the preexisting palettes inside font files. In addition, this rule’s association with a specific font allows a name of a palette to apply differently to different fonts, which allows similar colors to be used across multiple fonts when multiple fonts are used in an element (i.e. for font fallback).
注記: ~web作者は、単独の~font用に複数の~paletteを作成して,自身の~web内容~用に複数の~themeを作成したいと望むこともあれば、複数の~fontに合致する~paletteを作成して,異なる一連の~fontに渡って 一貫する~designを達成したいと望むこともあろう。 ◎ Note: A web author might wish to create multiple palettes for a single font in order to create multiple themes for their web content. A web author might also wish to create matching palettes for multiple fonts to achieve a consistent design across a collection of different fonts.
`font-palette-values$at 規則は、ある~fontに利用される,順序された一連の色からなる~paletteを表現し、~web作者に次を許容する ⇒# ~fontの中の既存の~paletteを参照する / 作者~定義な色で拡充された~paletteを作成する / 作者~定義な色で~font内のある~paletteの色を上書きする ◎ A @font-palette-values rule represents a palette of colors used in a font. A palette consists of an ordered collection of colors. Using the @font-palette-values allows a web author to reference a palette existing within a font as well as creating a palette populated with author-defined colors. In addition, it allows overriding a set of colors from a palette in the font with colors described by the web author.
`font-palette-values$at 規則は、 `font-palette-values^at ~keywordと後続する 一連の記述子~宣言が成す~blockからなる。 その構文は: ◎ The @font-palette-values rule consists of the @font-palette-values at-keyword followed by a block of descriptor declarations. It has the following syntax:
@font-palette-values `custom-ident$t { `declaration-list$t }
`font-palette-values$at 規則は、この仕様に定義される各種~記述子を受容する。 ◎ The @font-palette-values rule accepts the descriptors defined in this specification.
`Handover Sans^F の色~paletteを改変する例: ◎ Modify Handover Sans’s color palette
@font-palette-values Augusta { font-family: Handover Sans; base-palette: 3; override-color: 1 rgb(43, 12, 9), 3 var(--highlight); }
これらの記述子は、もっぱら,それらを定義した `font-palette-values^at 規則を成す文脈の中で適用され,文書~言語の要素には適用されない。 同じ名前の記述子が同じ `font-palette-values^at 規則~内に複数個 在る場合、最後に宣言された記述子のみが利用され,他は無視される。 ◎ These descriptors apply solely within the context of the @font-palette-values rule in which they are defined, and do not apply to document language elements. When a given descriptor occurs multiple times in a given @font-palette-values rule, only the last descriptor declaration is used and all prior declarations for that descriptor are ignored.
所与の `font-palette-values$at 規則たちは、それらを包含する【参照する】文書の中で可用になる作者~定義な~paletteを定義する。 ◎ A given set of @font-palette-values rules define which author-defined palettes are available for use within the documents that contain these rules.
作者~定義な~font色~paletteは、それを参照する文書に限り可用になり,他所では利用できない — ある頁の内容が他の頁に影響-可能になると、攻撃者が攻撃路として利用できるような,~security漏洩の一つを成すので。 ◎ An author-defined font color palette is only available to the documents that reference it. Using an author-defined color palette outside of the documents that reference it would constitute a security leak since the contents of one page would be able to affect other pages, something an attacker could use as an attack vector.
`font-palette-values$at 規則は: ◎ This at-rule\
- ~CSSの前方互換な構文解析規則に従う。 宣言~block内の~propと同様に、~UAは,自身が~supportしない どの記述子に対しても,その宣言を無視し~MUST。 ◎ follows the forward-compatible parsing rules of CSS. Like properties in a declaration block, declarations of any descriptors that are not supported by the user agent must be ignored.\
- `~font-familyPV$d 記述子を要求する — 欠落中のものは、無効になり,まるごと無視され~MUST。 ◎ @font-palette-values rules require a font-family descriptor; if it is missing, the @font-palette-values rule is invalid and must be ignored entirely.
- ~UAが[ ~platform資源が制限されている/ 色~font用の~supportを実装していない / 色~fontを不能化する能を実装している ]事例では、単純に無視され~MUST — この仕様に定義される個々の記述子の挙動は、改められるべきでない。 ◎ In cases where user agents have limited platform resources, do not implement support for color fonts, or implement the ability to disable color fonts, @font-palette-values rules must simply be ignored; the behavior of individual descriptors as defined in this specification should not be altered.
9.2.1 ~font族: `font-family^d 記述子
◎述 `~font-familyPV@d ◎用 `font-palette-values$at ◎値 `family-name$t# ◎初 なし(必須) ◎表終この記述子は、当の `font-palette-values^at 規則が表現する~paletteを適用する~font族~名を,定義する。 この~paletteは、値に挙げられた名前の~font以外には,適用されない。 この記述子の値には、汎用~font/`~install済み~font$の名前は許容されない — 在る場合は構文~errorになる。 値に構文~errorがある場合、規則~全体が無視され~MUST。 ◎ This descriptor defines the font family name that this palette applies to. This palette will only ever be applied to the font with this name. The value of this descriptor matches the definition of the <family-name> for the font-family property. This means that only named font families are allowed and rules that including generic or installed fonts in the list of font families are syntax errors. If syntax errors occur within the font family list, the entire rule must be ignored.
9.2.2 基底~paletteの指定-法: `base-palette^d 記述子
◎述 `base-palette@d ◎用 `font-palette-values$at ◎値 `integer$t | `string$t ◎初 なし(必須) ◎表終`base-palette$d 記述子は、次のいずれかを受容する ⇒# ある~paletteを指す数量的な~index( 0 から数える)/ ある有名~paletteに対応する文字列 ◎ The base-palette descriptor accepts either a (zero-based) numerical palette index, or a string, which corresponds to a named palette.
`Banner Flag^F の色~paletteを改変する例: ◎ Modify Banner Flag’s color palette
@font-palette-values Festival { font-family: Banner Flag; base-palette: 'Dark'; override-color: 'Outline' rgb(123, 64, 27), 'Base Glyph' currentColor, 'Glints' var(--highlight); }
この記述子は、それを包含している `font-palette-values$at 規則の初期~色~paletteとして,対象の~font内の[ この記述子の値と同じ~indexを伴う~palette ]を指定する。 当の規則~内の `override-color$d 記述子の値を成す各~itemは、初期~色~palette内の 1 個の色を上書きする。 `override-color^d が無ければ、当の規則は,初期~色~paletteをそのまま表現することになる。 ◎ This descriptor specifies a palette in the font which the containing @font-palette-values rule uses as an initial value. If no <override-color> key is present in the @font-palette-values rule, then the @font-palette-values rule represents the palette in the font with the same index as the value of this descriptor. If a <override-color> key is present in the @font-palette-values rule, each item in the value of thatz descriptor overrides a single color in the color palette represented by this @font-palette-values block.
`Handover Sans^F の 3 個目の色~paletteを名付ける: ◎ Rename Handover Sans’s 3rd color palette
@font-palette-values Augusta { font-family: Handover Sans; base-palette: 3; }
`base-palette$d 記述子が `font-palette-values$at 規則~内に 無い, または 在るが その値に与えた~indexには~paletteは~font内に無い場合、この記述子は `0^v が指定されていたかのように挙動する。 ~fontが色~paletteを 1 つも包含しない場合、当の `font-palette-values^at 規則が表現する初期~色~paletteは, 0 個の色からなる。 `font-palette-values^at 規則~内で `override-color$d 記述子を利用すれば、色~paletteに色を追加できる。 ◎ If this descriptor is not present in the @font-palette-values, or if the font does not contain a palette at the index of the value of base-palette, it behaves as if 0 were specified. If a font does not contain any color palettes, no colors are included in the initial color palette represented by this @font-palette-values rule. Colors can be added to the color palette by using the <integer> descriptor in the @font-palette-values rule.
この記述子の値~内に指定された各~文字列は、`地域化d名の照合$secに則って照合される。【?】 ◎ Strings specified in the value of this descriptor are matched according to §5.1 Localized name matching.
9.2.3. ~paletteからの色の上書き法: `override-color^d 記述子
◎述 `override-color@d ◎用 `font-palette-values$at ◎値 [ [ `string$t | `integer$t ] `color$t ]# ◎初 なし(必須) ◎表終この記述子は、当の `font-palette-values$at 規則が表現する(その `base-palette$d 記述子で指示される)初期~色~palette[ の色を上書きする / に色を追加する ]:
- この記述子は、~commaで区切られた~listを値にとる。
- ~listを成す各~itemは、[ ~key, 置換する色 ]が成す組を表現する。
- ~keyは、初期~色~palette内の[ ある~entryに対応する~index( 0 から数える) / ある有名~entryに対応する文字列 ]を与える。
- 初期~色~palette内に~keyに対応する~entryが在るならば、その~entryの色は ~itemの値で指定される色で~~上書きされる — 他の場合、新たな色が追加される。
この記述子の値に~cascade変数( `var$f )利用しても妥当になるものと,明示的に期待される†。 ただし、~cascade変数は,この記述子の~keyには許容されない。 ~cascade変数は `font-palette$p ~propが適用される要素の文脈において解決されるので、異なる要素~上で `font-palette^p に同じ値を指定した場合でも,利用される~paletteは異なり得る — `font-palette-values$at 規則~内にある~cascade変数には、各~要素の文脈ごとに異なる値が適用されるかもしれないので。 ◎ Using CSS Variables is explicitly expected to be valid in the value of this descriptor. Using CSS Variables is disallowed in the key of this descriptor. CSS Variables are resolved in the context of the element to which the font-palette property applies. This means that using font-palette with the same value on two different elements might result in different used palettes because the value of variables inside the @font-palette-values rule might apply differently in the context of those two elements.
【 ~cascade変数の挙動は、~at-規則や記述子に対しては,定義されていない(記述子には、~cascadeの概念も定義されていない)。 “期待される” とは、この~~変則的な~~意味合いを表すと見受けられる。 】
9.3. ~text呈示~styleの選定-法: `font-variant-emoji^p ~prop
◎名 `font-variant-emoji@p ◎値 `auto$v1 | `text$v1 | `emoji$v1 ◎初 `auto$v1 ◎適 すべての要素 ◎継 される ◎百 受容しない ◎算 指定値 ◎順 文法に従う ◎ア 不可(下を見よ) ◎表終`Bikeshed the values.^en
この~propは、~web作者が,ある種の絵文字~符号位置~用に[ 絵文字~呈示, ~text呈示 ]のどっちを利用するか選定できるようにする。 これらの呈示~styleは、伝統的に,ある種の符号位置に異体字~選択子[ `FE0E^U `VARIATION SELECTOR-15^cn / `FE0F^U `VARIATION SELECTOR-16^cn ]を付加することにより選定されていた。 `font-variant-emoji$p は、~web作者が,異体字~選択子の代わりになる既定の呈示~styleを設定できるようにする。 ◎ This property allows web authors to select whether emoji presentation or text presentation is used for certain emoji code points. Traditionally, these presentation styles were selected by appending Variation Selector 15 (U+FE0E) or Variation Selector 16 (U+FE0F) to certain code points. However, font-variant-emoji allows web authors to set a default presentation style which can replace the variation selectors.
この~propが影響する符号位置は、~Unicodeにて[ `Unicode Presentation Sequence^en に寄与するものとして 挙げられているもの ]に限られる。 この仕様においては、これらの文字は `呈示に関与する符号位置@ と総称される。 この~propには、他のどの文字に対しても効果は無い。 ◎ Only the code points listed by Unicode as contributing to a Unicode Presentation Sequence are affected by this property. Within this CSS specification, these characters are referred to as Presentation Participating Code Points. This property has no effect on any other characters.
この~propは、~font~fallbackに影響するものと予期される。 しかしながら,~font~fallbackと `font-variant-emoji$p との相互作用の正確な資質は、明示的に,未指定である。 しかしながら,異体字~選択子は — `~cluster照合$secにて定義されるように — その前にある~cluster内に含まれ~MUST。 したがって,異体字~選択子は、~font~fallbackに際し,副次的~dataとして扱われることになる。 この挙動による自然な結果として、異体字~選択子は,その前にある文字と異なる~fontで描画されては~MUST_NOTことになる。 ◎ This property is expected to affect font fallback; however, the exact nature of the interaction of font fallback with font-variant-emoji is explicitly unspecified. However, a variation selector must be included in a previous cluster as defined by the cluster matching section above. Therefore, the presence of a variation selector is treated as ancillary data to inform the font fallback routine. A natural result of this behavior is that a variation selector must not be rendered in a different font than the previous character.
`font-variant-emoji$p が利用されたとしても、要素の内容に異体字~選択子[ `FE0E^U `VARIATION SELECTOR-15^cn / `FE0F^U `VARIATION SELECTOR-16^cn ]が在るならば, `font-variant-emoji^p にて指定された描画を上書きする。 したがって, `font-variant-emoji^p は、描画されている~textが任意選択で外せるような,既定の呈示を設定する。 ◎ Even when font-variant-emoji is used, the presence of Variation Selector 15 (U+FE0E) or Variation Selector 16 (U+FE0F) in the contents of an element override the rendering specified in font-variant-emoji. Therefore, font-variant-emoji sets a default presentation which the text being rendered can opt out of.
注記: 絵文字~呈示~連列をどう取扱うかは、~platformごとに異なる規約がある。 複数の~platformを~supportする~UAは、個々の~platformごとに その規約に従いたいと望むこともあれば,どの~platformにも同じ~approachを利用したいと望むこともあろう。 絵文字~styleの描画を要請された~UAは、色~tableを含まない~fontは無視rしたいと望むこともあれば, どの~clusterにも 機械的に同じ~cluster~fallback~algoを利用したいと望むこともあろう。 ◎ Note: Different platforms have different conventions about how to handle emoji presentation sequences. A cross-platform UA might wish to follow the conventions of each inividual platform, or it might wish to use the same approach on all platforms. When tasked with a request for an emoji style rendering, a UA might wish to disregard fonts which do not include color tables. A different UA might wish instead to use the same mechanical cluster fallback algorithm that it would use for any arbitrary cluster.
[ `FE0E^U `VARIATION SELECTOR-15^cn, `FE0F^U `VARIATION SELECTOR-16^cn ]以外の異体字~選択子は、~font選定に影響しては~MUST_NOT — 在ったとしても,それまでに選定された~fontが それを~supportしないならば、無視される。 ◎ Variation selectors other than FE0E VARIATION SELECTOR-15 and U+FE0F VARIATION SELECTOR-16 must not have any affect on font selection. If one of these variation selectors is present, but unsupported by the font previously selected, the variation selector is ignored.
[ `lang^a / `xml:lang^a ]属性が受容する[ BCP47 による[ 言語~tagに対する `-u-^c 拡張 ]]は、~UAが特定0の文字~用に[ 絵文字, ~text ]どちらの呈示を利用するか裁定するときには,考慮されるべきでない。 ◎ BCP47’s -u- extension to the language tag accepted by lang or xml:lang should not be considered when the user-agent decides whether to use emoji presentation or text presentation for a particular character.
- `auto@v1
- ~UAは、`呈示に関与する符号位置$を[ 絵文字~style, ~text~style ]どちらで描くことも選べる。 ~UAは、この裁定を遂行するときに[ `Unicode Consortium^en による 手引き / ~platform規約 ]に従いたいと望むであろう。 ◎ User Agents can choose to draw a Presentation Participating Code Point in either emoji style or text style. User Agents may wish to follow the guidance of the Unicode Consortium when performing this decision. User agents also may wish to follow platform conventions when performing this decision.
- `text@v
- 符号位置~列は、どの`呈示に関与する符号位置$にも `FE0E^U `VARIATION SELECTOR-15^cn が付加されていたかのように描画される。 ◎ Code points are rendered as if U+FE0E VARIATION SELECTOR-15 was appended to every Presentation Participating Code Point.
- `emoji@v1
- 符号位置~列は、どの`呈示に関与する符号位置$にも `FE0F^U `VARIATION SELECTOR-16^cn が付加されていたかのように描画される。 ◎ Code points are rendered as if U+FE0F VARIATION SELECTOR-16 was appended to every Presentation Participating Code Point.
`1F6CB^U `COUCH AND LAMP^cn の絵文字~形を示すためには、次を利用する — `CustomEmoji.ttf^l は、この文字の絵文字~形の~UAによる~supportに順守していてるとする: ◎ To show the emoji form of U+1F6CB COUCH AND LAMP, let CustomEmoji.ttf obey the User Agent’s notion of supporting the emoji form of this character, and use the following:
@font-face { font-family: "Custom Emoji"; src: url("CustomEmoji.ttf") format("truetype"); } ... <div style="font-family: 'Custom Emoji'; font-variant-emoji: emoji;"> 🛋 <!-- 🛋 --> </div>
10. ~fontの分類法
所与の~fontは、以下に挙げる分類のうち 1 つ以上に属し得る: ◎ A given font may belong in one or more of the following categories:
- `~install済み~font@ ◎ 10.1. Installed Fonts
- ~fontは、利用者の機器~上に大域的に~install済みのこともある。 そのような~fontは、一般に,どの~appからも~access可能になる — ~CSSの概念が無い~appも含め。 ~font~objを保管している~file(たち)は、遠隔~資源ではなく,その機器に存在している。 ◎ A font may be installed globally on a device. Such fonts are generally accessible in any application, even applications which have no concept of CSS. The file or files backing the font object exist on the user’s device, not as a remote resource.
- ~install済み~fontと`~web~font$は、互いに~~排他的に分類され~MUST。 ◎ Installed Fonts must not be Web Fonts, and Web Fonts must not be Installed Fonts.
- `~web~font@ ◎ 10.2. Web Fonts
-
~fontは、遠隔~資源に保管されていることもある。 そのような~fontは、~UAの資源~fetching基盤を利用して要請され~MUST。 ~web~fontは、次のいずれかの仕組みにより表現される: ◎ A font may be backed by a remote resource, which must be requested using the User Agent’s resource fetching infrastructure. Web Fonts are represented by one of two mechanisms:
- `font-face$at 規則 ◎ @font-face rules
- 文書の `FontFaceSet$I を成す各 `FontFace$I ~entry ◎ A FontFace member of the Document’s FontFaceSet
- ~web~fontは、それを[ `font-face$at 規則/ 自前の `FontFaceSet$I ]で結付けている文書~以外の,他のどの文書からも~access可能になっては~MUST_NOT。 機器~上の他の~appは、~web~fontに~access可能になっては~MUST_NOT。 ◎ A Web Font must not be accessible in any other Document from the one which either is associated with the @font-face rule or owns the FontFaceSet. Other applications on the device must not be able to access Web Fonts.
- `~install済み~font$と~web~fontは、互いに~~排他的に分類され~MUST。 ◎ Installed Fonts must not be Web Fonts, and Web Fonts must not be Installed Fonts.
- ~web~fontは,`~install済み~font$を隠蔽するので、ある~install済み~fontの族~名が ある~web~fontのそれと同じ場合,その~install済み~fontには~access可能にならない。 ◎ Web Fonts shadow Installed Fonts, so if an Installed Font has the same family name as a Web Font, the Installed Font is not accessible.
- `予め~install済みの~font@ / 利用者が~installした~font ◎ 10.3. Preinstalled Fonts and User-Installed Fonts
- 利用者は、自身の機器に~fontを~installすることもある。 利用者が~installした~fontは、[ “~install” ~buttonを~clickする / 自身の機器の特定0の~directoryに~fileを複製する ]などの,利用者による明示的な動作により~installされたものである。 そのような~fontは、利用者が~installした~fontとされ,~install済み~fontにもなる。 ~web内容~作者は、利用者が~installした~fontが在ることを期待するべきでない — どの利用者も,特定の~fontを~installする動作を遂行した保証は無いので。 ~UAは、`~font照合~algo$secの目的においては,利用者が~installした~fontを無視することを選んでも~MAY。 ◎ Users may choose to install fonts on their devices. User-Installed Fonts are installed by an explicit action by the user, such as clicking an "Install" button or copying a file into a particular directory on their device. Such fonts are User-Installed Fonts and also are Installed Fonts. Web content authors should not expect the presence of user-installed fonts, because there is no guarantee any user will have performed the action to install a specific font. User Agents may choose to ignore User-Installed Fonts for the purpose of the Font Matching Algorithm.
- ~install済み~fontのうち,利用者が~installした~fontでないものは、予め~install済みの~fontに分類される。 特定0の~OSの特定0の~versionの利用者~すべては、[ 同じ予め~install済みの~fontの集合 ]を~installしている見込みが高い。 そのようなわけで、そのような~OSを対象にしている~web内容~作者は,これらの~fontの族~名を `font-family$p ~propに利用したいと望むこともある。 ◎ Any Installed Font which is not a User-Installed font is a Preinstalled Font. It is likely that all users of a particular version of a particular Operating System will have the same set of Preinstalled Fonts installed. As such, Web content authors targetting these Operating Systems may wish to use these fonts' family names inside font-family properties.
- `~system~font@ ◎ 10.4. System Font
- ~system~fontは、汎用~font族~名 `system-ui$v が利用する~fontである。 それは、予め~install済みの~fontに分類される。 ◎ The System Font is the font which is used by the system-ui generic font family name. It is an example of a Preinstalled Font.
11. ~obj~model
[ `font-face$at / `font-feature-values$at ]規則の内容は、 CSS Object Model に対する次の拡張を介して,~accessできる。 ◎ The contents of @font-face and @font-feature-values rules can be accessed via the following extensions to the CSS Object Model.
11.1. `CSSFontFaceRule^I ~interface
`CSSFontFaceRule$I ~interfaceは、 `font-face$at 規則を表現する。 ◎ The CSSFontFaceRule interface represents a <@font-face> rule.
[`Exposed$=Window] interface `CSSFontFaceRule@I : `CSSRule$I { readonly attribute `CSSStyleDeclaration$I `style@m; };
`DOM-LEVEL-2-STYLE$r 仕様は、この規則と異なる変種を定義している。 この仕様は、それに取って代わる。 ◎ The DOM Level 2 Style specification [DOM-LEVEL-2-STYLE] defined a different variant of this rule. This definition supercedes that one.
11.2. `CSSFontFeatureValuesRule^I ~interface
`CSSRule$I ~interfaceは、次の様に拡張される: ◎ The CSSRule interface is extended as follows:
partial interface `CSSRule$I { const `unsigned short$ `FONT_FEATURE_VALUES_RULE@m = 14; };
`CSSFontFeatureValuesRule$I ~interfaceは、 `font-feature-values$at 規則を表現する。 ◎ The CSSFontFeatureValuesRule interface represents a @font-feature-values rule.
interface `CSSFontFeatureValuesRule@I : `CSSRule$I { attribute `CSSOMString$ `fontFamily$m; readonly attribute `CSSFontFeatureValuesMap$I `annotation$m; readonly attribute `CSSFontFeatureValuesMap$I `ornaments$m; readonly attribute `CSSFontFeatureValuesMap$I `stylistic$m; readonly attribute `CSSFontFeatureValuesMap$I `swash$m; readonly attribute `CSSFontFeatureValuesMap$I `characterVariant$m; readonly attribute `CSSFontFeatureValuesMap$I `styleset$m; }; interface `CSSFontFeatureValuesMap@I { maplike<`CSSOMString$, sequence<`unsigned long$>>; void `set@m(`CSSOMString$ %featureValueName, (`unsigned long$ or sequence<`unsigned long$>) %values); };
- `fontFamily@m ◎ fontFamily of type CSSOMString
- 所与の[ 特能~値の集合 ]が定義されている 1 個以上の~font族からなる~listを成す,文字列を返す。 ◎ The list of one or more font families for which a given set of feature values is defined.
- `annotation@m
- `ornaments@m
- `stylistic@m
- `swash@m
- `characterVariant@m
- `styleset@m
- それぞれ、所与の `font-variant-alternates$p 値~型に対し,一連の`特能~値~名$を~fontの特能~値に結付けている `CSSFontFeatureValuesMap$I ~objを返す。 ◎ value maps of type CSSFontFeatureValuesMap, readonly ◎ Maps of feature values associated with feature value names for a given font-variant-alternates value type
- `CSSFontFeatureValuesRule$I のこれらの各種 値 map 属性は、対応する[ `特能~値~block$を介して定義される値 ]を反映する — [ `annotation^m / `ornaments^m ]属性は[ `annotation^at / `ornaments^at ]`特能~値~block$内の一連の値を包含する,等々。 ◎ Each value map attribute of CSSFontFeatureValuesRule reflects the values defined via a corresponding feature value block. Thus, the annotation attribute contains the values contained within a @annotation feature value block, the ornaments attribute contains the values contained with a @ornaments feature value block and so forth.
set(%featureValueName, %values)
-
`CSSFontFeatureValuesMap$I ~interfaceは、各種 既定の[ map class ]~method を利用するが、 `set()^m ~methodだけ,挙動が異なる。 この~methodは: ◎ The CSSFontFeatureValuesMap interface uses the default map class methods but the set method has different behavior.\
- %featureValueName に渡された`特能~値~名$に, %values に渡された無符号~整数の連列【 IDL `sequence^c 型~値】を結付ける。 ◎ It takes a sequence of unsigned integers and associates it with a given featureValueName.\
- %values に単独の無符号~整数が渡された場合には、それを[ その値 1 個からなる連列 ]として扱うことを除き,既定の[ map class ]~methodと同じに挙動する。 ◎ The method behaves the same as the default map class method except that a single unsigned long value is treated as a sequence of a single value.\
- 渡された値の個数が妥当でない場合、例外投出する。 ◎ The method throws an exception if an invalid number of values is passed in.\
- 結付けられている`特能~値~block$に許容される値の個数に上限がある場合、入力~連列がその上限を超えたときには, `InvalidAccessError^E 例外投出する。 この上限についての詳細は、`複数個の値をとれる特能~値の定義$secを見よ。 ◎ If the associated feature value block only allows a limited number of values, the set method throws an InvalidAccessError exception when the input sequence to set contains more than the limited number of values. See the description of multi-valued feature value definitions for details on the maximum number of values allowed for a given type of feature value block.\
- `get()^m ~methodが返す値は、常に連列になる — 連列が単独の値のみからなる場合でも。 ◎ The get method always returns a sequence of values, even if the sequence only contains a single value.
11.3. `CSSFontPaletteValuesRule^I ~interface
partial interface `CSSRule$I { const `unsigned short$ `FONT_PALETTE_VALUES_RULE@m = 15; }; interface `CSSFontPaletteValuesRule@I : `CSSRule$I { maplike<`unsigned long$, (`CSSOMString$ or `CSSOMRGBColor^I)>; attribute `CSSOMString$ `fontFamily^c; attribute `CSSOMString$ `basePalette@m; };
- `maplike$m
- 渡された~entryの値が `CSSOMString^I である場合、単色として構文解析する(例: `rgb^f 構文を利用して)。 単色~以外を指す場合、~callは無視されるか `undefined^c を返す。 ◎ If the value of the setlike functions is a CSSOMString, it is parsed as a solid color (e.g. using the rgb() syntax). If it refers to anything other than a solid color, the call is ignored or returns undefined.
- `fontFamily^m
- `basePalette^m
- これらの属性の設定子は、所与の値を,適切な~CSS~prop構文に則って構文解析する。 ◎ The fontFamily and basePalette interfaces are parsed according to the appropriate CSS property syntax.
付録 A. ~platform~font~propから~CSS~propへの対応付け
この付録は、他の節にて述べられた問題と状況の一部を~~説明するための,背景~情報として収録されている。 あくまで参考として読まれるべきである。 ◎ This appendix is included as background for some of the problems and situations that are described in other sections. It should be viewed as informative only.
~CSSにおける~font~propは、利用される下層の~font形式に依存しないように設計されている — それらは,共通的な[ ~OpenType/~TrueType ]~fontに加えて[ ~bitmap, ~Type1, ~SVG ]~fontの指定にも利用できる。 しかしながら,[ ~OpenType/~TrueType ]形式には、作者の混同を呼び易く,異なる~platformにわたる実装にも難題を突きつける様相がある。 ◎ Font properties in CSS are designed to be independent of the underlying font formats used; they can be used to specify bitmap fonts, Type1 fonts, SVG fonts in addition to the common TrueType and OpenType fonts. But there are facets of the TrueType and OpenType formats that often cause confusion for authors and present challenges to implementers on different platforms.
元々は~Appleにより開発された~TrueType `TRUETYPE$r は、~screenと印刷 両用の~outline~font形式として設計されている。 ~Microsoftが~Appleの~TrueType形式の開発に~~参加して以来、~TrueType~fontは,両~platformで~supportされるようになった。 ~TrueType形式の中の~font~dataは、共通の[ 4 字で記される~tag名 ]により判別され,それぞれが特定の型の~dataを包含する,~tableの集合からなる。 例えば,著作権や許諾の情報を含む命名~情報は、 `name^tag ~table【 `名前~table$?】に格納される。 `文字map$( `cmap^tag )~tableは、文字~符号化法たちから~glyphたちへの対応付けを包含する。 ~Appleは後に,増強された~typographic機能性を~supportするための~tableを追加した。 これらは今では, Apple Advanced Typography, 略して~AAT~fontと称されている。 ~Microsoftと~Adobeは、先進的~typography用に別々の~tableの集合を開発し,それらの形式を~OpenType `OPENTYPE$r と称した。 ~OpenType仕様は ISO にて Open Font Format `OPEN-FONT-FORMAT$r として標準~化されている。 ◎ Originally developed at Apple, TrueType [TRUETYPE] was designed as an outline font format for both screen and print. Microsoft joined Apple in developing the TrueType format and both platforms have supported TrueType fonts since then. Font data in the TrueType format consists of a set of tables distinguished with common four-letter tag names, each containing a specific type of data. For example, naming information, including copyright and license information, is stored in the name table. The character map (cmap) table contains a mapping of character encodings to glyphs. Apple later added additional tables for supporting enhanced typographic functionality; these are now called Apple Advanced Typography, or AAT, fonts. Microsoft and Adobe developed a separate set of tables for advanced typography and called their format OpenType [OPENTYPE]. The OpenType specification is standardized at ISO as the Open Font Format [OPEN-FONT-FORMAT].
~TrueType形式においては,~platform間に渡る異体が明示的に許容されていたので、~Microsoft~Windowsや~Linuxの下で利用される~font~dataは,多くの場合,~Appleの~MacOSXの下で利用される~dataと少しばかり異なっている。 これには[ ~font計量, 名前, `文字map$ ~data ]も含まれる。 ◎ In many cases the font data used under Microsoft Windows or Linux is slightly different from the data used under Apple’s Mac OS X because the TrueType format allowed for explicit variation across platforms. This includes font metrics, names and character map data.
特定的には、~font族~名~dataの取扱いは,~platformごとに異なっている。 [ ~TrueType / ~OpenType ]~fontに対しては、これらの名前は[ `name^tag ~tableの中の,`nameID^c = 1 の name record ]に包含される。 異なる~locale用に複数の名前を格納させることもできるが、~Microsoftは,~fontには常に少なくとも ~US~English版の名前を含ませることを推奨している。 ~Windows上では、~Microsoftは — 後方互換性を得るため — この族~名に対する書体~数を 4 個までに制限するものと裁定を下した。 より大きな~group分け “preferred 族”( `nameID^c = 16 )や “WWS 族” ( `nameID^c = 21 )も利用できる。 OSX などの他の~platformには,この制限は無く、族~名は,アリなすべての~group分けを定義するために利用される。 ◎ Specifically, font family name data is handled differently across platforms. For TrueType and OpenType fonts these names are contained in the name table, in name records with name ID 1. Multiple names can be stored for different locales, but Microsoft recommends fonts always include at least a US English version of the name. On Windows, Microsoft made the decision for backwards compatibility to limit this family name to a maximum of four faces; for larger groupings the "preferred family" (name ID 16) or "WWS family" (name ID 21) can be used. Other platforms such as OSX don’t have this limitation, so the family name is used to define all possible groupings.
`name^tag ~tableを成す他の~dataは、族~内の特定の書体を一意に識別するための名前を供する。 全部的~font名( `nameID^c = 4 ), および ~PostScript名( `nameID^c = 6 )は、単独の書体を一意に記述する。 例えば, `Gill_Sans^F 族の~bold体fは、全部名 `Gill_Sans_Bold^F, および ~PostScript名 `GillSans-Bold^F を持つ。 所与の書体~用の[ 地域化された版による全部名 ]は複数個あり得るが、~PostScript名は常に,一定の~ASCII文字のみからなる一意な名前である。 ◎ Other name table data provides names used to uniquely identify a specific face within a family. The full font name (name ID 4) and the Postscript name (name ID 6) describe a single face uniquely. For example, the bold face of the Gill Sans family has a fullname of "Gill Sans Bold" and a Postscript name of "GillSans-Bold". There can be multiple localized versions of the fullname for a given face, but the Postscript name is always a unique name made from a limited set of ASCII characters.
様々な~platform上で、~~同じ~fontを探索する際に,異なる名前が利用されている。 例えば,~Windows GDI `CreateIndirectFont^c ~APIにおいては、書体を表引きする際に 族や全部名を利用し得る一方で、~MacOSX上では,所与の書体を表引きする際に全部名や~PostScript名を利用する `CTFontCreateWithName^c ~API~callが利用される。 ~Linuxの下では、 `fontconfig^c ~APIにより,これらのどの名前を利用する~fontの探索も許容されている。 ~platform~APIによる,[ 他の~font候補への自動的な代用- ]がある状況~下では、返された~fontが所与の名前に合致するかどうかの検証が必要とされることもある。 ◎ On various platforms, different names are used to search for a font. For example, with the Windows GDI CreateIndirectFont API, either a family or fullname can be used to lookup a face, while on Mac OS X the CTFontCreateWithName API call is used to lookup a given face using the fullname and Postscript name. Under Linux, the fontconfig API allows fonts to be searched using any of these names. In situations where platform API’s automatically substitute other font choices, it may be necessary to verify a returned font matches a given name.
所与の書体の~weightは、 OS/2 ~tableの `usWeightClass^c ~fieldを介して決定され得るか,あるいは ~style名 ( `nameID^c = 2 )から推定され得る。 字幅も同様に OS/2 ~tableの `usWidthClass^c を介して決定され得るか, あるいは ~style名から推定され得る。 ~Windows GDI ~APIの下での[ 200 以下の~weightに対する合成的な~bold化 ]に関係する歴史的な理由から、~font~designerは、これらの~weightを避けるため, OS/2 ~tableの中の値に手を加えていることがある。 ◎ The weight of a given face can be determined via the usWeightClass field of the OS/2 table or inferred from the style name (name ID 2). Likewise, the width can be determined via the usWidthClass of the OS/2 table or inferred from the style name. For historical reasons related to synthetic bolding at weights 200 or lower with the Windows GDI API, font designers have sometimes skewed values in the OS/2 table to avoid these weights.
[ ~Thai, ~Arabic, ~Devanagariなどの,文脈依存の形状付けを利用する複層的な用字系 ]の描画には、~OpenTypeや~AAT~fontにしかない特能を要する。 今では、複層的な用字系の描画は、~Windowsおよび~Linuxでは,~OpenType~font特能により~supportされている一方で、~MacOSXの下では,[ ~OpenType, ~AAT ]両~font特能が利用されている。 ◎ Rendering complex scripts that use contextual shaping such as Thai, Arabic and Devanagari requires features present only in OpenType or AAT fonts. Currently, complex script rendering is supported on Windows and Linux using OpenType font features while both OpenType and AAT font features are used under Mac OS X.
12. ~securityと~privacy上の考慮点
`system-ui$v ~keywordは、~OSの既定の~system~UI~fontを公開し,指紋収集に~~利用され得る。 ◎ The system-ui keyword exposes the operating system’s default system UI font to fingerprinting mechanisms.
謝辞
The CSS Working group would like to thank:
Peter Constable for assorted language fixes.
Optical sizing image prepared by Nick Sherman.
Special thanks to Tab Atkins Jr. for providing the text for the section on Font Rendering Controls as well as the section on the `font-display$d descriptor. Special thanks to Ilya Grigorik and David Kuettel for their help in developing these sections.