(This is sort of a follow-up to libertineotf and xelatex - bold smallcaps broken?, based on a problem that I had noticed earlier, but hadn't put my finger on.)
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}% 1
% \setmainfont{LinLibertine_R_0.otf}% 2
% \usepackage{libertineotf}% 3
\begin{document}
Foo bar. \textsc{Foo bar \textbf{baz!}}
\end{document}

Unexpectedly, this file doesn't use the otf Linux Libertine O files in C:\Windows\Fonts\, but the pfb files in my texmf tree (cf. log snippets below). I presume this is why the small caps don't work as described in Herbert's answer here, and also why doing any OpenType magic à la \addfontfeauture doesn't work either.
I'm not quite sure where the problem is coming from. Variant 2, which calls the otf font directly, runs, but doesn't use small caps; I assume that's because this font file is too specific for fontspec to automatically find the small caps font, so that I'd have to specify the file with the SmallCapsFont option manually. Variant 3 works pretty well, but as outlined in the question linked above, the calling of small caps is buggy there (and I want to solve the problem, not circumvent it).
As for background, I'm using MiKTeX 2.9, all up-to-date; and I have version 5.3 of the Linux Libertine fonts installed in C:\Windows\Fonts\ (independently from LaTeX, these are the ones I would've expected fontspec to use).
Some seemingly relevant bits from the log file (of variant 1):
Requested font "Linux Libertine O" at 10.0pt
-> C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/libertine/LinLibertine
O.pfb
Requested font "Linux Libertine O/ICU" at 10.0pt
-> C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/libertine/LinLibertine
O.pfb
[and a number of similar lines, but then:]
Requested font "Linux Libertine O/BI/ICU" at 10.0pt
-> C:/Windows/Fonts/LinLibertine_RB.otf
Requested font "Linux Libertine O/BI/BI/ICU" at 10.0pt
-> C:/Windows/Fonts/LinLibertine_RB.otf
I don't really have a specific question, other than: What's going on here, and how can I fix it?
fonts.config.in(note the.in), nolocalfonts.config. Creating alocalfonts.configwith or without.in, with the content you proposed, followed by updating the FNDB, refreshing the formats, deleting the auxiliary files, and recompiling didn't change anything. Also, runningxelatexwith the option you described (copy-pasted) returnsxelatex: Invalid command-line option\xelatex: Data: unknown option. – doncherry Nov 26 '12 at 00:36fc-cachecommand line tool. No idea why XeTeX option is not recognized, probably options are handled differently than TeX Live implementation. – خالد حسني Nov 26 '12 at 02:08xelatexworks with"instead of'. I'm now playing around withfc-cache, which is new to me. – doncherry Nov 26 '12 at 02:39localfonts.config, ranfc-cache -r -v, but the output included the lineC:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/libertine: caching, new cache contents: 10 fonts, 0 dirs. No progress in the output. While I don't think the log of the compilation will be particularly enlightening, here it is: http://pastebin.com/n5cW11Dh – doncherry Nov 26 '12 at 03:22.confinstead of.config, I don’t think FontConfig recognizes the later. – خالد حسني Nov 26 '12 at 03:42.confof course. – doncherry Nov 26 '12 at 03:46localfonts[2].conffiles inC:\Program Files (x86)\MiKTeX 2.9\fontconfig\config, they were inC:\ProgramData\MiKTeX\2.9\fontconfig\configandC:\Users\doncherry\AppData\Roaming\MiKTeX\2.9\fontconfig\config. Inserting the lines you suggested in the latter of these two solved the problem (only the former didn't help, and both isn't necessary). I'll let Leo know, perhaps we can improve the other answer. Thanks for your help! – doncherry Nov 26 '12 at 05:52