-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-fonts] Specify what generic font family maps to nastaliq #4397
Comments
I wonder whether there's much preexisting use of the Another consideration: when nasatilq text contains bits of text in non Arabic scripts, what sort of fonts do they typically use? Certainly authors could select and style these separately, but if they don't it's interesting to know whether a cursive Latin / Chinese / ??? font would generally be a good match or not. Relatedly, If we end up not using |
I discussed this with some of my colleagues internally, and we would prefer a new keyword. Following the model of |
@shervinafshar @ntounsi @behnam your input on a new CSS generic font family Related to w3c/alreq#9 |
Useful background: |
I'm not sure creating more generic family names is the best solution here (I have my doubts about ISTM it would be appropriate for a UA to map the Mapping |
Yeah, I'm far from an expert, but it looks like nastaliq isn't in the same position, and we could map it to an existing keyword. |
Although I understand the need for handling Urdu, but I think putting the burden of that challenge on this property is stretching the definition of the property and making it needlessly over-specific; Is Nastaliq a "generic font family" of Arabic script fonts? Possibly, but so are Kufi and Naskh with more immediate and widespread use-cases. Ultimately, it's up to CSS spec editors to decide whether they are comfortable with this expansion of scope for "generic font family". In case this is planned to be added, I prefer it to clearly be named as |
@jfkthame's comment inspired me an interesting question. So are we positive to accept language/script/writing-system specific generic font families? I would then have 3-5 Japanese keywords that are nice to be added, and I think we should be prepared to requests to add a few tens of such keywords from other scripts too. We might need some guidelines what to accept and what not to. For what such generic family should do for contents in other scripts, we have learned that aggressive mapping may not be what authors want in the discussion for |
Personally, I am not at all positive about that. It substantially changes the meaning of "generic" font families, in a direction that I think we'd come to regret. What I am positive about is browsers using script/language/region information to inform their mapping of the existing generic keywords to appropriate available fonts, so that (for example) |
ISTM that adding |
We should never have had <generic-family>: <ends> || <stem> || <body> || <eyes> || <form> || <tool> || <mood>
<ends>: serif | sans-serif | slab-serif | egyptienne | swash | flourish | flat
<stem>: antiqua | grotesque | roman | equal | up-stroke | down-stroke | curved | straight | narrow | thick | bulky | outline | hollow | shadow | tall | petite
<body>: monospace | fixed-width | half-width | full-width | proportional | flexible
<eyes>: open | closed | filled | small | large | square | round
<form>: cursive | current | connected | fluid | calligraphic | artistic | rounded | squared | comic | typeset | uncial | broken | blackletter | segmented | geometric | historic | futuristic | fancy | stiff | masculine | feminine | poster | headline | pictographic
<tool>: nib | pen | pencil | brush | chalk | crayon | stencil | stamp | stylus | typewriter | lcd | chisel | sticker | pixel | finger | foot | paw | body
<mood>: neutral | angry | soft | sweet | romantic | careful | aggressive | loud | playful | funny | sarcastic | ironic | depressive | happy | wild | tame | serious | mechanic | shocked | frightened | dreamy | tired | explicit | poetic | childish … with saner values, of course. I brainstormed these just to illustrate the point. |
How about, for a start:
|
This basically looks like an attempt to reinvent PANOSE. I don't think that's ever really caught on, has it? (And I'm not convinced it belongs in CSS. For authors/designers who want that degree of control, |
@jfkthame My point was that the current generic font families are not mutually exclusive semantic-wise. Something simple, e. g. PS: Robert Stevahn: Panose on the Web (W3C,1996), CSS 2.0 |
+cc @himorin |
When filing this, I assumed it to be non-controversial that CSS
That may well be better, and the phrasing of this issue as filed is over-constrained by suggesting that a generic font family be the mechanism. The background of filing this issue was that I heard an anecdote (and believed it considering that Windows 10 treats "Arabic" and "Arabic (Nastaliq variant)" as different font management groups) in Noto PR video that some Urdu sites preferred bitmapping their text over having a browser use its usual Arabic font. That seemed like an unfortunate situation, so I checked what CSS says about getting Nastaliq (other than I am not suggesting standardizing keywords for all Arabic-script font styles or font styles generally. However, Windows 10 treating, in font management UI, "Arabic" and "Arabic (Nastaliq variant)" on the same level of distinction as "Chinese (Simplified)" and "Chinese (Traditional)" suggested that Nastaliq has special status compared to font styles in general, so it seemed worthwhile for CSS to say how to get it generically. I have no personal experience to evaluate this further. |
Yeah, when there are reasonably obvious-to-domain-experts mappings for a given language that might not be obvious to spec editors and implementors (most of whom speak Latin-alphabet languages), I think it's reasonable to talk about that in the spec. |
[Sorry for the delayed response due to catchup after travel.] I'm also not clear yet what the answer is here, although if i'd intervened earlier i would probably have said a number of things that @jfkthame mentioned already. The following are some random thoughts that come to mind, without yet an overarching system to bring them together:
The section in the fonts spec doesn’t seem to do a good job of describing the rules to be applied in order to sort fonts into the various generic styles. Sometimes form is paramount, other times function, or sometimes a slightly unconvincing and westernised attempt to mix the two. I’m inclined to think that there is a fairly high degree of arbitrariness involved in trying to fit non-Latin styles into the existing categories. I seem to be persuading myself that having a longer and extendable list of font styles for international text would be better than trying to squeeze new font styles into the current pigeon holes. (That said, i don’t think we want to have anything like the long list produced by @Crissov.) |
Exactly this. |
It's arguably rather unfortunate that we have enshrined Perhaps it would have been better to have terms such as But that ship sailed long ago, I suppose. Unless we're prepared to consider deprecating the existing generics and introducing a new, parallel set of more script-agnostic values? |
Yeah, that's almost certainly a non-starter. ^_^ |
The point i'm making is that these are probably fine to keep for Latin/Cyrillic/Greek/etc, because they represent useful alternate styles related to those scripts/languages. But we should recognise and treat them as representative of only a certain number of scripts/languages, and add the ability to indicate the alternative font styles needed for other scripts/languages. I'm not sure there's one set of styles that (eg. formal, ornate, etc.) that works for all scripts/languages. At some point we'll run into the same problem, just with a different set of labels. For example, how would one classify the Khmer styles, or the African ajami styles mentioned above into the buckets listed 2 comments earlier? |
I think we should revisit this once we decide on #4442, as until then it isn't entirely clear what it actually means for a name to be declared a generic font family. That said, it seems to me that the direction we're going in there is to say that the generic font families aren't actually special in terms of behavior with regards to how they match (or not) and how they fallback. In that case, they are just commonly accepted names for generic concepts, and nothing bad or unusual happens if a browser fails to support some of them (since authors can just supply fallbacks, whether other generic families, or named local fonts, or web fonts). If that's the case, I think we should start a separate document, outside of css-fonts, maintained as a registry rather than as a spec, where we list a larger set of generic font families than had been accepted so far, without requiring browsers to implement the whole set. I'd expect aditions to the list to be mainly diven by i18n needs, and it could list things like This would:
|
We could also introduce new properties to css-fonts that would influence the font selection (or configuration) like
Some of those would indeed match nicely with one or more of the PANOSE 1 or 2 (Intellifont) digits. Ideally, authors could set This might not seem all that useful for Helvetica/Arial/sans-serif font stacks in a LCR-only setting, but it would enable better automatic fallbacks for unavailable webfonts and for scripts not explicitly supported by the font stack specified in the stylesheet. PS: The |
If there is a decision to support a wider array of "generic" stylistic terms, we should probably start talking about using a functional notation (like |
With the recent resolution of issue: 4442 Don't require browsers to always match every generic font family to a concrete font family, it is now clearer that a) the other (new) generic font families may not map to at one matched face |
|
Well, yes, it's possible, and lacking other alternatives i have myself resorted to that tactic. But it's not ideal. (a) If you want to change the styling of your document(s) from, say, serif to nastaliq you would probably have to change the markup in all the files using the style sheet rather than just adjust the font-family in the style sheet itself. (b) I'm not confident that people writing documents using nastaliq or other styles would appreciate, or even know to, add the script tag everywhere they use a lang attribute. I certainly don't when writing documents that use the same style throughout for Kashmiri, Hausa, etc. (c) Script subtags don't exist for all the styles that are likely to be needed, such as Mool style in Khmer, or Kano style in African ajami, etc. We'd need to talk with the ISO folks about whether such an approach is something they'd support.
I'm not sure i agree with you there. These styles we're talking about are generally quite a high level concept, even though the style list may vary from language to language. Serif and sans-serif Latin script fonts have wide variations. Nastaliq already has fonts that vary (eg. Urdu vs Persian). But the point here it seems to me is that the system would choose one font that you have on your platform to fall back to, and if you're an Urdu user it's likely to be an Urdu font, and if you're Persian a Persian one, then at least that font would maintain the appropriate style. Which brings me to a suggestion: Browsers currently allow you to specify preferred fonts for particular languages. Why not simply build into the preferences for a browser a list of generic styles and allow users to specify which font they'd like to associate them with. This gives much more power to the user, and makes it much less difficult for the implementer to deal with larger lists of styles+fonts. |
Thanks for your reply @r12a , after reading about it and reviewing the concept of generic font family in css-fonts module, I have decided to retract my previous comment on this issue. |
So, with recent resolution that script-specific generic fonts may not match to a locally installed font on some systems, it seems that this issue can be solved by introducing |
The spec now defines a |
Drawing on I18n WG Generic font families I propose to add |
The section Generic font families does not say how to generically request a nastaliq font for the Arabic script. Anecdotally, the distinction of having a specifically nastaliq font is important enough in the Urdu context that Microsoft and Google bundle a nastaliq font with their operating systems for Urdu.
It seems to me that it would be good to explicitly specify which generic keyword means nastaliq, either by specifying that the
cursive
family means nastaliq for the Arabic script or by minting a new keyword for as was done forfangsong
. (I don't know which option is more appropriate, but I'm guessing that using the existingcursive
keyword should be sufficient.)The text was updated successfully, but these errors were encountered: