Commit Graph

81 Commits

Author SHA1 Message Date
Khaled Hosny fb192c263e [docs] A bit more buffers documentation 2015-12-30 17:59:01 +04:00
Khaled Hosny 8ab797c5b8 [docs] A bit more buffers documentation 2015-12-30 17:59:01 +04:00
Behdad Esfahbod 0475ef2f97 [buffer] Add debugging, aka, message, API
Currently just announces lookup applications.  Message-API *will* change.
hb-shape / hb-view are updated to print-out messages to stder if --debug
is specified.
2015-12-18 19:29:06 +00: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 b8811429b6 Fix Since tags
Fixes https://github.com/behdad/harfbuzz/issues/103
2015-09-03 15:53:22 +04:30
Behdad Esfahbod fdd1770e00 Add API/cmdline to show glyph extents when serializing buffer
New API: HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS

hb-shape now accepts --show-extents.

Patch from Simon Cozens.
2015-08-24 13:49:55 +01:00
Behdad Esfahbod 376d587f36 Implement more granular cluster-merging
TODO: Documentation.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71445
2015-07-22 16:51:12 +01:00
Behdad Esfahbod 81bedda58c New API: hb_buffer_reverse_range() 2015-04-30 13:04:16 -04:00
Behdad Esfahbod 61820bc4ca [API] Add hb_buffer_add_latin1()
This is by no ways to promote non-Unicode encodings.  This is an entry
point that takes Unicode codepoints that happen to all be the first
256 characters and hence fit in 8bit strings.  This is useful eg in Chrome
where strings that can fit in 8bit are implemented that way, and this
avoids copying into UTF-8 or UTF-16.

Perhaps we should rename this to hb_buffer_add_codepoints8().  I'm also
curious if anyone would be really interested in hb_buffer_add_codepoints16().

Please discuss!
2015-01-26 14:25:52 -08:00
Behdad Esfahbod 976c8f4552 New API: hb_buffer_[sg]et_replacement_codepoint()
With this change, we now by default replace broken UTF-8/16/32 bits
with U+FFFD.  This can be changed by calling new API on the buffer.
Previously the replacement value used to be (hb_codepoint_t)-1.

Note that hb_buffer_clear_contents() does NOT reset the replacement
character.

See discussion here:

6f13b6d62d

New API:

  hb_buffer_set_replacement_codepoint()
  hb_buffer_get_replacement_codepoint()
2014-07-16 15:34:20 -04:00
Behdad Esfahbod bcba8b4502 New API hb_buffer_add_codepoints()
Like hb_buffer_add_utf32, but doesn't do any Unicode validation.
This is like what hb_buffer_add_utf32 used to be until a couple
commits ago.
2014-07-16 14:59:04 -04:00
Behdad Esfahbod 11fb16cb84 Use unsigned enums for mask types 2013-10-18 11:21:11 +02:00
Behdad Esfahbod 4dc798de19 Add hb-deprecated.h, and rename a couple enum values
Add deprecated alias for old name.
2013-08-27 11:46:08 -04:00
Behdad Esfahbod 847794e929 [buffer] Implement buffer deserialization for format=text
Using a ragel machine.
2013-02-27 18:49:18 -05:00
Behdad Esfahbod e54dd26300 [buffer] Start implementing buffer deserialization 2013-02-27 18:49:13 -05:00
Behdad Esfahbod bcc8f32b4c [buffer] Minor 2013-02-27 18:49:10 -05:00
Behdad Esfahbod 1172dc7362 Rename hb_buffer_clear() to hb_buffer_clear_contents()
The previous name was clashing with harfbuzz.old.  There are systems
that need to link both...

Clash-free now again.
2013-01-07 16:46:37 -06:00
Behdad Esfahbod 3f82f8ff07 Rename hb_buffer_guess_properties() to hb_buffer_guess_segment_properties() 2012-11-15 18:48:10 -08:00
Behdad Esfahbod f30641038b Bunch of independent changes (ouch)
API additions:

	hb_segment_properties_t
	HB_SEGMENT_PROPERTIES_DEFAULT
	hb_segment_properties_equal()
	hb_segment_properties_hash()

	hb_buffer_set_segment_properties()
	hb_buffer_get_segment_properties()

	hb_ot_layout_glyph_class_t

	hb_shape_plan_t
	hb_shape_plan_create()
	hb_shape_plan_create_cached()
	hb_shape_plan_get_empty()
	hb_shape_plan_reference()
	hb_shape_plan_destroy()
	hb_shape_plan_set_user_data()
	hb_shape_plan_get_user_data()
	hb_shape_plan_execute()

	hb_ot_shape_plan_collect_lookups()

API changes:

	Rename hb_ot_layout_feature_get_lookup_indexes() to
	hb_ot_layout_feature_get_lookups().

New header file:

	hb-shape-plan.h

And a bunch of prototyped but not implemented stuff.  Coming soon.
(Tests fail because of the prototypes right now.)
2012-11-15 18:48:10 -08:00
Behdad Esfahbod c54599ad26 Minor 2012-11-15 16:14:39 -08:00
Behdad Esfahbod 072ae7a982 Add hb_buffer_serialize_list_formats() 2012-11-15 13:14:12 -08:00
Behdad Esfahbod f9edf16725 Add buffer serialization / deserialization API
Two output formats for now: TEXT, and JSON.  For example:

  hb-shape --output-format=json

