Commit Graph

96 Commits

Author SHA1 Message Date
Khaled Hosny 0b22da9541 Improve HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES docs
Add the note about absolute glyph positions from the commit message.
2018-01-10 07:12:07 +02:00
Behdad Esfahbod 3b1e97f364 Add HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES
New API:
HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES
hb-shape / hb-view --remove-default-ignorables

One more text-rendering-tests test passing.  Eleven failing.
2018-01-10 03:36:03 +01:00
Behdad Esfahbod 71fd6325b6 Add option to buffer serialization to not output glyph advances
When advances are not printed, glyph offsets reflect absolute glyph
positions.

New API:
HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES
hb-shape --no-advances
2018-01-10 02:50:49 +01:00
Behdad Esfahbod fbb937b680 Don't use NULL in public headers 2017-10-15 12:04:16 +02:00
fanc999 48a9406839 Fix build of HarfBuzz tools and HarfBuzz-GObject on Visual Studio (#555)
* hb-buffer.h: Mark hb_buffer_diff() for export

This will fix the tools builds on Visual Studio, as the symbol is used
by the tools.

* build: Adapt NMake Makefiles for GLib 2.53.4 or later

glib-mkenums was ported from a PERL script to a Python script, so we
need to update how we generate the enum sources for HarfBuzz-GObject in
the NMake builds.  Let this be known in the build documentation for MSVC
builds.

One of the problems with the underlying cmd.exe that the NMake Makefiles
run on is that shebang lines are not recognized, so we need to to test
run the script with Python and see whether it succeeded by outputing a
source file that is larger than 0 in file size (since running the PERL
version of the script will clearly fail and cause an empty file to be
created).

If it succeeds, we then run a small Python utility script that makes the
necessary string replacements, and we are done.  If that fails, then we
run the glib-mkenums script with PERL, and do the replacements with the
PERL one-liners as we did before.

We need to make replace.py use latin-1 encoding when using Python 3.x to
cope with the copyright sign that is in the generated enum sources.
2017-10-07 12:57:14 +02:00
Behdad Esfahbod d03f11f246 Fix buffer_diff for empty buffers
If buffers are empty, content type should be ignored.

This fixes last of the failing tests: fuzzed.tests.  Green again!
2017-09-04 20:14:13 -07:00
Behdad Esfahbod b2dd0c1c32 Add hb_glyph_info_get_glyph_flags()
New API.
2017-08-23 13:12:54 -07:00
Behdad Esfahbod 3e8f4f1452 Rename HB_BUFFER_DIFF_FLAG_MASK_MISMATCH to HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH 2017-08-22 17:56:25 -07:00
Behdad Esfahbod 338e61ad1b Fix typo 2017-08-14 12:36:38 -07:00
Jonathan Kew 331d66c7fe Add function to compare two buffers
Based on patch from Jonathan Kew.

Needs more cleaning up and documentation.

New API:
hb_buffer_diff_flags_t
hb_buffer_diff()
2017-08-14 11:44:12 -07:00
Behdad Esfahbod 39a9749430 New API: hb_buffer_append() 2017-08-11 15:52:06 -07:00
Behdad Esfahbod 5287ccc935 [unsafe-to-break] Allocate public bits from 0 2017-08-10 15:02:34 -07:00
Behdad Esfahbod 40bd7e9a1c [unsafe-to-break] Add UNSAFE_TO_BREAK flag
Not all shapers code is updated to set this properly.
GSUB and Arabic shaper are updated.
GPOS and other shapers are NOT.

Fixes https://github.com/behdad/harfbuzz/issues/224
2017-08-10 15:02:28 -07:00
Behdad Esfahbod 97624d9244 [docs] Minor fixes. 2016-01-11 12:58:45 +00:00
Khaled Hosny 9ab9f974d4 [docs] More buffers documentation 2016-01-01 20:38:21 +04:00
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