unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Cc: Khaled Hosny <dr.khaled.hosny@gmail.com>,
	Ebrahim Byagowi <ebraminio@gmail.com>,
	Behdad Esfahbod <behdad@behdad.org>, John Wiegley <johnw@gnu.org>,
	Mohammad Nasirifar <far.nasiri.m@gmail.com>,
	Kenichi Handa <handa@gnu.org>
Subject: Re: Emacs text shaping using Harfbuzz
Date: Thu, 13 Dec 2018 10:47:18 -0800	[thread overview]
Message-ID: <241e97ba-e547-9184-b798-1692be469740@cs.ucla.edu> (raw)
In-Reply-To: <83lg4tzba0.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 746 bytes --]

The Emacs harfbuzz branch built fine for me on Fedora 29 (no surprise). 
I saw no problems, not that I would catch many (the Arabic I saw 
displayed OK to me, but I don't read Arabic so am not the best person to 
judge).

One minor tweak proposed in the attached patch, for simplicity/clarity 
in the mainstream-Harbuzz code.

I see that Harbuzz is disabled by default by 'configure', and that 
there's an environment variable to disable it at runtime. I propose 
removing the environment variable, and enabling Harfbuzz by default at 
'configure' time (if the Harbuzz libraries are available), as I don't 
see much point in nudging users away from Harfbuzz.

I see there are some FIXMEs and suchlike comments. Will someone be 
working on them?


[-- Attachment #2: hb.diff --]
[-- Type: text/x-patch, Size: 1169 bytes --]

diff --git a/src/ftfont.c b/src/ftfont.c
index a645bbf029..47442df0e5 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -478,28 +478,27 @@ ftfont_get_otf (struct ftfont_info *ftfont_info)
 
 #ifdef HAVE_HARFBUZZ
 
-#ifndef HAVE_HB_FT_FONT_CREATE_REFERENCED
+# ifndef HAVE_HB_FT_FONT_CREATE_REFERENCED
 static void
 ft_face_destroy (void *data)
 {
-  FT_Done_Face ((FT_Face) data);
+  FT_Done_Face (data);
 }
-#endif
+
+static hb_font_t *
+hb_ft_font_create_referenced (FT_Face face)
+{
+  FT_Reference_Face (face);
+  return hb_ft_font_create (face, ft_face_destroy);
+}
+# endif
 
 static hb_font_t *
 ftfont_get_hb_font (struct ftfont_info *ftfont_info)
 {
   if (! ftfont_info->hb_font)
-    {
-      hb_font_t *hb_font;
-#ifdef HAVE_HB_FT_FONT_CREATE_REFERENCED
-      hb_font = hb_ft_font_create_referenced (ftfont_info->ft_size->face);
-#else
-      FT_Reference_Face (ftfont_info->ft_size->face);
-      hb_font = hb_ft_font_create (ftfont_info->ft_size->face, ft_face_destroy);
-#endif
-      ftfont_info->hb_font = hb_font;
-    }
+    ftfont_info->hb_font
+      = hb_ft_font_create_referenced (ftfont_info->ft_size->face);
   return ftfont_info->hb_font;
 }
 

  reply	other threads:[~2018-12-13 18:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13 15:39 Emacs text shaping using Harfbuzz Eli Zaretskii
2018-12-13 18:47 ` Paul Eggert [this message]
2018-12-13 19:31   ` Khaled Hosny
2018-12-13 19:48   ` Eli Zaretskii
2018-12-13 20:01     ` Eli Zaretskii
2018-12-13 20:23     ` Eli Zaretskii
2018-12-13 19:38 ` Kaushal Modi
2018-12-13 19:48   ` Paul Eggert
2018-12-13 19:55     ` Eli Zaretskii
2018-12-13 20:01     ` Kaushal Modi
2018-12-13 21:16 ` Richard Stallman
2018-12-13 21:43 ` Ken Brown
2018-12-13 23:23   ` Eric Abrahamsen
2018-12-14  0:55     ` Amin Bandali
2018-12-14  7:41       ` Eli Zaretskii
2018-12-14 14:40       ` Basil L. Contovounesios
2018-12-14 14:55         ` Eli Zaretskii
2018-12-14  7:40     ` Eli Zaretskii
2018-12-14  7:35   ` Eli Zaretskii
2018-12-14  1:11 ` Florian Beck
2018-12-14  2:35   ` Kaushal Modi
2018-12-14  7:46   ` Eli Zaretskii
2018-12-15  0:49     ` Paul Eggert
2018-12-16 14:09 ` Benjamin Riefenstahl
2018-12-16 15:27   ` Eli Zaretskii
2018-12-16 17:27 ` Mike Kupfer
2018-12-16 17:30   ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=241e97ba-e547-9184-b798-1692be469740@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=behdad@behdad.org \
    --cc=dr.khaled.hosny@gmail.com \
    --cc=ebraminio@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=far.nasiri.m@gmail.com \
    --cc=handa@gnu.org \
    --cc=johnw@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).