HarfBuzz text shaping engine
Go to file
Behdad Esfahbod 350f3a02ce [ft] Add hb_ft_face_create_referenced() and hb_ft_font_create_referenced()
When I originally wrote hb-ft, FreeType objects did not support reference
counting.  As such, hb_ft_face_create() and hb_ft_font_create() had a
"destroy" callback and client was responsible for making sure FT_Face is
kept around as long as the hb-font/face are alive.

However, since this was not clearly documented, some clienets didn't
correctly did that.  In particular, some clients assumed that it's safe
to destroy FT_Face and then hb_face_t.  This, indeed, used to work, until
45fd9424c7, which make face destroy access
font tables.

Now, I fixed that issue in 395b35903e since
the access was not needed, but the problem remains that not all clients
handle this correctly.  See:

  https://bugs.freedesktop.org/show_bug.cgi?id=86300

Fortunately, FT_Reference_Face() was added to FreeType in 2010, and so we
can use it now.  Originally I wanted to change hb_ft_face_create() and
hb_ft_font_create() to reference the face if destroy==NULL was passed in.
That would improve pretty much all clients, with little undesired effects.
Except that FreeType itself, when compiled with HarfBuzz support, calls
hb_ft_font_create() with destroy==NULL and saves the resulting hb-font on
the ft-face (why does it not free it immediately?).  Making hb-face
reference ft-face causes a cycling reference there.  At least, that's my
current understanding.

At any rate, a cleaner approach, even if it means all clients will need a
change, is to introduce brand new API.  Which this commit does.

Some comments added to hb-ft.h, hoping to make future clients make better
choices.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=75299
2014-12-28 17:59:28 -08:00
docs Rename HB_VERSION_CHECK and hb_version_check to "atleast" 2014-06-20 14:09:57 -04:00
m4 Add ax_pthread.m4 2012-10-02 14:46:34 -04:00
src [ft] Add hb_ft_face_create_referenced() and hb_ft_font_create_referenced() 2014-12-28 17:59:28 -08:00
test Fail blob creation if length overflows or is too large 2014-12-18 18:22:21 -08:00
util [util] Fix ansi output when surface is empty 2014-09-25 17:59:46 +03:00
.travis.yml [travis] Fix clang again 2014-10-01 18:58:43 -04:00
AUTHORS Add Roozbeh to AUTHORS 2014-07-01 15:51:54 -04:00
Android.mk [Android.mk] Actually remove static library 2014-07-11 18:15:34 -04:00
COPYING Improve license information 2012-10-28 21:26:19 -07:00
Makefile.am Use AM_MISSING_PROG for ragel and git 2014-03-04 13:03:51 -08:00
NEWS 0.9.37 2014-12-17 12:09:17 -08:00
README [travis] Minor 2014-10-01 17:57:43 -04:00
README.md Add README.md symlink to make github happy 2014-10-01 17:45:17 -04:00
THANKS Bump version to 0.9.2 2012-08-10 14:50:05 -04:00
TODO Revert "Round when scaling values" 2013-09-03 20:11:01 -04:00
autogen.sh One more fix for build without gtk-doc 2014-03-21 12:53:08 -07:00
configure.ac [ft] Add hb_ft_face_create_referenced() and hb_ft_font_create_referenced() 2014-12-28 17:59:28 -08:00
git.mk [git.mk] Update 2013-12-04 20:01:22 -05:00
harfbuzz.doap Minor 2011-05-27 04:14:42 -04:00

README.md

Build Status Coverage Status

This is HarfBuzz, a text shaping library.

For bug reports, mailing list, and other information please visit:

http://harfbuzz.org/

For license information, see the file COPYING.