all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Werner LEMBERG <wl@gnu.org>
To: eliz@gnu.org
Cc: 33885@debbugs.gnu.org
Subject: bug#33885: 27.0.50; PUA character makes emacs crash
Date: Fri, 28 Dec 2018 15:58:50 +0100 (CET)	[thread overview]
Message-ID: <20181228.155850.556290055640666168.wl@gnu.org> (raw)
In-Reply-To: <83va3d6ani.fsf@gnu.org>

>> We rather have to check how the `Cardo' fonts get loaded into
>> Emacs; it looks as if the global font descent value is incorrect.
>> Please tell me (a) how to identify the font used for U+E6A3, and
>> (b) where to set a breakpoint to see the font loading in action.
> 
> (a) font->props[2] names the font, so:
> 
>   (gdb) pp font->props[2]
> 
> should display its name in human-readable form.

Thanks.  This indeed gives `Cardo'.

> (b) Given your list of features, which includes XFT, I think you
> want to set a breakpoint in xftfont_open, where there's a call to
> XftFontOpenPattern.

OK.  `XftFontOpenPattern' returns the following data for `Cardo':

(gdb) p *xftfont
$12 = {
  ascent = 16, 
  descent = -5, 
  height = 6, 
  max_advance_width = 91, 
  charset = 0x7fffe23d52d8, 
  pattern = 0x1f01050
}

This is problematic, since it only reflects the Apple values for
ascent and descent (i.e., the data in the font's `hhea' table).  To
solve the issue, there are two possible solutions IMHO.

(1) Simply accept whatever `XftFontOpenPattern' returns, including
    negative values for `descent' – actually, such font might exist:
    for example, consider a special font that only contains dashes of
    different length.

(2) Improve the heuristics to get sensible global ascent and descent
    values of a font.  In particular, use the FreeType library to
    access a TrueType's or OpenType's `OS/2' table and compare its
    vertical metrics values with the `hhea' data to eliminate bugs in
    the font – sign problems with `descent' do happen especially in
    older fonts that were either designed for Apple or for Windows,
    and the fields for the `other' OS were filled out arbitrarily,
    more or less.


      Werner

  reply	other threads:[~2018-12-28 14:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-27  8:54 bug#33885: 27.0.50; PUA character makes emacs crash Werner LEMBERG
2018-12-27 10:36 ` Eli Zaretskii
2018-12-27 11:33   ` Eli Zaretskii
2018-12-28  8:33   ` Werner LEMBERG
2018-12-28  9:16     ` Eli Zaretskii
2018-12-28 12:38       ` Werner LEMBERG
2018-12-28 13:30         ` Eli Zaretskii
2018-12-28 14:58           ` Werner LEMBERG [this message]
2018-12-28 15:33             ` Eli Zaretskii
2018-12-28 17:03               ` Werner LEMBERG
2018-12-28 17:06                 ` Werner LEMBERG
2018-12-28 19:15                 ` Eli Zaretskii
2022-02-12  8:42 ` Lars Ingebrigtsen
2022-02-12  8:57   ` Eli Zaretskii
2022-03-12 22:43     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181228.155850.556290055640666168.wl@gnu.org \
    --to=wl@gnu.org \
    --cc=33885@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.