- From: Taku Watabe <taku.eof@gmail.com>
- Date: Mon, 7 Dec 2009 18:40:00 +0900
- To: public-html-ig-jp <public-html-ig-jp@w3.org>
渡部巧です。
"11. Rendering" にそれらしきアルゴリズムの記述がありました:
http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#the-input-element-as-a-text-entry-widget
このうち、最も詳細な記述が "converting a character width to pixels" 定義です:
http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#converting-a-character-width-to-pixels
この定義は次の数式を規定しています:
(size-1)×avg + max
以下、各変数の定義を抜粋してみました:
size: the character width to convert
avg: the average character width of the primary font for
the element for which the algorithm is being run, in pixels
max: the maximum character width of that same font, also in pixels
"primary font" や "same font" は明確に定義されていないようですが……
恐らく "same font" は avg と同じフォント(つまり "primary font")で、
"primary font" は CSS font-family プロパティで最も最初に参照できたものでしょうか?
(例: font-family: "Verdana", "MS Pゴシック", sans-serif; なら "Verdana" が
"primary font" になる?)
size の定義がいまいちはっきりしないみたいで、気になります。
(余談ですが、"The element's 'letter-spacing' property does not affect the
result" とあるので、前述の計算結果は letter-spacing プロパティの結果に依存しないみたいです)
--
Taku Watabe (taku_eof)
http://end-of-file.net/
Be strict with yourself.
Received on Monday, 7 December 2009 09:40:52 UTC