8

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?

8
  • 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. Mar 7, 2012 at 18:00
  • 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)? Mar 7, 2012 at 18:54
  • @KhaledHosny With LuaTeX, I get 1.01 pt for Linux Biolinum O and 4.32129 pt for Linux Biolinum G. Under XɘTeX, the values are respectively 4.32 pt and 4.32129 pt. What explains this difference?
    – MarcRdC
    Mar 7, 2012 at 19:26
  • 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. Mar 7, 2012 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, 2012 at 20:10

1 Answer 1

3

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .