# TeX logo with LuaTeX and Linux Biolinum O/G

Something is wrong with TeX and LaTeX logos with the font Linux Biolinum O under LuaTeX. I am using MiKTeX 2.9 on Windows. Here is a minimal working example:

\documentclass{minimal}

\usepackage{fontspec}
\newfontfamily\LinBioO{Linux Biolinum O}
\newfontfamily\LinBioG{Linux Biolinum G}

\begin{document}
\end{document}


With LuaTeX, I get

,

while with XɘTeX you get the correct result:

I did not really try other fonts, except Linux Libertine O and G, which both give a correct alignment of the ‘E’. Is the problem specific to the Linux Biolinum O font?

-
I added the images for you. Tip: As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again. –  Torbjørn T. Mar 7 '12 at 18:00
@TorbjørnT. O.K. Thanks. –  Marc ROGER de CAMPAGNOLLE Mar 7 '12 at 18:10
Might be that bug with some Linux Libertine fonts having wrong x height font dimen, what is the output of \the\fontdimen5\font (just after each font)? –  Khaled Hosny Mar 7 '12 at 18:54
IIRC, XeTeX ignores the x height value in the font and calculates it by itself, in LuaTeX (or rather luaotfload package) we use the value supplied by the font. The proper solution here is to fix the font. –  Khaled Hosny Mar 7 '12 at 20:01
@KhaledHosny "The proper solution here is to fix the font." - right. The os2_xheight is 101 which is in accordance to the \the\fontdimen5 above. –  topskip Mar 9 '12 at 20:10

Though it is a bug in the font, with LuaTeX we can “patch” fonts on the fly, and here is a possible fix:

\directlua {
local function fix_biolinum_xheight(fontdata)
if fontdata.fullname:find("Linux Biolinum") then
if fontdata.characters[string.byte("x")] then
fontdata.parameters.x_height = fontdata.characters[string.byte("x")].height
end
end
end


Adding those lines just after loading fontspec should do the trick.