Commit Graph

124 Commits

Author SHA1 Message Date
Ebrahim Byagowi f441a7c008 Don't allow reference blob be accessed using empty tag in hb_face_reference_table (#1947) 2019-08-31 16:48:09 -05:00
Behdad Esfahbod 27de7c44fe [config] Add HB_NO_FACE_COLLECT_UNICODES
Part of https://github.com/harfbuzz/harfbuzz/issues/1652
2019-06-19 20:07:02 -07:00
Behdad Esfahbod fa333e34d6 [vector] Remove static_array
Was good idea, but with C++ types with constructor/destructor, was getting in
the way as compiler was destructing those items where it was not desired.
Since C++ does not allow zero-sized arrays, just remove it...
2018-12-27 17:56:22 -05:00
Behdad Esfahbod 474a12058d [array/vector] Rename len to length 2018-12-21 18:53:01 -05:00
Behdad Esfahbod f1e95e40ed [arrays] Remove hb_supplier_t<> 2018-12-18 16:49:08 -05:00
Behdad Esfahbod f9417af29b [serialize] Propagate error from hb-face 2018-12-18 13:23:32 -05:00
Behdad Esfahbod cf39c24205 [arrays] Rename Supplier to hb_supplier_t 2018-12-17 22:36:23 -05:00
Ebrahim Byagowi e412008599 Remove redundant void from C++ sources (#1486) 2018-12-17 13:01:01 -05:00
Behdad Esfahbod 0d0fe9df46 [arrays] Remove need of stride in Supplier<> 2018-12-16 22:31:13 -05:00
Ebrahim Byagowi b2ebaa9afa Remove redundant 'inline' from methods (#1483) 2018-12-16 14:08:10 -05:00
Behdad Esfahbod fb05908213 Revert ugly fixes
Now that we have 6daf45e0, revert cryptic hacks...

This reverts commit abd81ed4f5.
This reverts commit 9c6921c08c.
This reverts commit d39760cabf.
This reverts commit fedd8e6c17.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-30 20:56:15 -05:00
Behdad Esfahbod abd81ed4f5 Umm. Cryptic, yes
In file included from hb-face.cc:35:
hb-ot-cmap-table.hh: In member function 'void OT::CmapSubtableFormat4::_compiles_assertion_on_line_388() const':
hb-ot-cmap-table.hh:388: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-open-type.hh:354: note: candidate 1: const Type& OT::UnsizedArrayOf<Type>::operator[](unsigned int) const [with Type = OT::IntType<short unsigned int, 2u>]
hb-ot-cmap-table.hh:388: note: candidate 2: operator[](const T*, int) <built-in>
hb-ot-cmap-table.hh: In member function 'void OT::CmapSubtableFormat4::_instance_assertion_on_line_388() const':
hb-ot-cmap-table.hh:388: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-open-type.hh:354: note: candidate 1: const Type& OT::UnsizedArrayOf<Type>::operator[](unsigned int) const [with Type = OT::IntType<short unsigned int, 2u>]
hb-ot-cmap-table.hh:388: note: candidate 2: operator[](const T*, int) <built-in>
hb-face.cc: In function 'hb_blob_t* _hb_face_builder_data_reference_blob(hb_face_builder_data_t*)':
hb-face.cc:650: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:650: note: candidate 2: operator[](T*, int) <built-in>
hb-face.cc:650: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:650: note: candidate 2: operator[](const T*, int) <built-in>
hb-face.cc:651: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:651: note: candidate 2: operator[](T*, int) <built-in>
hb-face.cc:651: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:651: note: candidate 2: operator[](const T*, int) <built-in>
2018-11-30 11:52:41 -05:00
Behdad Esfahbod 0f32c95e14 Fix a few more sizeof(vector[0]) errors with weird compilers 2018-11-30 11:31:39 -05:00
Behdad Esfahbod 96cf088980 [arrays] More 2018-11-24 09:48:06 -05:00
Behdad Esfahbod ce5da0f36a [shaper] Rewrite shaper data code to be more template-driven than macro-driven 2018-11-16 02:52:20 -05:00
Behdad Esfahbod fc44dea341 Use atomic ints for upem and num_glyphs on face 2018-11-13 11:54:33 -05:00
Behdad Esfahbod e88d47b7f2 Minor 2018-11-11 16:25:43 -05:00
Behdad Esfahbod 98c6f03ccd Minor 2018-11-11 15:54:20 -05:00
Behdad Esfahbod ea6d9b661f [ot-face] Remove a few ensures 2018-11-05 23:10:21 -05:00
Behdad Esfahbod 0fe7a745c9 [ot-face] Simplify more table access 2018-11-05 23:10:18 -05:00
Behdad Esfahbod 914b595f25 [ot-face] Include hb-ot-face directly in hb_face_t
Simplifying access coming next.
2018-11-05 23:10:12 -05:00
Behdad Esfahbod f6fc5574d3 Add pointer magic operators to hb_atomic_ptr_t 2018-11-05 13:23:54 -05:00
Behdad Esfahbod 5570c87f21 Port objects to use header.writable instead of immutable
Saves 4 or 8 bytes per object on 64bit archs.
2018-11-03 14:59:40 -04:00
Behdad Esfahbod cf5fa57f00 [docs] Change section titles again
I think I like the uniform "hb-*" more.
2018-10-27 04:51:42 -07:00
Behdad Esfahbod 5dd86aa33b [docs] Rename section titles to object names
More useful.
2018-10-27 04:47:41 -07:00
Behdad Esfahbod 00cf4e5eb6 [docs] Fill in some sections 2018-10-27 04:47:41 -07:00
Behdad Esfahbod 39bd07aed5 Fix bunch of unused parameter warnings
Show up with gcc -O0.

There's a few more but those are functions that need to be filled in.

Maybe this is a lost battle...
2018-10-26 21:22:26 -07:00
Behdad Esfahbod 341206eb60 [vector] Make hb_vector_t relocatable / nestable
Ugly, but...
Fixes https://github.com/harfbuzz/harfbuzz/issues/1227
2018-10-05 18:39:48 +02:00
HinTak bd1be8738f Missing colon for gobject annotation
There should be a colon separating "(transfer full)" and the rest. Warned by g-ir-scanner.
2018-10-03 15:31:26 +02:00
Behdad Esfahbod 90a0f9fa0c Make TSan happy with make_immutable() 2018-09-26 15:03:07 -04:00
Behdad Esfahbod 55bae6825e [docs] A few improvements
If we wrote just this much every day...
2018-09-24 10:43:06 -04:00
Behdad Esfahbod 9479ffefbf [dfont] Re-enable and fix offset handling
Fixes https://github.com/harfbuzz/harfbuzz/pull/1085
2018-09-11 16:41:26 +02:00
Behdad Esfahbod 54d332dd9b 1.9.0 2018-09-10 11:37:24 +02:00
Behdad Esfahbod a268068010 [ot-face] Remove tables_t. The face_data_t is what tables_t was 2018-08-26 15:18:46 -07:00
Behdad Esfahbod 3a0b3a29cc Free up hb-ot-face.hh from includes
There might be a better way to do this, but I couldn't find...
2018-08-26 15:11:24 -07:00
Behdad Esfahbod a84309afc8 [face] Use saved cmap in collect_unicodes() APIs 2018-08-26 09:33:01 -07:00
Behdad Esfahbod dae39c58fb [face] Introduce character-map API
New API:
+hb_face_collect_unicodes
+hb_face_collect_variation_selectors
+hb_face_collect_variation_unicodes
2018-08-25 22:44:39 -07:00
Behdad Esfahbod c77ae40852 Rename hb-*private.hh to hb-*.hh
Sorry for the noise, downstream custom builders.  Please adjust.
2018-08-25 22:36:36 -07:00
Behdad Esfahbod aadb2a9188 Add face-builder
New API:
+hb_face_builder_create
+hb_face_builder_add_table
2018-08-25 08:18:53 -07:00
Behdad Esfahbod 1f7380944d [atomic] Add hb_atomic_ptr_t<> and port all uses
Found and fixed a couple bugs.

Found a couple multithreading issues.  Marked them with "XXX-MT-bug".
2018-08-09 00:27:01 -07:00
Behdad Esfahbod 3506672ce9 Port _nil objects to Null() machinery
Finally, unified!
2018-08-06 06:17:48 -07:00
Behdad Esfahbod 443de26fa5 Minor 2018-08-02 01:43:02 -07:00
Behdad Esfahbod ed7b2e58fc Remove OT namespace from hb-machinery-private.hh 2018-08-02 00:08:08 -07:00
Behdad Esfahbod 16ccfafbbd [face] Sprinkle const in the API 2018-08-01 22:50:06 -07:00
Behdad Esfahbod c6bc7c3831 Set num glyphs on sanitizer reference_table()
Move out-of-class definitions of two methods to hb-static so they
are accessible in libharfbuzz-subset.
2018-07-23 11:46:46 -07:00
Behdad Esfahbod 8e3e41272b Port rest of code away from Sanitizer<> 2018-07-22 22:49:26 -07:00
Behdad Esfahbod 9583e0077d Port more off of Sanitizer<> 2018-07-22 22:43:25 -07:00
Behdad Esfahbod 1e9e344b2b Fix hb_face_count() sanitize referencing 2018-07-17 19:17:59 +02:00
prrace 498e4373dc Fix SunStudio 12.6 build (#1053) 2018-06-10 03:34:28 +04:30
Behdad Esfahbod df01f3e560 1.7.7 2018-06-05 15:18:16 -07:00
Ebrahim Byagowi 8220ef8a54
Fix hb_face_count build issue
I should've rebased #1002 before the merge, my bad
2018-06-05 22:50:53 +04:30
Ebrahim Byagowi 32da0c6bc4
Add hb_face_count, a new API (#1002)
Simply, it returns the number of faces on a font blob.

To be used on hb-sanitizer tool but other clients also
can benefit from it.
2018-06-05 18:56:26 +04:30
Behdad Esfahbod eba1c16a60 Always lock blob in sanitize. Remove blob->lock_as() in favor of blob->lock() 2018-05-08 02:47:42 -07:00
Behdad Esfahbod b4fa505014 Move Sanitizer::lock_instance<>() to blob->lock_as<>(). 2018-05-08 02:45:08 -07:00
Behdad Esfahbod 470fe5b603 [aat] Implement Lookup table
Untested, but compiles.
2018-01-10 02:50:49 +01:00
Behdad Esfahbod dbdbfe3d7b Use nullptr instead of NULL 2017-10-15 12:11:08 +02:00
Behdad Esfahbod 94b3cafc3a Add hb_face_get_table_tags()
New API:
hb_face_get_table_tags()

Fixes https://github.com/behdad/harfbuzz/issues/560
2017-10-11 17:22:44 +02:00
Behdad Esfahbod e1b6d92302 Remove cast of functions to (hb_destroy_func_t)
Fixes https://github.com/behdad/harfbuzz/issues/474
2017-10-11 15:51:31 +02:00
Behdad Esfahbod c0c2dbc871 Remove dirty tracking
Turns out I don't need this to resolve CoreText optical sizing
issue after all.

https://github.com/behdad/harfbuzz/issues/360
2017-10-11 12:23:35 +02:00
Behdad Esfahbod 587f15ece3 Minor 2017-08-14 15:23:10 -07:00
Behdad Esfahbod d3d3691806 Add dirty-state tracking to hb_face_t 2017-02-03 15:42:03 -08:00
Behdad Esfahbod 113393efec Remove a few unused includes 2017-01-21 15:12:03 -08:00
Behdad Esfahbod 333173103b Fix sign of shift operators
This one:

  map->mask = (1 << (next_bit + bits_needed)) - (1 << next_bit);

before the fix, the shift was done as an int, causing overflow
if it ever got to 1 << 31.  Sprinkle 'u's around.

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=634805
2016-08-08 17:28:14 -07:00
Behdad Esfahbod a5efaac4ff Replace a couple of malloc()s with calloc() 2015-10-02 08:02:29 +01:00
Behdad Esfahbod 5d74ff02ab Fix Since: version tags on font and face APIs
A while back we marked every API as version:1.0.  We should fix them all
to reflect real version they were introduced.  This is a start.

Patch from Nikolay Sivov.
2015-09-03 14:55:59 +04:30
Sascha Brawer 01c3a88543 Fix "Since:" tags
Based on data from http://upstream-tracker.org/versions/harfbuzz.html
Resolves #103
2015-06-01 13:25:27 +02:00
Behdad Esfahbod eb0bf3ae66 Relax inert checks
Previously, when creating an object from inert inputs (eg:
"hb_font_create(hb_face_get_empty())") we returned the inert
empty object.  This is not helpful as there are legitimate
usecases to do that.

We now never return the inert object unless allocation failed.

Tests are revised to reflect.
2015-04-09 19:16:57 -07:00
Behdad Esfahbod 3f310dc0ca Disallow changing settings on immutable face
Ouch!
2014-07-22 16:26:27 -04:00
Behdad Esfahbod 2a8c49ade0 Remove unnecessary includes 2013-12-11 20:24:20 -05:00
Behdad Esfahbod ace5c7eb4c [introspection] hb-ft annotations 2013-09-13 20:35:19 -04:00
Behdad Esfahbod a8949df487 [introspection] Annotate Unicode / font callbacks
Should move these out of the public header...

We're "clean" of introspection warnings now.  Remaining ones are about
graphite2 / freetype types not being introspectable.
2013-09-13 20:31:07 -04:00
Behdad Esfahbod 085d4291a9 [introspection] Disable constructors for now
Since our types are not associated with their methods, marking
constructors makes them inaccessible from bindings.  Undo for now.
2013-09-12 17:14:33 -04:00
Behdad Esfahbod 288f289997 [docs/introspection] More annotations 2013-09-06 17:30:54 -04:00
Behdad Esfahbod 2e3a07abdf Separate face source code from font
Makes documentation / introspection easier.
2013-08-27 11:46:08 -04:00