bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25945: Emacs aborts while calling FT_Load_Glyph


From: Werner LEMBERG
Subject: bug#25945: Emacs aborts while calling FT_Load_Glyph
Date: Fri, 03 Mar 2017 08:04:29 +0100 (CET)

[f5388ba8a7f3970afd0e2bcc52c834ae56178442, 2017-Mar-03]

For me, Emacs aborts at ftfont.c:1550 while `mew' tries to display an
e-mail.

  1549  if (FT_Load_Glyph (ft_face, g->g.code, FT_LOAD_DEFAULT) != 0)
  1550    emacs_abort ();

Examining `ft_face' and `g->g.code' I see that the font in question is
`Padauk Book Bold' (PadaukBook-Bold.ttf), glyph 376.  Examining this
font further with `ftview' I see that bytecode of this font is broken,
and that the font can only be displayed successfully without bytecode.
[This is version 3.002 of the font, taken from the current TeXLive
repository.]

I think there is no reason that Emacs aborts for such broken fonts.
Instead I suggest that (a) Emacs tries to load the glyph again without
hinting, and (b) if that fails, it should display a missing glyph,
using the standard rectangle with hex digits in it.

New code for (a) is quite simple:

  if (FT_Load_Glyph (ft_face, g->g.code, FT_LOAD_DEFAULT) != 0)
    if (FT_Load_Glyph (ft_face, g->g.code, FT_LOAD_NO_HINTING) != 0)
      ...

[The code might be further improved by implementing a per-font glyph
 load mode, to be initialized with `FT_LOAD_DEFAULT'.  If, say, 100
 calls using `FT_LOAD_DEFAULT' for a given font fails, and
 `FT_LOAD_NO_HINTING' is successful, the default loading behaviour for
 this font could be switched to `FT_LOAD_NO_HINTING'.  Given that such
 broken fonts are rare my suggestion is probably overkill, however.]

My knowledge of Emacs internals is too small to provide an
implementation for (b).


    Werner


======================================================================


In GNU Emacs 26.0.50 (build 1, x86_64-unknown-linux-gnu, GTK+ Version 3.16.7)
 of 2017-03-03 built on linux.suse
Repository revision: f5388ba8a7f3970afd0e2bcc52c834ae56178442
Windowing system distributor 'The X.Org Foundation', version 11.0.11702000
System Description:     openSUSE Leap 42.1 (x86_64)

Recent messages:
Auto-saving...done
Auto-saving...done
next-line: End of buffer [4 times]
Mark set
Making completion list...
Quit
Type C-x 1 to remove help window.  
Mark set
scroll-up-command: End of buffer
Making completion list...

Configured using:
 'configure MAKEINFO=/usr/bin/makeinfo --with-x-toolkit=gtk
 --enable-checking=yes,glyphs --enable-check-lisp-object-type
 'CFLAGS=-O0 -g3 -gdwarf-4''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY
GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11

Important settings:
  value of $LC_MONETARY: de_AT.UTF-8
  value of $LC_TIME: de_AT.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix

Major mode: Summary

Minor modes in effect:
  TeX-PDF-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  transient-mark-mode: (only . t)

Load-path shadows:
/usr/local/share/emacs/site-lisp/thai-word hides 
/usr/local/share/emacs/26.0.50/lisp/language/thai-word

Features:
(shadow emacsbug message puny dired dired-loaddefs format-spec rfc822
mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils apropos pp mew-varsx
mew-unix cal-menu calendar cal-loaddefs mew-auth mew-config mew-imap2
mew-imap mew-nntp2 mew-nntp mew-pop mew-smtp mew-ssl mew-ssh mew-net
mew-highlight mew-sort mew-fib mew-ext mew-refile mew-demo mew-attach
mew-draft mew-message mew-thread mew-virtual mew-summary4 mew-summary3
mew-summary2 mew-summary mew-search mew-pick mew-passwd mew-scan
mew-syntax mew-bq mew-smime mew-pgp mew-header mew-exec mew-mark
mew-mime mew-edit mew-decode mew-encode mew-cache mew-minibuf
mew-complete mew-addrbook mew-local mew-vars3 mew-vars2 mew-vars
mew-env mew-mule3 mew-mule mew-gemacs mew-key mew-func mew-blvs
mew-const mew tex dbus xml crm advice tex-site auto-loads quail
cjktilde mm-util mail-prsvr disp-table finder-inf package epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt subr-x gv bytecomp
byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase
cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet
lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese composite charscript
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
minibuffer cl-preloaded nadvice loaddefs button faces cus-face
macroexp files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
dbusbind inotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 237202 13045)
 (symbols 48 31618 2)
 (miscs 40 316 279)
 (strings 32 66908 9104)
 (string-bytes 1 1731569)
 (vectors 16 27986)
 (vector-slots 8 753851 6763)
 (floats 8 78 291)
 (intervals 56 1837 147)
 (buffers 976 14)
 (heap 1024 44161 1292))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]