Commit Graph

139 Commits

Author SHA1 Message Date
Behdad Esfahbod b8811429b6 Fix Since tags
Fixes https://github.com/behdad/harfbuzz/issues/103
2015-09-03 15:53:22 +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 be66ec5373 Use TRUE/FALSE instead of true/false in docs 2015-04-30 18:27:13 -04:00
Khaled Hosny d055e1fc78 Some attempt into initial hb-shape documentation
Very anaemic, needs to descripe the format understood by
hb_feature_from_string() etc., but it is just start.
2015-04-30 18:24:45 -04:00
Khaled Hosny a394bb6670 [bindings] Fix *_from_string functions
Without the element-type they will be getting garbage, at least with
Python.
2015-03-22 20:29:10 +02:00
Behdad Esfahbod b91904a40d [bindings] Replace deprecated allow-none with optional and nullable 2015-01-06 15:43:14 -08:00
Chris Peterson fb85d618f5 Add #ifdef HB_USE_ATEXIT to fix -Wunused-function warnings 2015-01-04 19:31:10 -08:00
Behdad Esfahbod 38fb30d742 Use atexit() only if it's safe to call from shared library
Apparently they are not (advertised as?) safe on BSD systems.
We ignore the case of static libraries.

Whitelisted on glibc, Android, and MSVC / mingw.

https://bugs.freedesktop.org/show_bug.cgi?id=82246
2014-08-06 13:34:49 -04:00
Behdad Esfahbod 6e69200a2a Fix snprintf() format
Patch from Maks Naumov.
Fixes https://github.com/behdad/harfbuzz/pull/22
2014-07-25 12:30:47 -04:00
Behdad Esfahbod 5c5cdbbdf8 Make sure broken feature strings are not partially parsed
If user doesn't check hb_feature_from_string() return value, we
don't want them to end up see the partially-parsed feature.
2014-07-25 12:21:49 -04:00
Behdad Esfahbod a795fe6378 Allow quotation marks around feature tag in hb_feature_from_string()
With this, I believe we accept CSS feature strings completely.
2014-07-25 12:15:49 -04:00
Behdad Esfahbod 3f64618474 Allow space at the end of feature string with values, eg 'dlig=1 ' 2014-07-25 12:13:19 -04:00
Behdad Esfahbod f31f7d2259 Minor 2014-07-25 12:13:19 -04:00
Behdad Esfahbod 60cb18a5de Allow on/off in hb_feature_from_string()
We now allow things like "dlig on" / "dlig=on".
2014-07-25 12:13:16 -04:00
Behdad Esfahbod d9e618eca9 Remove duplicate definition of ISALNUM
It's defined in hb-private.h already.
2014-07-25 12:02:26 -04:00
Behdad Esfahbod 2ee5f665de Fix parsing of features like "- liga" (with the space) 2014-07-25 12:02:22 -04:00
Behdad Esfahbod e15fa7a8cf Do not require the '=' in hb_feature_from_string()
Towards accepting CSS font-feature-settings strings.
2014-07-25 11:46:28 -04:00
Behdad Esfahbod f4fe9baefd Reject tags longer than 4 chars in hb_feature_from_string() 2014-07-25 11:39:55 -04:00
Behdad Esfahbod 288f289997 [docs/introspection] More annotations 2013-09-06 17:30:54 -04:00
Behdad Esfahbod 38b8b40526 Fix possible snprintf OOM
https://bugzilla.redhat.com/show_bug.cgi?id=1001645
2013-08-27 11:46:07 -04:00
Behdad Esfahbod 7235f33f9e Fix misc warnings reported by cppcheck
https://bugs.freedesktop.org/show_bug.cgi?id=65544
2013-06-10 15:08:49 -04:00
Behdad Esfahbod 20b817ac21 [buffer] Implement buffer deserialization for format=json
Using a ragel machine.
2013-02-27 18:49:18 -05: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 8da5111269 Minor 2013-02-27 18:49:05 -05:00
Behdad Esfahbod c462b32dcb Disable automatic segment properties guessing
Before, if one called hb_shape() without setting script, language, and
direction on the buffer, hb_shape() was calling
hb_buffer_guess_segment_properties() on the user's behalf to guess
these.