Deserialization API is added, but not implemented yet.
2012-11-15 13:10:07 -08:00
Behdad Esfahbod 92f9bfed42 Minor 2012-11-13 16:50:45 -08:00
Behdad Esfahbod 66ac2ff32e API change: Remove "mask" from hb_buffer_add()
I don't expect anybody using hb_buffer_add(), so this shouldn't break
anyone's code.
2012-11-13 16:26:32 -08:00
Behdad Esfahbod 0c7df22228 Add buffer flags
New API:

	hb_buffer_flags_t

	HB_BUFFER_FLAGS_DEFAULT
	HB_BUFFER_FLAG_BOT
	HB_BUFFER_FLAG_EOT
	HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES

	hb_buffer_set_flags()
	hb_buffer_get_flags()

We use the BOT flag to decide whether to insert dottedcircle if the
first char in the buffer is a combining mark.

The PRESERVE_DEFAULT_IGNORABLES flag prevents removal of characters like
ZWNJ/ZWJ/...
2012-11-13 14:42:35 -08:00
Behdad Esfahbod 82ecaff736 Add hb_buffer_clear()
Which is like _reset(), but does NOT clear unicode-funcs.
2012-11-13 14:10:00 -08:00
Behdad Esfahbod 05207a79e0 [buffer] Save pre/post textual context
To be used for a variety of purposes.  We save up to five characters
in each direction.  No public API changes, everything is taken care
of already.  All clients need to do is to call hb_buffer_add_utf* with
the full text + segment info (or at least some context) instead of
just passing in the segment.

Various operations (hb_buffer_reset, hb_buffer_set_length,
hb_buffer_add*) automatically reset the relevant contexts.
2012-09-25 21:32:21 -04:00
Behdad Esfahbod 96fdc04e5c Add hb_buffer_[sg]et_content_type
And hb_buffer_content_type_t and enum values.
2012-09-06 22:30:53 -04:00
Behdad Esfahbod 560d68af81 Use a export-file for Windows builds
Apparently even that doesn't make check-internal-symbols.sh happy with
mingw32.  Going to disable that for DLLs again, but hopefully the
export-file is doing *something*.
2012-08-08 17:16:01 -04:00
Behdad Esfahbod 39b17837b4 Add hb_buffer_normalize_glyphs() and hb-shape --normalize-glyphs
This reorders glyphs within the cluster to a nominal order.  This should
have no visible effect on the output, but helps with testing, for
getting the same hb-shape output for visually-equal glyphs for each
cluster.
2012-07-17 17:09:29 -04:00
Behdad Esfahbod 1bc1cb3603 Make source more digestable for gobject-introspection 2012-06-16 15:21:55 -04:00
Behdad Esfahbod 0594a24484 Cleanup TRUE/FALSE vs true/false 2012-06-05 20:35:40 -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 e6c09cdf43 Remove the pre_allocate argument from hb_buffer_create()
For two reasons:

1. User can always call hb_buffer_pre_allocate() themselves, and

2. Now we do a pre_alloc in add_utfX anyway, so the total number of
reallocs is limited to a small number (~3) anyway.  This just makes the
API cleaner.
2011-08-19 19:20:26 +02: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 944b2ba1ce [buffer] Make API take signed int length
Since we already switched to accepting -1 as 'zero-terminated'.
2011-08-09 00:23:58 +02:00
Behdad Esfahbod 02aeca985b [API] Changes to main shape API
hb_shape() now accepts a shaper_options and a shaper_list argument.
Both can be set to NULL to emulate previous API.  And in most situations
they are expected to be set to NULL.

hb_shape() also returns a boolean for now.  If shaper_list is NULL, the
return value can be ignored.

shaper_options is ignored for now, but otherwise it should be a
NULL-terminated list of strings.

shaper_list is a NULL-terminated list of strings.  Currently recognized
strings are "ot" for native OpenType Layout implementation, "uniscribe"
for the Uniscribe backend, and "fallback" for the non-complex backend
(that will be implemented shortly).  The fallback backend never fails.

The env var HB_SHAPER_LIST is also parsed and honored.  It's a
colon-separated list of shaper names.  The fallback shaper is invoked if
none of the env-listed shapers succeed.

New API hb_buffer_guess_properties() added.
2011-08-04 22:38:09 -04:00
Behdad Esfahbod 80a6833b03 [API] Add hb_*_get_empty() for all objects 2011-05-11 18:21:58 -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 f85faee9b3 [API] Rename hb_buffer_add_glyph() to hb_buffer_add() 2011-04-19 00:38:01 -04:00
Behdad Esfahbod aab0de50e2 [API] Add hb_buffer_allocation_successful()
Returns the error status of the buffer.
2011-04-19 00:32:19 -04:00
Ryan Lortie 02a534b23f [API] Rename hb_buffer_ensure() to hb_buffer_pre_allocate()
The new name is self-documenting.
2011-04-19 00:05:43 -04:00
Ryan Lortie 70566befc5 [API} hb_buffer_get_glyph_{infos,positions}: Add length out parameter
Return the length, whenever we return an array.  Makes it easier on the
language bindings.
2011-04-19 00:03:44 -04:00
Behdad Esfahbod b54cd07b26 Mark internal buffer variables private 2011-04-15 19:12:01 -04:00
Behdad Esfahbod 8f0d7e0c3f Remove hb_buffer_clear_positions(), add hb_ot_layout_position_start() 2011-04-15 19:08:43 -04:00
Behdad Esfahbod 2fc56edff6 [API] Remove hb_buffer_clear()
One should use hb_buffer_reset() really.
2011-04-15 19:08:38 -04:00
Behdad Esfahbod c910bec863 Add hb_buffer_reset() and hb_buffer_set_length() 2011-04-13 15:49:06 -04:00
Behdad Esfahbod 8e4bb3cacc Fold hb-language.[ch] into hb-common.[ch] 2011-04-11 17:55:58 -04:00