Commit Graph

30 Commits

Author SHA1 Message Date
Ebrahim Byagowi
ce17340b23 Add hb_blob_create_from_file, a new API (#926) 2018-04-20 07:59:06 +02:00
Behdad Esfahbod
a989f3edec Add hb_blob_copy_writable_or_fail()
New API:
- hb_blob_copy_writable_or_fail()
2018-02-13 22:12:36 -08:00
Bruce Mitchener
19a93fcf19 Fix typos. 2018-01-21 10:33:54 -08:00
Chun-wei Fan
835bbdc7c9 Public headers: Decorate public symbols with HB_EXTERN
This prepares the headers for exporting symbols using visibility
attributes or __declspec(dllexport), so that we do not need to maintain
symbols listing files, as this is what was and is done in GLib and GTK+.
2015-11-23 11:03:11 +08:00
Behdad Esfahbod
1a8ffc5129 Minor 2014-05-13 21:06:39 -04:00
Behdad Esfahbod
110ec0714a Typo 2014-04-08 17:32:08 -07:00
Behdad Esfahbod
c3ba49b6fa Always create sub-blobs in MEMORY_MODE_READONLY
This fixes a design bug with sanitize and sub-blobs that can
cause crashes.  Jonathan and I found and debugged this issue
when we tested a corrupt font with the md5sum / filename:
ea395483d37af0cb933f40689ff7b60a.  Two hours of intense
debugging we found out that the font has overlapping GSUB/GPOS
tables, and as such, sanitizing the second table can modify
the first one, which can cause all kinds of undefined behavior.

The correct way to fix this is to make sure sub-blobs are
always created readonly, since we consider the parent blob
to be a shared resource and can't modify it, even if it *is*
writable.

This essentially makes the READONLY_MAY_MAKE_WRITABLE mode
unused...  Maybe we should simply remove / deprecate it.
2013-02-25 17:06:35 -05:00
Behdad Esfahbod
1bc1cb3603 Make source more digestable for gobject-introspection 2012-06-16 15:21:55 -04:00
Behdad Esfahbod
5e88aa6682 Remove public enum names again
As was reported to me, glib-mkenum does not understand named enums,
so remove for now.
2012-04-14 18:51:50 -04:00
Behdad Esfahbod
c6035cf802 Add names to enums
gdb was showing <anonymous enum> instead of useful stuff, so name
all our enums.
2012-04-12 13:23:59 -04:00
Behdad Esfahbod
d1c9eb458c Make it an error to include non-top-level headers
Users should #include <hb.h> (or hb-ft.h, hb-glib.h, etc), but
never things like hb-shape.h directly.  This makes it easier to
refactor headers later on without breaking compatibility.
2012-04-12 13:17:44 -04:00
Behdad Esfahbod
33ccc77902 [API] Make set_user_data() functions take a replace parameter
We need this to set data on objects safely without worrying that some
other thread unsets it by setting it at the same time.
2011-08-09 00:43:24 +02:00
Behdad Esfahbod
1c9f8717eb [API] Simplify blob API, remove lock 2011-05-06 22:59:42 -04:00
Behdad Esfahbod
a0f337a1cc Remove unused hb_blob_try_writable_inplace() 2011-05-06 19:20:52 -04:00
Behdad Esfahbod
4911062d5b [API] Rename hb_blob_create_empty() to hb_blob_get_empty() 2011-05-02 19:36:39 -04:00
Behdad Esfahbod
5fa849b77d [API] Add _set/get_user_data() for all objects 2011-04-27 21:46:01 -04:00
Behdad Esfahbod
2409d5f8d7 Update Copyright headers 2011-04-21 17:14:28 -04:00
Behdad Esfahbod
af02933739 [API] Remove hb_*_get_reference_count()
This was a bizzare piece of API that I inherited from cairo.  It has
been wrong adding them to cairo in the first place.  Remove them before
someone uses them!
2011-04-20 15:49:31 -04:00
Behdad Esfahbod
e5847f75fb [API] blob: move user_data before destroy()
This is the common convention for language binding tools.
2011-04-20 02:59:28 -04:00
Behdad Esfahbod
acdba3f90b Prefer C linkage 2010-07-23 15:39:27 -04:00
Behdad Esfahbod
c755cb3e3a Change header comment 2010-04-22 00:11:43 -04:00
Behdad Esfahbod
388ad037ff [HB] Remove HB_MEMORY_MODE_READONLY_NEVER_DUPLICATE
Unlike the rest of the memory-mode enum, this one didn't only
describe the access mode of the input memory region.  Remove it.

If someone wants to inhibit duplicating, they can lock the blob
and throw away the key.

Based on mailing list discussion with Carl Worth.
2009-11-02 14:40:46 -05:00
Behdad Esfahbod
977eeb7144 [HB] s/writeable/writable/g 2009-11-02 14:40:46 -05:00
Behdad Esfahbod
864e2560b6 [HB] Fix pedantic warnings 2009-11-02 14:40:45 -05:00
Behdad Esfahbod
fc6c94002d [HB] Simplify sub-blob support 2009-11-02 14:40:27 -05:00
Behdad Esfahbod
a26442437a [HB] Add sub-blobs 2009-11-02 14:40:27 -05:00
Behdad Esfahbod
0cc7bc59ea [HB] Move typedef's around 2009-11-02 14:40:25 -05:00
Behdad Esfahbod
a12dd324a3 [HB] Add get_reference_count() 2009-11-02 14:40:25 -05:00
Behdad Esfahbod
0090dc0f67 [HB] Remove hinting setting and use ppem==0 to mean "no hinting" 2009-11-02 14:40:24 -05:00
Behdad Esfahbod
f0954d1e08 [HB] Add a "blob" manager 2009-11-02 14:40:24 -05:00