emacs-devel
[Top][All Lists]
Advanced

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

Re: harfbuzz 2f72162: Fix crash in the Cairo build


From: Robert Pluim
Subject: Re: harfbuzz 2f72162: Fix crash in the Cairo build
Date: Fri, 14 Dec 2018 13:18:41 +0100

address@hidden (Eli Zaretskii) writes:

> diff --git a/src/ftcrfont.c b/src/ftcrfont.c
> index e2f84d4..6d74d93 100644
> --- a/src/ftcrfont.c
> +++ b/src/ftcrfont.c
> @@ -41,6 +41,9 @@ struct ftcrfont_info
>    bool maybe_otf;      /* Flag to tell if this may be OTF or not.  */
>    OTF *otf;
>  #endif       /* HAVE_LIBOTF */
> +#ifdef HAVE_HARFBUZZ
> +  hb_font_t *hb_font;
> +#endif  /* HAVE_HARFBUZZ */
>    FT_Size ft_size;
>    int index;
>    FT_Matrix matrix;

Eli, what would be your preferred type of solution to avoid this in
future? A #define of the common portion of the structs in ftfont.h? An
embedded 'struct ft_font_fixed' member inside struct ft{,cr}font_info?
Something else? At the very least I propose syncing the comments:

diff --git i/src/ftcrfont.c w/src/ftcrfont.c
index e2f84d44fc..7d63a344ec 100644
--- i/src/ftcrfont.c
+++ w/src/ftcrfont.c
@@ -35,12 +35,16 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 struct ftcrfont_info
 {
   struct font font;
-  /* The following six members must be here in this order to be
-     compatible with struct ftfont_info (in ftfont.c).  */
+  /* The following members up to and including 'matrix' must be here
+     in this order to be compatible with struct ftfont_info (in
+     ftfont.c).  */
 #ifdef HAVE_LIBOTF
   bool maybe_otf;        /* Flag to tell if this may be OTF or not.  */
   OTF *otf;
 #endif /* HAVE_LIBOTF */
+#ifdef HAVE_HARFBUZZ
+  hb_font_t *hb_font;
+#endif  /* HAVE_HARFBUZZ */
   FT_Size ft_size;
   int index;
   FT_Matrix matrix;
diff --git i/src/ftfont.c w/src/ftfont.c
index a645bbf029..ef4ccab3ec 100644
--- i/src/ftfont.c
+++ w/src/ftfont.c
@@ -56,8 +56,9 @@ struct ftfont_info
 {
   struct font font;
 #ifdef HAVE_LIBOTF
-  /* The following four members must be here in this order to be
-     compatible with struct xftfont_info (in xftfont.c).  */
+  /* The following members up to and including 'matrix' must be here in
+     this order to be compatible with struct xftfont_info (in
+     xftfont.c).  */
   bool maybe_otf;      /* Flag to tell if this may be OTF or not.  */
   OTF *otf;
 #endif /* HAVE_LIBOTF */



reply via email to

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