Closed frivoal closed 6 years ago
This was originally defined in CSS Text Level 3: https://www.w3.org/TR/2012/WD-css3-text-20120119/#text-transform and was removed in 2012: https://www.w3.org/TR/2012/WD-css3-text-20120814/#recent-changes
FYI, see also section 3.3.3 in jlreq:
(note 3) | Slightly different from the question of the size of ruby, there is a question of whether or not small kana (cl-11) characters should be used in ruby annotations. Because the size is so small, there was no choice of using small kana in letterpress printing. Today there are cases where small kana are used in ruby annotations, but taking legibility into consideration, these cases should be limited to those where accurate readings are needed, such as for proper nouns.
The main argument against this feature was that...
Wasn't the main argument about preferring font-variant-east-asian: ruby
?
For the custom transforms mechanism I recently filed #3132, by the way.
Wasn't the main argument about preferring font-variant-east-asian: ruby?
I don't think it was the main argument back then, but it is certainly worth considering now.
font-variant-east-asian: ruby
seems aimed at a slightly different problem: both our spec and the open-type spec seem to advocate using in on regular kana to get better visual pairing between the base text and the ruby text. (css-text does that by showing an example of the word しんかんせん, which does not contain small kana, with thicker glyphs, and open type documentation suggests using it on U+3042, which is not a small kana).
That said, it is true that it could also be used to show large glyphs for small kana. Should it:
I would also think it's better be addressed by font-variant-east-asian: ruby
.
con: Doing it with a text-transform works even if the font fails to download
I don't see why this is a con. Fonts provided by operating system is probably more likely to have better support on this kind of OpenType features. At least, Hiragino on macOS and Meiryo on Windows both have so (although Gecko has to avoid applying this feature on Windows due to a bug in old versions of Meiryo). None of them make the small kana's bigger, though.
Fonts provided by operating system is probably more likely to have better support on this kind of OpenType features. [...] None of them make the small kana's bigger, though.
System fonts could do it, but don't. In-the-wild fonts might do it, but I don't know any that does, and even if we find some, it will have to be used as a web font.
So, if an author wants this effect, they have to rely on a web font (which might fail to download), and they have a very limited choice of fonts which actually do this, given that this is not what the feature was advertised to be about in the open type spec, and that therefore most font don't do the small-kana -> big-kana conversion.
That makes me think that the text transform avenue is still quite a reasonable one.
I think the more important reason not to rely on font-variant: ruby
is that font-variant: ruby
is primarily about matching the weight of the glyph: whether you want to also use full-size kana is a separate question, you might or you might not. As has been noted, using full-size kana makes the kana a little easier to read because it's bigger, but it loses the distinction between two letters which are in fact different letters. It would be better if fonts were not encouraged to use full-size kana when font-variant: ruby
is on so that the choice about whether full-size the kana remains open to the author and user.
The CSS Working Group just discussed text-transform: full-size-kana
, and agreed to the following:
RESOLVED: Add text-transform: full-size-kana to Text L3 marked at-risk
I actually am not in favor of this feature for ruby -- when the ruby is over the base text, it is not correct to use small kana glyphs, or glyphs of the same weight. The glyphs for small kana with ruby variants should be full size and thicker. My reasoning is about the text stream and placement being separable -- if you place the ruby after the text in parentheses, you want small kana, but over the base text you do not. Transforming the text stream would be an extra destructive step when switching presentation styles.
@macnmm I am not sure I understand your point. You say you disagree, but your arguments seem to be in favor:
when the ruby is over the base text, it is not correct to use small kana glyphs, or glyphs of the same weight. The glyphs for small kana with ruby variants should be full size and thicker.
I don't believe there is universal agreement that using full size kana on ruby over the base text is the only correct thing to do, although I do agree that there are authors who think it is. I am not speculating on the percentage, but it is more than a negligible share, and less than everybody, which I think is all we need to know in this case.
The addition of text-transform: full-size-kana
is precisely to support authors who want full size kana glyphs in ruby over the base text.
My reasoning is about the text stream and placement being separable -- if you place the ruby after the text in parentheses, you want small kana, but over the base text you do not. Transforming the text stream would be an extra destructive step when switching presentation styles.
text-transform
does not affect the underlying text stream (in other words, the DOM), only the way it is visually rendered. text-transform
does not affect speech synthesis, nor copy&paste. Any such operation would still see the transformed small size kana.
The kind of style switching you mention is exactly what text-transform: full-size-kana
enables. If an author uses ruby over the base text, they can turn this on, and if they use inline parenthesized ruby they can leave it off, since the markup contains the correct characters. Without this feature, we'd have the opposite problem: an author who'd want full-size-kana in ruby over the base text, they would have to use the full size characters in the markup, and therefore could not use the same markup to display parenthesized inline ruby without getting the characters wrong.
(not the topic of this issue, but the same is true for font-variant-east-asian: ruby
to deal with thickness)
The alternative that would do enable the behavior you asked would be instead of having a property that lets authors opt in or out of this, to always and automatically do it as soon as we're using ruby over the base text. However, I insist that while a common and valid practice, it is not universally agreed upon, which means having it as an automatic default
Many years ago, we discussed, and eventually rule against, a
full-size-kana
value totext-transform
It would have turned something like しゃ into しや. The two are not equivalent, (the first is pronounced “sha”, the second “shiya”), but at very small font sizes inside ruby text, this substitution is sometimes used to keep things at a legible size.
Without this text transform, authors wanting this effect will just hard code the transformed string into the source, which does the wrong thing from searches or speech synthesis.
The main argument against this feature was that this was a rather niche i18n feature, and if we started to add those to text-transform, there'd be no end to it, so it would be better to pursue a generic extension mechanism. I was one of those pushing this line of thought, and even drafted a possible generic mechanism: https://specs.rivoal.net/css-custom-tt/
I repent, and I think we should have added/kept
full-size-kana
.I think we should consider adding this value back.