This is very dangerous, since any serious user of HarfBuzz must set
these properly (specially important is direction).  So now, we don't
guess properties by default.  People not setting direction will get
an abort() now.  If the old behavior is desired (fragile, good for
simple testing only), users can call
hb_buffer_guess_segment_properties() on the buffer just before calling
hb_shape().
2013-02-15 07:51:47 -05:00
Behdad Esfahbod e9171af55c Bug 60053 - hb-common.cc:181:6: warning: ‘void free_langs()’ defined but not used 2013-01-29 22:45:00 -05: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 1c7e55511a Minor fix
Ouch
2012-11-13 14:42:22 -08: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 e30ebd2794 Add hb_feature_to/from_string() 2012-09-06 22:09:06 -04:00
Behdad Esfahbod 5393e3a62b [OT] Minor refactoring 2012-08-02 09:24:35 -04:00
Behdad Esfahbod a8842e4a44 Remove some TODO items 2012-07-31 23:17:23 -04:00
Behdad Esfahbod 2f87cebe10 Implement shape_plan caching
Should give us some performance boost.
2012-07-27 04:20:39 -04:00
Behdad Esfahbod b6b7ba1313 Switch old and uniscribe backends to shape_plan 2012-07-27 01:37:18 -04:00
Behdad Esfahbod c32c096a42 Switch to shape_plan
Not optimized yet.  Eats babies.  And no shaper uses the shape_plan.
2012-07-27 01:13:53 -04:00
Behdad Esfahbod 5b95c148cc Start implementing shape_plan 2012-07-27 01:02:24 -04:00
Behdad Esfahbod bd26b4d21f Minor 2012-07-26 22:18:24 -04:00
Behdad Esfahbod 027857d041 Start adding a unified shaper access infrastructure
Add global shape_plan.  Unused so far.
2012-07-26 21:14:02 -04:00
Behdad Esfahbod 8fe4c7405b [hb-old] Add HarfBuzz.old shaper
Choose using shaper name "old".
2012-07-25 11:11:22 -04:00
Jonathan Kew aa6d849838 [CoreText] Add basic Core Text backend for comparison with our native shaping
Does not attempt to handle clusters in a Uniscribe- or HarfBuzz-compatible way;
just returns the original string indexes that CT maintains. These may even be
out-of-order in the case of reordrant glyphs.
2012-07-24 15:52:32 -04:00
Behdad Esfahbod 97aa0b738a Minor const correctness shuffling 2012-07-24 15:02:34 -04:00
Behdad Esfahbod 6095de1635 Fix clang warning with NO_MT path 2012-06-07 15:48:18 -04:00
Behdad Esfahbod 0594a24484 Cleanup TRUE/FALSE vs true/false 2012-06-05 20:35:40 -04:00
Behdad Esfahbod f64b2ebf82 Remove last static initializer
We're free!  Lazy or immediate...
2012-06-05 20:15:27 -04:00
Behdad Esfahbod a5e40542ab Make font immutable in hb_shape() 2012-04-17 12:37:19 -04:00
Behdad Esfahbod 6bd9b479b8 Hide backend-specific shape functions
Also remove shaper_options argument to hb_shape_full().  That was
unused and for "future".  Let it go.

More shaper API coming in preparation for plan/planned API.
2012-04-12 14:53:53 -04:00
Behdad Esfahbod cd2b901027 [graphite] Minor 2011-08-24 01:48:03 +02:00
Behdad Esfahbod 1f49cf32c9 Add graphite2 integration from Martin Hosken
To be modified, a lot.
2011-08-24 01:32:41 +02:00
Behdad Esfahbod 0501573ded Fix const correctness in the API 2011-08-10 16:25:56 +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 670c873499 Fix shaper ordering logic 2011-08-08 21:36:24 +02:00
Behdad Esfahbod cc797e0d53 Minor 2011-08-08 03:50:38 +02:00
Behdad Esfahbod ff199ba356 Fix shaper_list manipulation, aaaaaaaaaaaaargh 2011-08-07 03:43:46 -04:00
Behdad Esfahbod 9da554504e Add hb_shape_list_shapers() 2011-08-05 19:59:02 -04:00
Behdad Esfahbod c62a8f10f3 Free all static memory upon exit 2011-08-05 19:59:02 -04:00
Behdad Esfahbod c4d63ef744 Fix env parsing code
Also changed the separator to comma instead of colon.
2011-08-05 19:59:02 -04:00
Behdad Esfahbod 3ca6c4ecc2 Change hb_shape() API back to what it was, add hb_shape_full()
I disliked changing hb_shape() API, and disliked the fact that it was
returning a bool now.  So, reverted.  Added new API for the extra
functionality.
2011-08-05 17:22:19 -04: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 c605bbbb6d Remove C++ guards from source files
Where causing issues for people with MSVC.
2011-08-04 20:00:53 -04:00
Behdad Esfahbod c4641723fb [API] Add compose() and decompose() unicode funcs, rename other ones
Add compose() and decompose() unicode funcs.  These implement
pair-wise canonical composition/decomposition.

The glib/icu implementations are lacking for now.  We are adding
API for this to glib, but I cannot find any useful API in ICU.
May end of implementing these in-house.

Changed all unicode_funcs callback names to remove the "_get" part.
Eg, hb_unicode_get_script_func_t is now hb_unicode_script_func_t,
and hb_unicode_get_script() is hb_unicode_script() now.
2011-07-08 00:09:31 -04:00
Behdad Esfahbod 891c4755ba Humm, undo some shuffling
In preparation for adding more advanced unicode funcs.
2011-07-07 23:27:27 -04:00
Behdad Esfahbod 1a64f6e19a [API] Add HB_LANGUAGE_INVALID 2011-05-13 22:55:32 -04:00
Behdad Esfahbod 34fb5521a5 [API] Add hb_language_get_default()
It uses locale information to detect default language.  It's used by
hb_shape() whenever language is not set on the buffer.

