W3C home > Mailing lists > Public > www-style@w3.org > September 2011

Re: [css3-writing-modes] use case for font-dependent default orientation

From: John Daggett <jdaggett@mozilla.com>
Date: Sun, 11 Sep 2011 18:13:22 -0700 (PDT)
To: Koji Ishii <kojiishi@gluesoft.co.jp>
Cc: fantasai <fantasai@inkedblade.net>, W3C Style <www-style@w3.org>
Message-ID: <1431568077.3545.1315790002844.JavaMail.root@zimbra1.shared.sjc1.mozilla.com>

Koji Ishii wrote:


> Regarding whether "use-font" is per code point of per font,
> there was a misunderstanding between fantasai and me; I thought
> it's per code point, while fantasai thought it's font based. We
> haven't had a good idea how technically feasible "per code
> point" is. 

Just to be clear, the logic you're describing here is not what is
in the spec, where orientation is defined for the "use font"
codepoints (listed again below for reference) as upright or
sideways based on whether the font has vertical metrics or not.

What you seem to be describing (please correct me if I'm wrong) is:

  For codepoints categorized as "use font", if a vertical alternate
  exists in the font used for a given character, set the character
  upright and use the vertical alternate, otherwise the character
  as having a sideways orientation and render rotated.

Is that closer to what you and fantasai are thinking/proposing?

> Recently Murakami-san told fantasai and me that it's not that
> difficult to do "per code point", but FreeType doesn't have an
> API to read GSUB map (it can apply the map though.) We may be
> able to try to find contributors to implement "read map"
> feature to FreeType. Given that situation change--if I
> understand correctly--both fantasai and I are leaning towards
> to "per code point" based approach. That is, to change current
> "use-font" to "use alternate glyph if exists, otherwise
> sideways". This category is another, and better, solution to
> the unified punctuation issue I believe, but as I said above,
> I'd be extremely happy to hear any other proposals to solve the
> issue.

I think you should be *very* clear about what you're doing here,
you're putting a big special case in the middle of a text layout
engine.

Normally, a run of vertical text would be separated into upright
runs and rotated runs, broken down into scripts, matched with
fonts, and the characters laid out by (1) looking up the default
glyphs in the character map (cmap) and (2) running through the
features in the font to do both glyph substitution and
positioning.

Your special case would effectively be at the *end* of the
substitution phase, in other words you'd have to trace back and
figure out whether a 'vert' substitution occurred in addition to
other substitutions for a given character. Simply dumping out
glyph substitutions for the 'vert' feature and backmapping that
to the underlying character would not be correct.  For these "use
font" codepoints you'd need to double check whether a new
sideways or upright run needed to be added. Not impossible, just
complicated and something that we should take pains to avoid
unless absolutely necessary.

> The use case of font-dependent orientation is to solve unified
> code points, in particular, unified punctuations. I'm not
> insisting on the current font-dependent orientation is the only
> solution, I'd be happy to hear any other proposal to solve the
> issue, but I believe the issue must be solved.

The basic problem I see with making a codepoint's orientation
font-dependent is that you make it a property of whatever the
font designer assumed was the default context (e.g. a Japanese
font would assume it's upright, a Western font wouldn't) and via
font fallback you may end up using a font for which those
assumptions don't match the content.

For example, if a designer uses a vertical writing mode to get
rotated table headings in a non-CJK language they would be
confused as to why their double quotes appeared upright (due to
the fact that the double quote character was pulled from a
Japanese font via font fallback).

One alternative here is to use some form of context marker (e.g.
the language applied, the surrounding script) to infer whether
something is handled as upright/sideways.  So for some codepoints
in the General Punctuation range, they would be contextually
upright (and vertical alternates applied) for runs of Japanese
text and sideways otherwise.

I'm also really puzzled by why parentheses, braces and brackets
in the Basic Latin range are included in your "use font"
designation.  That doesn't match any current implementation
(webkit/ie9) and all of those code points have alternatives that
are more natural to use within Japanese text.  Nor have I seen a
Japanese font that has vertical alternates for these codepoints.

I think if we can figure out a way to define orientation that is
not font dependent as it is in the current spec, then we'll be
very close to having a proposal that's good enough for a first
version of this spec.

Regards,

John

Codepoints defined as "use font" by the Appendix C algorithm:
http://lists.w3.org/Archives/Public/www-style/2011Sep/0042.html

U+0020 S UF SPACE
U+0028 S UF LEFT PARENTHESIS
U+0029 S UF RIGHT PARENTHESIS
U+002D S UF HYPHEN-MINUS
U+005B S UF LEFT SQUARE BRACKET
U+005D S UF RIGHT SQUARE BRACKET
U+005F S UF LOW LINE
U+007B S UF LEFT CURLY BRACKET
U+007D S UF RIGHT CURLY BRACKET
U+00A0 S UF NO-BREAK SPACE
U+00A1 S UF INVERTED EXCLAMATION MARK
U+00AB S UF LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
U+00B2 S UF SUPERSCRIPT TWO
U+00B3 S UF SUPERSCRIPT THREE
U+00B7 S UF MIDDLE DOT
U+00B9 S UF SUPERSCRIPT ONE
U+00BB S UF RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
U+00BC S UF VULGAR FRACTION ONE QUARTER
U+00BD S UF VULGAR FRACTION ONE HALF
U+00BE S UF VULGAR FRACTION THREE QUARTERS
U+00BF S UF INVERTED QUESTION MARK
U+2000 S UF EN QUAD
U+2001 S UF EM QUAD
U+2002 S UF EN SPACE
U+2003 S UF EM SPACE
U+2004 S UF THREE-PER-EM SPACE
U+2005 S UF FOUR-PER-EM SPACE
U+2006 S UF SIX-PER-EM SPACE
U+2007 S UF FIGURE SPACE
U+2008 S UF PUNCTUATION SPACE
U+2009 S UF THIN SPACE
U+200A S UF HAIR SPACE
U+2010 S UF HYPHEN
U+2011 S UF NON-BREAKING HYPHEN
U+2012 S UF FIGURE DASH
U+2013 S UF EN DASH
U+2014 S UF EM DASH
U+2015 S UF HORIZONTAL BAR
U+2016 S UF DOUBLE VERTICAL LINE
U+2018 S UF LEFT SINGLE QUOTATION MARK
U+2019 S UF RIGHT SINGLE QUOTATION MARK
U+201A S UF SINGLE LOW-9 QUOTATION MARK
U+201B S UF SINGLE HIGH-REVERSED-9 QUOTATION MARK
U+201C S UF LEFT DOUBLE QUOTATION MARK
U+201D S UF RIGHT DOUBLE QUOTATION MARK
U+201E S UF DOUBLE LOW-9 QUOTATION MARK
U+201F S UF DOUBLE HIGH-REVERSED-9 QUOTATION MARK
U+2020 S UF DAGGER
U+2021 S UF DOUBLE DAGGER
U+2022 S UF BULLET
U+2024 S UF ONE DOT LEADER
U+2025 S UF TWO DOT LEADER
U+2026 S UF HORIZONTAL ELLIPSIS
U+2027 S UF HYPHENATION POINT
U+2030 S UF PER MILLE SIGN
U+2032 S UF PRIME
U+2033 S UF DOUBLE PRIME
U+2035 S UF REVERSED PRIME
U+2039 S UF SINGLE LEFT-POINTING ANGLE QUOTATION MARK
U+203A S UF SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
U+203B S UF REFERENCE MARK
U+203E S UF OVERLINE
U+203F S UF UNDERTIE
U+2040 S UF CHARACTER TIE
U+2045 S UF LEFT SQUARE BRACKET WITH QUILL
U+2046 S UF RIGHT SQUARE BRACKET WITH QUILL
U+2070 S UF SUPERSCRIPT ZERO
U+2074 S UF SUPERSCRIPT FOUR
U+2075 S UF SUPERSCRIPT FIVE
U+2076 S UF SUPERSCRIPT SIX
U+2077 S UF SUPERSCRIPT SEVEN
U+2078 S UF SUPERSCRIPT EIGHT
U+2079 S UF SUPERSCRIPT NINE
U+207D S UF SUPERSCRIPT LEFT PARENTHESIS
U+207E S UF SUPERSCRIPT RIGHT PARENTHESIS
U+2080 S UF SUBSCRIPT ZERO
U+2081 S UF SUBSCRIPT ONE
U+2082 S UF SUBSCRIPT TWO
U+2083 S UF SUBSCRIPT THREE
U+2084 S UF SUBSCRIPT FOUR
U+2085 S UF SUBSCRIPT FIVE
U+2086 S UF SUBSCRIPT SIX
U+2087 S UF SUBSCRIPT SEVEN
U+2088 S UF SUBSCRIPT EIGHT
U+2089 S UF SUBSCRIPT NINE
U+208D S UF SUBSCRIPT LEFT PARENTHESIS
U+208E S UF SUBSCRIPT RIGHT PARENTHESIS
U+2153 U UF VULGAR FRACTION ONE THIRD
U+2154 U UF VULGAR FRACTION TWO THIRDS
U+2155 U UF VULGAR FRACTION ONE FIFTH
U+2156 U UF VULGAR FRACTION TWO FIFTHS
U+2157 U UF VULGAR FRACTION THREE FIFTHS
U+2158 U UF VULGAR FRACTION FOUR FIFTHS
U+2159 U UF VULGAR FRACTION ONE SIXTH
U+215A U UF VULGAR FRACTION FIVE SIXTHS
U+215B U UF VULGAR FRACTION ONE EIGHTH
U+215C U UF VULGAR FRACTION THREE EIGHTHS
U+215D U UF VULGAR FRACTION FIVE EIGHTHS
U+215E U UF VULGAR FRACTION SEVEN EIGHTHS
U+215F U UF FRACTION NUMERATOR ONE
U+2985 U UF LEFT WHITE PARENTHESIS
U+2986 U UF RIGHT WHITE PARENTHESIS
U+3000 U UF IDEOGRAPHIC SPACE
U+3008 U UF LEFT ANGLE BRACKET
U+3009 U UF RIGHT ANGLE BRACKET
U+300A U UF LEFT DOUBLE ANGLE BRACKET
U+300B U UF RIGHT DOUBLE ANGLE BRACKET
U+300C U UF LEFT CORNER BRACKET
U+300D U UF RIGHT CORNER BRACKET
U+300E U UF LEFT WHITE CORNER BRACKET
U+300F U UF RIGHT WHITE CORNER BRACKET
U+3010 U UF LEFT BLACK LENTICULAR BRACKET
U+3011 U UF RIGHT BLACK LENTICULAR BRACKET
U+3014 U UF LEFT TORTOISE SHELL BRACKET
U+3015 U UF RIGHT TORTOISE SHELL BRACKET
U+3016 U UF LEFT WHITE LENTICULAR BRACKET
U+3017 U UF RIGHT WHITE LENTICULAR BRACKET
U+3018 U UF LEFT WHITE TORTOISE SHELL BRACKET
U+3019 U UF RIGHT WHITE TORTOISE SHELL BRACKET
U+301A U UF LEFT WHITE SQUARE BRACKET
U+301B U UF RIGHT WHITE SQUARE BRACKET
U+301C U UF WAVE DASH
U+301D U UF REVERSED DOUBLE PRIME QUOTATION MARK
U+301E U UF DOUBLE PRIME QUOTATION MARK
U+301F U UF LOW DOUBLE PRIME QUOTATION MARK
U+3030 U UF WAVY DASH
U+30A0 U UF KATAKANA-HIRAGANA DOUBLE HYPHEN
U+FE17 U UF PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET
U+FE18 U UF PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET
U+FE31 U UF PRESENTATION FORM FOR VERTICAL EM DASH
U+FE32 U UF PRESENTATION FORM FOR VERTICAL EN DASH
U+FE33 U UF PRESENTATION FORM FOR VERTICAL LOW LINE
U+FE34 U UF PRESENTATION FORM FOR VERTICAL WAVY LOW LINE
U+FE35 U UF PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS
U+FE36 U UF PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
U+FE37 U UF PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET
U+FE38 U UF PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
U+FE39 U UF PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET
U+FE3A U UF PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
U+FE3B U UF PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET
U+FE3C U UF PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET
U+FE3D U UF PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET
U+FE3E U UF PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET
U+FE3F U UF PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET
U+FE40 U UF PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET
U+FE41 U UF PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET
U+FE42 U UF PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET
U+FE43 U UF PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET
U+FE44 U UF PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET
U+FE47 U UF PRESENTATION FORM FOR VERTICAL LEFT SQUARE BRACKET
U+FE48 U UF PRESENTATION FORM FOR VERTICAL RIGHT SQUARE BRACKET
U+FE4D U UF DASHED LOW LINE
U+FE4E U UF CENTRELINE LOW LINE
U+FE4F U UF WAVY LOW LINE
U+FE59 S UF SMALL LEFT PARENTHESIS
U+FE5A S UF SMALL RIGHT PARENTHESIS
U+FE5B S UF SMALL LEFT CURLY BRACKET
U+FE5C S UF SMALL RIGHT CURLY BRACKET
U+FE5D S UF SMALL LEFT TORTOISE SHELL BRACKET
U+FE5E S UF SMALL RIGHT TORTOISE SHELL BRACKET
U+FE63 S UF SMALL HYPHEN-MINUS
U+FF08 U UF FULLWIDTH LEFT PARENTHESIS
U+FF09 U UF FULLWIDTH RIGHT PARENTHESIS
U+FF0D U UF FULLWIDTH HYPHEN-MINUS
U+FF3B U UF FULLWIDTH LEFT SQUARE BRACKET
U+FF3D U UF FULLWIDTH RIGHT SQUARE BRACKET
U+FF3F U UF FULLWIDTH LOW LINE
U+FF5B U UF FULLWIDTH LEFT CURLY BRACKET
U+FF5D U UF FULLWIDTH RIGHT CURLY BRACKET
U+FF5F U UF FULLWIDTH LEFT WHITE PARENTHESIS
U+FF60 U UF FULLWIDTH RIGHT WHITE PARENTHESIS
U+FF62 S UF HALFWIDTH LEFT CORNER BRACKET
U+FF63 S UF HALFWIDTH RIGHT CORNER BRACKET
Received on Monday, 12 September 2011 01:13:53 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:44 GMT