Merge pull request #102 from roozbehp/master
Add OpenType language tag 'NAV ' for Navajo.
diff --git a/.travis.yml b/.travis.yml
index 4b3e0f8..c491189 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,6 +15,7 @@
- sudo apt-get install libcairo2-dev # for utils
- sudo apt-get install libicu-dev # for extra unicode functions
- sudo apt-get install libgraphite2-dev # for extra shapers
+ - : #sudo apt-get install libgirepository1.0-dev # for gobject-introspection
- sudo pip install cpp-coveralls # for coveralls.io code coverage tracking
script:
- NOCONFIGURE=1 ./autogen.sh
diff --git a/README.python b/README.python
index eabdf5b..cd31264 100644
--- a/README.python
+++ b/README.python
@@ -1,6 +1,10 @@
To enable HarfBuzz bindings for Python among other languages, make sure
-you have latest version of gobject-introspection compiled, and then
-run autogen.sh (if building from git), and then:
+you have latest version of gobject-introspection available. On Ubuntu,
+you can install that this way:
+
+ sudo apt-get install libgirepository1.0-dev
+
+And then run autogen.sh (if building from git), and then:
./configure --with-gobject --enable-introspection
diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index 0543073..88892d0 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -1283,6 +1283,23 @@
}
/**
+ * hb_buffer_reverse_range:
+ * @buffer: a buffer.
+ * @start: start index.
+ * @end: end index.
+ *
+ * Reverses buffer contents between start to end.
+ *
+ * Since: 1.0
+ **/
+void
+hb_buffer_reverse_range (hb_buffer_t *buffer,
+ unsigned int start, unsigned int end)
+{
+ buffer->reverse_range (start, end);
+}
+
+/**
* hb_buffer_reverse_clusters:
* @buffer: a buffer.
*
diff --git a/src/hb-buffer.h b/src/hb-buffer.h
index e5b46d8..520141b 100644
--- a/src/hb-buffer.h
+++ b/src/hb-buffer.h
@@ -222,6 +222,10 @@
hb_buffer_reverse (hb_buffer_t *buffer);
void
+hb_buffer_reverse_range (hb_buffer_t *buffer,
+ unsigned int start, unsigned int end);
+
+void
hb_buffer_reverse_clusters (hb_buffer_t *buffer);
diff --git a/src/hb-shape.cc b/src/hb-shape.cc
index 4e22c61..1d337bf 100644
--- a/src/hb-shape.cc
+++ b/src/hb-shape.cc
@@ -33,6 +33,17 @@
#include "hb-buffer-private.hh"
#include "hb-font-private.hh"
+/**
+ * SECTION:hb-shape
+ * @title: Shaping
+ * @short_description: Conversion of text strings into positioned glyphs
+ * @include: hb.h
+ *
+ * Shaping is the central operation of HarfBuzz. Shaping operates on buffers,
+ * which are sequences of Unicode characters that use the same font and have
+ * the same text direction, script and language. After shaping the buffer
+ * contains the output glyphs and their positions.
+ **/
static bool
parse_space (const char **pp, const char *end)
@@ -198,13 +209,14 @@
/**
* hb_feature_from_string:
- * @str: (array length=len) (element-type uint8_t):
- * @len:
- * @feature: (out) (optional):
+ * @str: (array length=len) (element-type uint8_t): a string to parse
+ * @len: length of @str, or -1 if string is nul-terminated
+ * @feature: (out): the #hb_feature_t to initialize with the parsed values
*
- *
+ * Parses a string into a #hb_feature_t. If @len is -1 then @str is
+ * %NULL-terminated.
*
- * Return value:
+ * Return value: %TRUE if @str is successfully parsed, %FALSE otherwise
*
* Since: 1.0
**/
@@ -231,11 +243,13 @@
/**
* hb_feature_to_string:
- * @feature:
- * @buf: (array length=size):
- * @size:
+ * @feature: an #hb_feature_t to convert
+ * @buf: (array length=size) (out): output string
+ * @size: the allocated size of @buf
*
- *
+ * Converts a #hb_feature_t into a %NULL-terminated string in the format
+ * understood by hb_feature_from_string(). The client in responsible for
+ * allocating big enough size for @buf, 128 bytes is more than enough.
*
* Since: 1.0
**/
@@ -290,9 +304,10 @@
/**
* hb_shape_list_shapers:
*
- *
+ * Retrieves the list of shapers supported by HarfBuzz.
*
- * Return value: (transfer none):
+ * Return value: (transfer none) (array zero-terminated=1): an array of
+ * constant strings
*
* Since: 1.0
**/
@@ -333,15 +348,19 @@
/**
* hb_shape_full:
- * @font: a font.
- * @buffer: a buffer.
- * @features: (array length=num_features):
- * @num_features:
- * @shaper_list: (array zero-terminated=1):
+ * @font: an #hb_font_t to use for shaping
+ * @buffer: an #hb_buffer_t to shape
+ * @features: (array length=num_features) (allow-none): an array of user
+ * specified #hb_feature_t or %NULL
+ * @num_features: the length of @features array
+ * @shaper_list: (array zero-terminated=1) (allow-none): a %NULL-terminated
+ * array of shapers to use or %NULL
*
- *
+ * See hb_shape() for details. If @shaper_list is not %NULL, the specified
+ * shapers will be used in the given order, otherwise the default shapers list
+ * will be used.
*
- * Return value:
+ * Return value: %FALSE if all shapers failed, %TRUE otherwise
*
* Since: 1.0
**/
@@ -368,12 +387,17 @@
/**
* hb_shape:
- * @font: a font.
- * @buffer: a buffer.
- * @features: (array length=num_features):
- * @num_features:
+ * @font: an #hb_font_t to use for shaping
+ * @buffer: an #hb_buffer_t to shape
+ * @features: (array length=num_features) (allow-none): an array of user
+ * specified #hb_feature_t or %NULL
+ * @num_features: the length of @features array
*
- *
+ * Shapes @buffer using @font turning its Unicode characters content to
+ * positioned glyphs. If @features is not %NULL, it will be used to control the
+ * features applied during shaping.
+ *
+ * Return value: %FALSE if all shapers failed, %TRUE otherwise
*
* Since: 1.0
**/
diff --git a/src/hb-shape.h b/src/hb-shape.h
index 10a35cb..b665509 100644
--- a/src/hb-shape.h
+++ b/src/hb-shape.h
@@ -47,13 +47,10 @@
unsigned int end;
} hb_feature_t;
-/* len=-1 means str is NUL-terminated */
hb_bool_t
hb_feature_from_string (const char *str, int len,
hb_feature_t *feature);
-/* Something like 128 bytes is more than enough.
- * nul-terminates. */
void
hb_feature_to_string (hb_feature_t *feature,
char *buf, unsigned int size);