Not sure how to properly test it in the test suite.  Tested by observing
that with DejaVu Sans we select the proper local glyph version for U+431
under Serbian locale.  See http://www.pango.org/ScriptGallery
2011-05-06 00:05:08 -04:00
Behdad Esfahbod 72657e4ce7 [API] Make hb_font_create() take a face and reference it 2011-05-02 20:47:23 -04:00
Behdad Esfahbod 2409d5f8d7 Update Copyright headers 2011-04-21 17:14:28 -04:00
Behdad Esfahbod c57d454acc Rename all private sources and headers to C++ files
So we can liberally use the simple features of C++ that parts of the
codebase is already using.
2011-04-20 18:50:27 -04:00
Behdad Esfahbod c035812feb [API] Rename hb_face_get_table() to hb_face_reference_table()
That correctly reflects the reference ownership transfer happening.
2011-04-20 17:03:00 -04:00
Behdad Esfahbod fb194b8794 unicode: Cleanup implementation 2011-04-20 02:27:39 -04:00
Ryan Lortie 2fd0c577e3 [API] unicode: rework virtual functions for subclassing
Unicode data providers can now be subclassed, including support for
chain-up.  The interface should now be nicely bindable, as well.

Also fix glib unicode funcs that where broken after hb_script_t
changes.  Nicely caught by the test-unicode.c added in this commit.
2011-04-20 00:19:20 -04:00
Behdad Esfahbod 62879eebd9 [API] Use ISO 15924 tags for hb_script_t
This simplifies the code, reduces static data, and makes the design
more extensible to future additions of new scripts.
2011-04-18 23:40:21 -04:00
Behdad Esfahbod 5814dfa3f5 Cosmetic 2011-04-15 14:41:04 -04:00
Behdad Esfahbod 3286fc0e9a Let hb_shape() guess script and direction...
- Rename HB_SCRIPT_INVALID_CODE to HB_SCRIPT_INVALID

- Add HB_DIRECTION_INVALID

- Make hb_script_get_horizontal_direction() public

- Make hb_shape() guess script from buffer text (first non-common
  non-inherit script) if buffer script is set to HB_SCRIPT_INVALID (this
  is NOT the default.)

- Make hb_shape() guess direction from buffer script if buffer direction
is set to HB_DIRECTION_INVALID (this is NOT the default.)

- Make hb-view.c set INVALID script and direction on the buffer.

The above changes are meant to make hb-view fairly useful for uni-script
uni-direction text.  The guessing behavior however is NOT the default of
hb_shape() and must be asked for explicitly.  This is intended, because
the guess is not a suitable substitute to full-fledged bidi and script
segmentation.  It's just a testing tool.
2011-03-16 14:53:32 -03:00
Behdad Esfahbod acdba3f90b Prefer C linkage 2010-07-23 15:39:27 -04:00
Behdad Esfahbod b485da0b71 Disable Graphite as it crashes all over the place... 2010-05-27 11:39:19 -04:00
Behdad Esfahbod 15c7379c16 Revert "Merge remote branch 'martin/master'"
This reverts commit 80af2812fb, reversing
changes made to c442672ec2.
2010-05-26 10:48:10 -04:00
Martin Hosken 1432ab15c1 Add graphical output to hbtestfont 2010-05-22 00:56:40 +01:00
Behdad Esfahbod ca663bb23c Move main shaper code into hb_ot_shape() 2010-05-21 14:34:23 +01:00
Behdad Esfahbod 305ba86715 Import Graphite shaping backend by Martin Hosken 2010-05-21 14:15:39 +01:00
Behdad Esfahbod ca54a12658 Minor 2010-05-14 22:25:42 -04:00
Behdad Esfahbod 36b73c80df Shortening buffer accessors: rename buffer->in_pos to buffer->i 2010-05-14 22:10:39 -04:00
Behdad Esfahbod 6960350be9 Shortening buffer accessors: rename buffer->in_length to buffer->len 2010-05-14 22:07:46 -04:00
Behdad Esfahbod 1b621823f3 Shortening buffer accessors: rename buffer->positions to buffer->pos 2010-05-14 22:05:53 -04:00
Behdad Esfahbod 7e7007a1c9 Shortening buffer accessors: rename buffer->in_string to buffer->info 2010-05-14 22:02:37 -04:00
Behdad Esfahbod 7e53ebe478 Remove the IN_CURGLYPH() macro 2010-05-14 21:38:46 -04:00
Behdad Esfahbod 281f59b4fb Remove IN_INFO() and IN_NEXTGLYPH() macros 2010-05-14 21:34:22 -04:00
Behdad Esfahbod 6e489cdf76 Remove the IN_GLYPH() macro 2010-05-14 21:07:35 -04:00
Behdad Esfahbod 01feb74c78 Remove the IN_CLUSTER() macro 2010-05-14 21:00:08 -04:00
Behdad Esfahbod 3109375b84 Remove POSITION() and CURPOSITION() macros 2010-05-14 19:55:27 -04:00
Behdad Esfahbod 22da7fd94d Rename a few files to be C++ sources
In anticipation for buffer revamp coming.
2010-05-12 18:23:21 -04:00