Subject: bug#34577: 27.0.50; Identical face specification yields different line heights on different platforms

From: Markus Triska <[email-masked]>
Date: Tue, 19 Feb 2019 20:25:29 +0100

Please start Emacs with "emacs -Q" and evaluate:

    (defface height-test
      '((((class color))
         (:family "DejaVu Sans Mono"
                  :height 180
                  :weight normal
                  :slant normal)))
      "Face for height test")

Using Debian on my machine, then evaluating the form:

    (aref (font-info (face-font 'height-test)) 3)

yields: 29

In contrast, using OSX and Emacs from Macports (please see below for the
exact configuration), evaluating the same form yields: 28.

For one of my applications, I would like to obtain identical results on
all platforms, and the different line heights currently cause different
Emacs behaviour regarding scrolling etc. on these platforms.

Is there a way to reliably obtain the same results on these platforms?

Thank you and all the best!
Markus

For comparison, the results of the following form are shown below:

    (mapc (lambda (e)
            (insert (format "\n%s" e)))
          (font-info (face-font 'height-test)))

Result on OSX:

    -PfEd-DejaVu Sans Mono-normal-normal-normal-*-24-*-*-*-m-0-iso10646-1
    DejaVu Sans Mono:pixelsize=24:foundry=PfEd:weight=normal:slant=normal:width=normal:spacing=100:scalable=true
    24
    29
    0
    0
    0
    14
    23
    6
    14
    14
    /opt/local/share/fonts/dejavu-fonts/DejaVuSansMono.ttf
    nil

Result on Debian:

    -unknown-DejaVu Sans Mono-normal-normal-normal-*-24-*-*-*-m-0-iso10646-1
    DejaVu Sans Mono:pixelsize=24:foundry=unknown:weight=normal:slant=normal:width=normal:spacing=100:scalable=true
    24
    28
    0
    0
    0
    14
    22
    6
    14
    14
    /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
    nil

In GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin18.0.0, X toolkit, Xaw scroll bars)
 of 2018-11-15 built on OSX
Repository revision: b4eb908f858284a7962851fd99c94598f76afa6f
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:  Mac OS X 10.14.2

Configured using:
 'configure --prefix=/opt/local --without-ns --without-dbus
 --without-gconf --without-libotf --without-m17n-flt --without-gpm
 --with-gnutls --with-xml2 --with-modules --infodir
 /opt/local/share/info/emacs --with-json --with-x-toolkit=lucid
 --without-xaw3d --without-imagemagick --with-xpm --with-jpeg
 --with-tiff --with-gif --with-png --with-lcms2 --without-rsvg
 --with-xft 'CFLAGS=-pipe -Os
 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
 -arch x86_64' 'CPPFLAGS=-I/opt/local/include
 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk'
 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -lfreetype
 -lfontconfig -Wl,-no_pie
 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
 -arch x86_64''

Configured features:
XPM JPEG TIFF GIF PNG NOTIFY KQUEUE ACL GNUTLS LIBXML2 FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS JSON LCMS2 GMP

Important settings:
  value of $LC_CTYPE: UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix