Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
{\LinBioO\LaTeX}\quad{\LinBioG\LaTeX}
\end{document}

With LuaTeX, I get

this,

while with XɘTeX you get the correct result:

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?

share|improve this question
1  
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
3  
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
3  
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
1  
@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
show 4 more comments

1 Answer

up vote 3 down vote accepted

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

luatexbase.add_to_callback("luaotfload.patch_font", fix_biolinum_xheight, "mypatch.fix_biolinum_xheight")
}

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.