latex3 / fontspec

Font selection in LaTeX for XeTeX and LuaTeX
http://latex3.github.io/fontspec/
LaTeX Project Public License v1.3c
277 stars 34 forks source link

More explanatory warning with language-not-exist #421

Closed jbezos closed 6 months ago

jbezos commented 4 years ago

Many people seem puzzled by the message displayed when a certain language doesn't exist, and they even think it's an error. While the message in necessary, because it's relevant for some languages, it could be more informative, with something like:

Package fontspec Warning: Language 'Thai' not available for font 'FreeSerif'
(fontspec)                with script 'Thai'. There is nothing intrinsically wrong with
(fontspec)                this warning, and if the output is as expected, you can
(fontspec)                ignore it.
jbezos commented 4 years ago

@wspr I've noticed some people is rejecting babel because of this message, which leads them to think the babel language is not available and therefore not useable. Please, can you provide some advice about what can I do to improve the situation? I'm trying to conceal it, but I haven't managed to do it yet. I'm even considering forcing the quiet mode, which is clearly a bad idea, but anyway better than showing this misleading message.

wspr commented 4 years ago

Sorry I overlooked this previously. Probably a better option (?) is to check if the language/script is present and only load it if so. There should be enough commands in the API section of the manual to do this without delving into fontspec internals. If you think that's clunky, I could also add something like TryLanguage={...} or Language*={...} which has the same behaviour but doesn't call the warning. Or I could drop the warning all together but default and add a new LanguageStrict={...} key instead. What do you think would be best?

jbezos commented 4 years ago

I haven't found a way to check if a language is available without actually loading before the font with some other settings. A message is fine, but not with Language XXX not available because most people knows nothing about font languages and some even think it refers to the babel language. Perhaps an info instead a warning and/or a message like that above or, in more positive terms something like:

      Font '\l_fontspec_fontname_tl' is using the default
      features because there are no specific ones for
      language '##1'.
      That's usually fine, because many languages
      require no specific features, but if the output is
      not as expected, consider selecting another font.
jbezos commented 2 years ago

This is just a reminder, because many people clearly think there is something wrong when this warning is shown.