font availability test and font fallback? #74
Comments
|
Sounds useful. But:
Apart from that, what you are pondering is what I’d express as lookup chaining: if the test for a font results in a negative, try the next one in the list of candidates etc. We’d need a special syntax (or csname) for that. It’s not impossible, though the current design doesn’t exactly lend itself for this kind of addition. Personally I’d rather lobby for Latex to adopt the concept of typescripts |
|
Hmmm, I was not thinking about something interfering with the whole lookup thing, but just a small function returning a bool, true if the name or file resolves to something, and false otherwise. With this you could easily do something like it seems simple and clear... for sure, automatization would require something bigger... What do you think? |
|
It depends on what you intend to resolve -- a font name or a filename? For font names you can just do what luaotfload-tool does: |
|
hmmm... yes, it sounds good! Though, for a public interface, having two nil arguments for a function is something really strange, what about a ? |
|
Better: but still, only for font names. |
|
Just one question: you really only need raw fontnames, not the fancy |
|
You now have two functions for that at your disposal: |
|
Sorry for the late answer, today is my day off... well, this is just wonderful, actually better than I asked, Thanks! |
Building very complex documents (like polyglossia documentation), I realize how useful it would be to be able to test if a font is available or not, this would allow fallbacks for non-available fonts.
Two usecases :
One for polyglossia : we want to write farsi, whatever the font, and not everyone has the same, so we could test a few fonts, and take the first available.
One for unicode-math-example: we build a table with all possible math symbols in all possible math fonts, but it would be useful to check if a math font is available before building its table...
These are very specific, but I'm sure others would come. This would be quite new in the TeX World I guess, but it sounds like an improvement... What do you think?
The text was updated successfully, but these errors were encountered: