fontspec
                                
                                 fontspec copied to clipboard
                                
                                    fontspec copied to clipboard
                            
                            
                            
                        fontspec lucida failure
Hi Will - the fontspec documentation says that the \setmainfont call should include the .otf (to look up by filename), even when .fontspec files are used. As in:
\documentclass{article} \usepackage{fontspec} \setmainfont{LucidaBrightOT.otf} \begin{document} roman \textit{italic} \textbf{bold \textit{bold-italic}} \end{document}
This reads the lucidabrightot.fontspec file, but then finding the fonts fails, e.g.: xl.tex:4: Package fontspec Error: The font ""LucidaBrightOT.otf"" cannot be found
With just \setmainfont{LucidaBrightOT}, it does find all the fonts and runs successfully.
I tried the same with \setmainfont{XCharter.otf}. It worked, finding all the fonts. The difference is apparently that XCharter.fontspec specifies Extension=.otf and leaves the .otf off of the individual font lines (e.g., BoldFont = XCharter-Bold). If I do the same in lucidabrightot.fontspec, it works too.
But this should not be necessary, should it? E.g., in the absence of any Extension=, it should just look up the font names as given, shouldn't it?
And it surely seems wrong that leaving off the .otf from the \setmainfont call makes it work -- either it should work both with and without, or it should fail both with and without.
Years ago, in consultation with you, we tried to write the lucida*.fontspec files in the most generic/reliable way possible. It is too bad that we failed. The behavior may have changed a while ago, as I get the same errors with the original TL18 fontspec.sty.
I'll attach the lucidabrightot.fontspec (renamed to .txt to appease !@#$% github) that we've used for umpteen years, although you (Will) should have it already ... thanks.
Oh dear, sorry. This part of the code ended up quite hairy and I guess I shouldn't be surprised there were prominent edge cases that have failed.
In hindsight, I maybe shouldn't have allowed .fontspec files to take the same name as the .otf, as it "hides" any local configuration and complicates the logic. Anyway, I won't change anything now...
I hope "I won't change anything now" doesn't mean you don't consider any of this a bug?
The sad story continues. First of all, with {LucidaBrightOT}, it reads lucidabrightot.fontspec, but maybe those definitions don't take effect and it is still using system fonts? That would make sense, since fontspec ignores spaces in the name, right?
But, it seems awfully weird and misleading to read the .fontspec and not act on it. If that is what is happening, can it report a warning or even an error?
Second, the mac people are saying the .fontspec file is only found if the case matches, LucidaBrightOT.fontspec. And I see now that the doc actually says that.
But, this requirement does not make sense to me. People can use more or less any case in their names, depending on how their system mangles names. E.g., Windows and now Mac are not case-sensitive, so it could be anything. So saying the name has to match is tantamount to making the TeX source files unportable between systems, which is the whole thing we're trying to avoid in the first place.
And how can fontspec even know if case matches given the case-independent nature of Windows and Mac? But I guess it is, somehow.
At any rate, we made the lucida*.fontspec names all lowercase from the beginning, precisely because that was the only thing that worked. And I'm pretty sure it's what you recommended/required at the time. So can we please keep that working?
For the (long and confusing) thread about this: https://tug.org/pipermail/lucida/2019-January/000778.html
I hope you will have time to look into this and keep the things that have always worked still working. I know you have the Lucida fonts, although the issue here is not about the fonts themselves, but about finding and using the .fontspec files. So it seems it would be highly desirable for a test case to do what we devised for Lucida all those years ago.
The only special thing about Lucida is the "bold" variant for latex being the "Demi"(bold) font. That is actually helpful since it can indicate whether the .fontspec is actually taking effect or not. Another thing that's easy enough to reproduce in a test setup.
This is all so discouraging. I hope you can help. Thanks.
On the contrary, I want to do the best I can to get the Lucida fontspec files working again.
The case stuff is annoying — due to various platform differences and other bugs I think I’ve flip-flopped around best practices. It shouldn’t be a problem, now, to check what’s available and load it regardless.
Very sorry for the problems here — I was unaware of the issues and hope they can be resolved quickly…
There have been other fontspec problems crop up recently and I also apologise if you’ve been at the tail end of any of the fallout.
thank you.
I was the one who originally reported the issues using the Lucida fonts on a Mac. I'd be happy to test out any changes there…