[HarfBuzz] harfbuzz: Branch 'master' - 5 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Fri Sep 6 14:31:07 PDT 2013
src/hb-blob.cc | 63 ++---
src/hb-buffer-serialize.cc | 63 +++++
src/hb-buffer.cc | 319 +++++++++++++++++++++++++++-
src/hb-common.cc | 2
src/hb-common.h | 2
src/hb-face.cc | 171 +++++++++++++++
src/hb-font-private.hh | 4
src/hb-font.cc | 504 ++++++++++++++++++++++++++++++++++++++++++++-
src/hb-gobject-structs.cc | 15 -
src/hb-gobject-structs.h | 8
src/hb-set-private.hh | 20 +
src/hb-set.cc | 244 +++++++++++++++++++++
src/hb-set.h | 2
src/hb-shape-plan.cc | 104 +++++++++
src/hb-shape.cc | 56 +++++
src/hb-unicode.cc | 128 +++++++++++
src/hb-version.h.in | 6
test/api/test-set.c | 26 +-
18 files changed, 1657 insertions(+), 80 deletions(-)
New commits:
commit 288f2899979bcc9e68f8115cb76e3271ed0e17bc
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Fri Sep 6 15:40:22 2013 -0400
[docs/introspection] More annotations
diff --git a/src/hb-blob.cc b/src/hb-blob.cc
index b312546..5c53016 100644
--- a/src/hb-blob.cc
+++ b/src/hb-blob.cc
@@ -77,17 +77,17 @@ _hb_blob_destroy_user_data (hb_blob_t *blob)
}
/**
- * hb_blob_create:
- * @data: (array length=length) (allow-none): Pointer to blob data.
+ * hb_blob_create: (constructor)
+ * @data: (array length=length): Pointer to blob data.
* @length: Length of @data in bytes.
* @mode: Memory mode for @data.
- * @user_data: (allow-none): Data parameter to pass to @destroy.
- * @destroy: (allow-none) (closure user_data): Callback to call when @data is not needed anymore.
+ * @user_data: Data parameter to pass to @destroy.
+ * @destroy: (closure user_data): Callback to call when @data is not needed anymore.
*
* Creates a new "blob" object wrapping @data. The @mode parameter is used
* to negotiate ownership and lifecycle of @data.
*
- * Returns: New blob, or the empty blob if something failed or if @length is
+ * Return value: New blob, or the empty blob if something failed or if @length is
* zero. Destroy with hb_blob_destroy().
*
* Since: 1.0
@@ -139,9 +139,9 @@ hb_blob_create (const char *data,
*
* Makes @parent immutable.
*
- * Returns: New blob, or the empty blob if something failed or if @length is
- * zero or @offset is beyond the end of @parent's data. Destroy with
- * hb_blob_destroy().
+ * Return value: New blob, or the empty blob if something failed or if
+ * @length is zero or @offset is beyond the end of @parent's data. Destroy
+ * with hb_blob_destroy().
*
* Since: 1.0
**/
@@ -173,7 +173,7 @@ hb_blob_create_sub_blob (hb_blob_t *parent,
*
* See TODO:link object types for more information.
*
- * Returns: The empty blob.
+ * Return value: (transfer full): the empty blob.
*
* Since: 1.0
**/
@@ -197,14 +197,14 @@ hb_blob_get_empty (void)
}
/**
- * hb_blob_reference:
+ * hb_blob_reference: (skip)
* @blob: a blob.
*
* Increases the reference count on @blob.
*
* See TODO:link object types for more information.
*
- * Returns: @blob.
+ * Return value: @blob.
*
* Since: 1.0
**/
@@ -215,7 +215,7 @@ hb_blob_reference (hb_blob_t *blob)
}
/**
- * hb_blob_destroy:
+ * hb_blob_destroy: (skip)
* @blob: a blob.
*
* Descreases the reference count on @blob, and if it reaches zero, destroys
@@ -237,18 +237,14 @@ hb_blob_destroy (hb_blob_t *blob)
}
/**
- * hb_blob_set_user_data:
+ * hb_blob_set_user_data: (skip)
* @blob: a blob.
* @key: key for data to set.
* @data: data to set.
* @destroy: callback to call when @data is not needed anymore.
* @replace: whether to replace an existing data with the same key.
*
- * Attaches a piece of data to the object.
- *
- * See TODO:link object types for more information.
- *
- * Returns: TODO
+ * Return value:
*
* Since: 1.0
**/
@@ -263,15 +259,13 @@ hb_blob_set_user_data (hb_blob_t *blob,
}
/**
- * hb_blob_get_user_data:
+ * hb_blob_get_user_data: (skip)
* @blob: a blob.
* @key: key for data to get.
*
- * TODO
- *
- * See TODO:link object types for more information.
+ *
*
- * Returns: (transfer none): data, or TODO
+ * Return value: (transfer none):
*
* Since: 1.0
**/
@@ -287,9 +281,7 @@ hb_blob_get_user_data (hb_blob_t *blob,
* hb_blob_make_immutable:
* @blob: a blob.
*
- * TODO
- *
- * See TODO:link object types for more information.
+ *
*
* Since: 1.0
**/
@@ -306,11 +298,9 @@ hb_blob_make_immutable (hb_blob_t *blob)
* hb_blob_is_immutable:
* @blob: a blob.
*
- * TODO
- *
- * See TODO:link object types for more information.
+ *
*
- * Returns: TODO
+ * Return value: TODO
*
* Since: 1.0
**/
@@ -325,9 +315,9 @@ hb_blob_is_immutable (hb_blob_t *blob)
* hb_blob_get_length:
* @blob: a blob.
*
- * TODO
+ *
*
- * Returns: the length of blob data in bytes.
+ * Return value: the length of blob data in bytes.
*
* Since: 1.0
**/
@@ -340,11 +330,11 @@ hb_blob_get_length (hb_blob_t *blob)
/**
* hb_blob_get_data:
* @blob: a blob.
- * @length: (out) TODO
+ * @length: (out):
*
- * TODO
+ *
*
- * Returns: (transfer none): TODO
+ * Returns: (transfer none) (array length=length):
*
* Since: 1.0
**/
@@ -368,7 +358,8 @@ hb_blob_get_data (hb_blob_t *blob, unsigned int *length)
* Fails if blob has been made immutable, or if memory allocation
* fails.
*
- * Returns: (transfer none): Writable blob data, or %NULL if failed.
+ * Returns: (transfer none) (array length=length): Writable blob data,
+ * or %NULL if failed.
*
* Since: 1.0
**/
diff --git a/src/hb-buffer-serialize.cc b/src/hb-buffer-serialize.cc
index eac6900..b32092c 100644
--- a/src/hb-buffer-serialize.cc
+++ b/src/hb-buffer-serialize.cc
@@ -33,12 +33,32 @@ static const char *serialize_formats[] = {
NULL
};
+/**
+ * hb_buffer_serialize_list_formats:
+ *
+ *
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
const char **
hb_buffer_serialize_list_formats (void)
{
return serialize_formats;
}
+/**
+ * hb_buffer_serialize_format_from_string:
+ * @str:
+ * @len:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_buffer_serialize_format_t
hb_buffer_serialize_format_from_string (const char *str, int len)
{
@@ -46,6 +66,16 @@ hb_buffer_serialize_format_from_string (const char *str, int len)
return (hb_buffer_serialize_format_t) (hb_tag_from_string (str, len) & ~0x20202020);
}
+/**
+ * hb_buffer_serialize_format_to_string:
+ * @format:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
const char *
hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format)
{
@@ -194,6 +224,24 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer,
}
/* Returns number of items, starting at start, that were serialized. */
+/**
+ * hb_buffer_serialize_glyphs:
+ * @buffer: a buffer.
+ * @start:
+ * @end:
+ * @buf: (array length=buf_size):
+ * @buf_size:
+ * @buf_consumed: (out):
+ * @font:
+ * @format:
+ * @flags:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
unsigned int
hb_buffer_serialize_glyphs (hb_buffer_t *buffer,
unsigned int start,
@@ -286,6 +334,21 @@ parse_int (const char *pp, const char *end, int32_t *pv)
#include "hb-buffer-deserialize-json.hh"
#include "hb-buffer-deserialize-text.hh"
+/**
+ * hb_buffer_deserialize_glyphs:
+ * @buffer: a buffer.
+ * @buf: (array length=buf_len):
+ * @buf_len:
+ * @end_ptr: (out):
+ * @font:
+ * @format:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_buffer_deserialize_glyphs (hb_buffer_t *buffer,
const char *buf,
diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index 2bfdfad..8143a1e 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -603,6 +603,15 @@ void hb_buffer_t::deallocate_var_all (void)
/* Public API */
+/**
+ * hb_buffer_create: (constructor)
+ *
+ *
+ *
+ * Return value: (transfer full)
+ *
+ * Since: 1.0
+ **/
hb_buffer_t *
hb_buffer_create (void)
{
@@ -616,6 +625,15 @@ hb_buffer_create (void)
return buffer;
}
+/**
+ * hb_buffer_get_empty:
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_buffer_t *
hb_buffer_get_empty (void)
{
@@ -637,12 +655,30 @@ hb_buffer_get_empty (void)
return const_cast<hb_buffer_t *> (&_hb_buffer_nil);
}
+/**
+ * hb_buffer_reference: (skip)
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_buffer_t *
hb_buffer_reference (hb_buffer_t *buffer)
{
return hb_object_reference (buffer);
}
+/**
+ * hb_buffer_destroy: (skip)
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_destroy (hb_buffer_t *buffer)
{
@@ -656,6 +692,20 @@ hb_buffer_destroy (hb_buffer_t *buffer)
free (buffer);
}
+/**
+ * hb_buffer_set_user_data: (skip)
+ * @buffer: a buffer.
+ * @key:
+ * @data:
+ * @destroy:
+ * @replace:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_buffer_set_user_data (hb_buffer_t *buffer,
hb_user_data_key_t *key,
@@ -666,6 +716,17 @@ hb_buffer_set_user_data (hb_buffer_t *buffer,
return hb_object_set_user_data (buffer, key, data, destroy, replace);
}
+/**
+ * hb_buffer_get_user_data: (skip)
+ * @buffer: a buffer.
+ * @key:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
void *
hb_buffer_get_user_data (hb_buffer_t *buffer,
hb_user_data_key_t *key)
@@ -674,6 +735,15 @@ hb_buffer_get_user_data (hb_buffer_t *buffer,
}
+/**
+ * hb_buffer_set_content_type:
+ * @buffer: a buffer.
+ * @content_type:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_set_content_type (hb_buffer_t *buffer,
hb_buffer_content_type_t content_type)
@@ -681,6 +751,16 @@ hb_buffer_set_content_type (hb_buffer_t *buffer,
buffer->content_type = content_type;
}
+/**
+ * hb_buffer_get_content_type:
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_buffer_content_type_t
hb_buffer_get_content_type (hb_buffer_t *buffer)
{
@@ -688,28 +768,56 @@ hb_buffer_get_content_type (hb_buffer_t *buffer)
}
+/**
+ * hb_buffer_set_unicode_funcs:
+ * @buffer: a buffer.
+ * @unicode_funcs:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
- hb_unicode_funcs_t *unicode)
+ hb_unicode_funcs_t *unicode_funcs)
{
if (unlikely (hb_object_is_inert (buffer)))
return;
- if (!unicode)
- unicode = hb_unicode_funcs_get_default ();
+ if (!unicode_funcs)
+ unicode_funcs = hb_unicode_funcs_get_default ();
- hb_unicode_funcs_reference (unicode);
+ hb_unicode_funcs_reference (unicode_funcs);
hb_unicode_funcs_destroy (buffer->unicode);
- buffer->unicode = unicode;
+ buffer->unicode = unicode_funcs;
}
+/**
+ * hb_buffer_get_unicode_funcs:
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_unicode_funcs_t *
hb_buffer_get_unicode_funcs (hb_buffer_t *buffer)
{
return buffer->unicode;
}
+/**
+ * hb_buffer_set_direction:
+ * @buffer: a buffer.
+ * @direction:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_set_direction (hb_buffer_t *buffer,
hb_direction_t direction)
@@ -721,12 +829,31 @@ hb_buffer_set_direction (hb_buffer_t *buffer,
buffer->props.direction = direction;
}
+/**
+ * hb_buffer_get_direction:
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_direction_t
hb_buffer_get_direction (hb_buffer_t *buffer)
{
return buffer->props.direction;
}
+/**
+ * hb_buffer_set_script:
+ * @buffer: a buffer.
+ * @script:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_set_script (hb_buffer_t *buffer,
hb_script_t script)
@@ -737,12 +864,31 @@ hb_buffer_set_script (hb_buffer_t *buffer,
buffer->props.script = script;
}
+/**
+ * hb_buffer_get_script:
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_script_t
hb_buffer_get_script (hb_buffer_t *buffer)
{
return buffer->props.script;
}
+/**
+ * hb_buffer_set_language:
+ * @buffer: a buffer.
+ * @language:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_set_language (hb_buffer_t *buffer,
hb_language_t language)
@@ -753,12 +899,31 @@ hb_buffer_set_language (hb_buffer_t *buffer,
buffer->props.language = language;
}
+/**
+ * hb_buffer_get_language:
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_language_t
hb_buffer_get_language (hb_buffer_t *buffer)
{
return buffer->props.language;
}
+/**
+ * hb_buffer_set_segment_properties:
+ * @buffer: a buffer.
+ * @props:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_set_segment_properties (hb_buffer_t *buffer,
const hb_segment_properties_t *props)
@@ -769,6 +934,15 @@ hb_buffer_set_segment_properties (hb_buffer_t *buffer,
buffer->props = *props;
}
+/**
+ * hb_buffer_get_segment_properties:
+ * @buffer: a buffer.
+ * @props:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_get_segment_properties (hb_buffer_t *buffer,
hb_segment_properties_t *props)
@@ -777,6 +951,15 @@ hb_buffer_get_segment_properties (hb_buffer_t *buffer,
}
+/**
+ * hb_buffer_set_flags:
+ * @buffer: a buffer.
+ * @flags:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_set_flags (hb_buffer_t *buffer,
hb_buffer_flags_t flags)
@@ -787,6 +970,16 @@ hb_buffer_set_flags (hb_buffer_t *buffer,
buffer->flags = flags;
}
+/**
+ * hb_buffer_get_flags:
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_buffer_flags_t
hb_buffer_get_flags (hb_buffer_t *buffer)
{
@@ -794,30 +987,77 @@ hb_buffer_get_flags (hb_buffer_t *buffer)
}
+/**
+ * hb_buffer_reset:
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_reset (hb_buffer_t *buffer)
{
buffer->reset ();
}
+/**
+ * hb_buffer_clear_contents:
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_clear_contents (hb_buffer_t *buffer)
{
buffer->clear ();
}
+/**
+ * hb_buffer_pre_allocate:
+ * @buffer: a buffer.
+ * @size:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_buffer_pre_allocate (hb_buffer_t *buffer, unsigned int size)
{
return buffer->ensure (size);
}
+/**
+ * hb_buffer_allocation_successful:
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_buffer_allocation_successful (hb_buffer_t *buffer)
{
return !buffer->in_error;
}
+/**
+ * hb_buffer_add:
+ * @buffer: a buffer.
+ * @codepoint:
+ * @cluster:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_add (hb_buffer_t *buffer,
hb_codepoint_t codepoint,
@@ -827,6 +1067,17 @@ hb_buffer_add (hb_buffer_t *buffer,
buffer->clear_context (1);
}
+/**
+ * hb_buffer_set_length:
+ * @buffer: a buffer.
+ * @length:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_buffer_set_length (hb_buffer_t *buffer,
unsigned int length)
@@ -1042,6 +1293,18 @@ hb_buffer_add_utf (hb_buffer_t *buffer,
buffer->content_type = HB_BUFFER_CONTENT_TYPE_UNICODE;
}
+/**
+ * hb_buffer_add_utf8:
+ * @buffer: a buffer.
+ * @text: (array length=text_length):
+ * @text_length:
+ * @item_offset:
+ * @item_length:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_add_utf8 (hb_buffer_t *buffer,
const char *text,
@@ -1052,16 +1315,40 @@ hb_buffer_add_utf8 (hb_buffer_t *buffer,
hb_buffer_add_utf (buffer, (const uint8_t *) text, text_length, item_offset, item_length);
}
+/**
+ * hb_buffer_add_utf16:
+ * @buffer: a buffer.
+ * @text: (array length=text_length):
+ * @text_length:
+ * @item_offset:
+ * @item_length:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_add_utf16 (hb_buffer_t *buffer,
const uint16_t *text,
int text_length,
unsigned int item_offset,
- int item_length)
+ int item_length)
{
hb_buffer_add_utf (buffer, text, text_length, item_offset, item_length);
}
+/**
+ * hb_buffer_add_utf32:
+ * @buffer: a buffer.
+ * @text: (array length=text_length):
+ * @text_length:
+ * @item_offset:
+ * @item_length:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_add_utf32 (hb_buffer_t *buffer,
const uint32_t *text,
@@ -1128,6 +1415,14 @@ normalize_glyphs_cluster (hb_buffer_t *buffer,
}
}
+/**
+ * hb_buffer_normalize_glyphs:
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_buffer_normalize_glyphs (hb_buffer_t *buffer)
{
diff --git a/src/hb-face.cc b/src/hb-face.cc
index d8b9ed8..10f4302 100644
--- a/src/hb-face.cc
+++ b/src/hb-face.cc
@@ -68,6 +68,18 @@ const hb_face_t _hb_face_nil = {
};
+/**
+ * hb_face_create_for_tables:
+ * @reference_table_func:
+ * @user_data:
+ * @destroy:
+ *
+ *
+ *
+ * Return value: (transfer full)
+ *
+ * Since: 1.0
+ **/
hb_face_t *
hb_face_create_for_tables (hb_reference_table_func_t reference_table_func,
void *user_data,
@@ -137,6 +149,17 @@ _hb_face_for_data_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void
return blob;
}
+/**
+ * hb_face_create: (constructor)
+ * @blob:
+ * @index:
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_face_t *
hb_face_create (hb_blob_t *blob,
unsigned int index)
@@ -160,6 +183,15 @@ hb_face_create (hb_blob_t *blob,
return face;
}
+/**
+ * hb_face_get_empty:
+ *
+ *
+ *
+ * Return value: (transfer full)
+ *
+ * Since: 1.0
+ **/
hb_face_t *
hb_face_get_empty (void)
{
@@ -167,12 +199,30 @@ hb_face_get_empty (void)
}
+/**
+ * hb_face_reference: (skip)
+ * @face: a face.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_face_t *
hb_face_reference (hb_face_t *face)
{
return hb_object_reference (face);
}
+/**
+ * hb_face_destroy: (skip)
+ * @face: a face.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_face_destroy (hb_face_t *face)
{
@@ -196,6 +246,20 @@ hb_face_destroy (hb_face_t *face)
free (face);
}
+/**
+ * hb_face_set_user_data: (skip)
+ * @face: a face.
+ * @key:
+ * @data:
+ * @destroy:
+ * @replace:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_face_set_user_data (hb_face_t *face,
hb_user_data_key_t *key,
@@ -206,6 +270,17 @@ hb_face_set_user_data (hb_face_t *face,
return hb_object_set_user_data (face, key, data, destroy, replace);
}
+/**
+ * hb_face_get_user_data: (skip)
+ * @face: a face.
+ * @key:
+ *
+ *
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
void *
hb_face_get_user_data (hb_face_t *face,
hb_user_data_key_t *key)
@@ -213,6 +288,14 @@ hb_face_get_user_data (hb_face_t *face,
return hb_object_get_user_data (face, key);
}
+/**
+ * hb_face_make_immutable:
+ * @face: a face.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_face_make_immutable (hb_face_t *face)
{
@@ -222,6 +305,16 @@ hb_face_make_immutable (hb_face_t *face)
face->immutable = true;
}
+/**
+ * hb_face_is_immutable:
+ * @face: a face.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_face_is_immutable (hb_face_t *face)
{
@@ -229,6 +322,17 @@ hb_face_is_immutable (hb_face_t *face)
}
+/**
+ * hb_face_reference_table:
+ * @face: a face.
+ * @tag:
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_blob_t *
hb_face_reference_table (hb_face_t *face,
hb_tag_t tag)
@@ -236,12 +340,31 @@ hb_face_reference_table (hb_face_t *face,
return face->reference_table (tag);
}
+/**
+ * hb_face_reference_blob:
+ * @face: a face.
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_blob_t *
hb_face_reference_blob (hb_face_t *face)
{
return face->reference_table (HB_TAG_NONE);
}
+/**
+ * hb_face_set_index:
+ * @face: a face.
+ * @index:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_face_set_index (hb_face_t *face,
unsigned int index)
@@ -252,12 +375,31 @@ hb_face_set_index (hb_face_t *face,
face->index = index;
}
+/**
+ * hb_face_get_index:
+ * @face: a face.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
unsigned int
hb_face_get_index (hb_face_t *face)
{
return face->index;
}
+/**
+ * hb_face_set_upem:
+ * @face: a face.
+ * @upem:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_face_set_upem (hb_face_t *face,
unsigned int upem)
@@ -268,6 +410,16 @@ hb_face_set_upem (hb_face_t *face,
face->upem = upem;
}
+/**
+ * hb_face_get_upem:
+ * @face: a face.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
unsigned int
hb_face_get_upem (hb_face_t *face)
{
@@ -283,6 +435,15 @@ hb_face_t::load_upem (void) const
hb_blob_destroy (head_blob);
}
+/**
+ * hb_face_set_glyph_count:
+ * @face: a face.
+ * @glyph_count:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_face_set_glyph_count (hb_face_t *face,
unsigned int glyph_count)
@@ -293,6 +454,16 @@ hb_face_set_glyph_count (hb_face_t *face,
face->num_glyphs = glyph_count;
}
+/**
+ * hb_face_get_glyph_count:
+ * @face: a face.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
unsigned int
hb_face_get_glyph_count (hb_face_t *face)
{
diff --git a/src/hb-font-private.hh b/src/hb-font-private.hh
index 9638839..00c0cc3 100644
--- a/src/hb-font-private.hh
+++ b/src/hb-font-private.hh
@@ -193,10 +193,10 @@ struct hb_font_t {
klass->user_data.glyph_h_kerning);
}
- inline hb_position_t get_glyph_v_kerning (hb_codepoint_t left_glyph, hb_codepoint_t right_glyph)
+ inline hb_position_t get_glyph_v_kerning (hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph)
{
return klass->get.glyph_v_kerning (this, user_data,
- left_glyph, right_glyph,
+ top_glyph, bottom_glyph,
klass->user_data.glyph_v_kerning);
}
diff --git a/src/hb-font.cc b/src/hb-font.cc
index c2f6f6d..34c3ba0 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -230,6 +230,15 @@ static const hb_font_funcs_t _hb_font_funcs_nil = {
};
+/**
+ * hb_font_funcs_create: (constructor)
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_font_funcs_t *
hb_font_funcs_create (void)
{
@@ -243,18 +252,45 @@ hb_font_funcs_create (void)
return ffuncs;
}
+/**
+ * hb_font_funcs_get_empty:
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_font_funcs_t *
hb_font_funcs_get_empty (void)
{
return const_cast<hb_font_funcs_t *> (&_hb_font_funcs_nil);
}
+/**
+ * hb_font_funcs_reference: (skip)
+ * @ffuncs: font functions.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_font_funcs_t *
hb_font_funcs_reference (hb_font_funcs_t *ffuncs)
{
return hb_object_reference (ffuncs);
}
+/**
+ * hb_font_funcs_destroy: (skip)
+ * @ffuncs: font functions.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_funcs_destroy (hb_font_funcs_t *ffuncs)
{
@@ -268,6 +304,20 @@ hb_font_funcs_destroy (hb_font_funcs_t *ffuncs)
free (ffuncs);
}
+/**
+ * hb_font_funcs_set_user_data: (skip)
+ * @ffuncs: font functions.
+ * @key:
+ * @data:
+ * @destroy:
+ * @replace:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs,
hb_user_data_key_t *key,
@@ -278,6 +328,17 @@ hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs,
return hb_object_set_user_data (ffuncs, key, data, destroy, replace);
}
+/**
+ * hb_font_funcs_get_user_data: (skip)
+ * @ffuncs: font functions.
+ * @key:
+ *
+ *
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
void *
hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs,
hb_user_data_key_t *key)
@@ -286,6 +347,14 @@ hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs,
}
+/**
+ * hb_font_funcs_make_immutable:
+ * @ffuncs: font functions.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs)
{
@@ -295,6 +364,16 @@ hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs)
ffuncs->immutable = true;
}
+/**
+ * hb_font_funcs_is_immutable:
+ * @ffuncs: font functions.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs)
{
@@ -336,6 +415,19 @@ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
/* Public getters */
+/**
+ * hb_font_get_glyph:
+ * @font: a font.
+ * @unicode:
+ * @variation_selector:
+ * @glyph: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_get_glyph (hb_font_t *font,
hb_codepoint_t unicode, hb_codepoint_t variation_selector,
@@ -344,6 +436,17 @@ hb_font_get_glyph (hb_font_t *font,
return font->get_glyph (unicode, variation_selector, glyph);
}
+/**
+ * hb_font_get_glyph_h_advance:
+ * @font: a font.
+ * @glyph:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_position_t
hb_font_get_glyph_h_advance (hb_font_t *font,
hb_codepoint_t glyph)
@@ -351,6 +454,17 @@ hb_font_get_glyph_h_advance (hb_font_t *font,
return font->get_glyph_h_advance (glyph);
}
+/**
+ * hb_font_get_glyph_v_advance:
+ * @font: a font.
+ * @glyph:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_position_t
hb_font_get_glyph_v_advance (hb_font_t *font,
hb_codepoint_t glyph)
@@ -358,6 +472,19 @@ hb_font_get_glyph_v_advance (hb_font_t *font,
return font->get_glyph_v_advance (glyph);
}
+/**
+ * hb_font_get_glyph_h_origin:
+ * @font: a font.
+ * @glyph:
+ * @x: (out):
+ * @y: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_get_glyph_h_origin (hb_font_t *font,
hb_codepoint_t glyph,
@@ -366,6 +493,19 @@ hb_font_get_glyph_h_origin (hb_font_t *font,
return font->get_glyph_h_origin (glyph, x, y);
}
+/**
+ * hb_font_get_glyph_v_origin:
+ * @font: a font.
+ * @glyph:
+ * @x: (out):
+ * @y: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_get_glyph_v_origin (hb_font_t *font,
hb_codepoint_t glyph,
@@ -374,6 +514,18 @@ hb_font_get_glyph_v_origin (hb_font_t *font,
return font->get_glyph_v_origin (glyph, x, y);
}
+/**
+ * hb_font_get_glyph_h_kerning:
+ * @font: a font.
+ * @left_glyph:
+ * @right_glyph:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_position_t
hb_font_get_glyph_h_kerning (hb_font_t *font,
hb_codepoint_t left_glyph, hb_codepoint_t right_glyph)
@@ -381,13 +533,37 @@ hb_font_get_glyph_h_kerning (hb_font_t *font,
return font->get_glyph_h_kerning (left_glyph, right_glyph);
}
+/**
+ * hb_font_get_glyph_v_kerning:
+ * @font: a font.
+ * @top_glyph:
+ * @bottom_glyph:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_position_t
hb_font_get_glyph_v_kerning (hb_font_t *font,
- hb_codepoint_t left_glyph, hb_codepoint_t right_glyph)
+ hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph)
{
- return font->get_glyph_v_kerning (left_glyph, right_glyph);
+ return font->get_glyph_v_kerning (top_glyph, bottom_glyph);
}
+/**
+ * hb_font_get_glyph_extents:
+ * @font: a font.
+ * @glyph:
+ * @extents: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_get_glyph_extents (hb_font_t *font,
hb_codepoint_t glyph,
@@ -396,6 +572,20 @@ hb_font_get_glyph_extents (hb_font_t *font,
return font->get_glyph_extents (glyph, extents);
}
+/**
+ * hb_font_get_glyph_contour_point:
+ * @font: a font.
+ * @glyph:
+ * @point_index:
+ * @x: (out):
+ * @y: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_get_glyph_contour_point (hb_font_t *font,
hb_codepoint_t glyph, unsigned int point_index,
@@ -404,6 +594,19 @@ hb_font_get_glyph_contour_point (hb_font_t *font,
return font->get_glyph_contour_point (glyph, point_index, x, y);
}
+/**
+ * hb_font_get_glyph_name:
+ * @font: a font.
+ * @glyph:
+ * @name: (array length=size):
+ * @size:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_get_glyph_name (hb_font_t *font,
hb_codepoint_t glyph,
@@ -412,6 +615,19 @@ hb_font_get_glyph_name (hb_font_t *font,
return font->get_glyph_name (glyph, name, size);
}
+/**
+ * hb_font_get_glyph_from_name:
+ * @font: a font.
+ * @name: (array length=len):
+ * @len:
+ * @glyph: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_get_glyph_from_name (hb_font_t *font,
const char *name, int len, /* -1 means nul-terminated */
@@ -423,6 +639,18 @@ hb_font_get_glyph_from_name (hb_font_t *font,
/* A bit higher-level, and with fallback */
+/**
+ * hb_font_get_glyph_advance_for_direction:
+ * @font: a font.
+ * @glyph:
+ * @direction:
+ * @x: (out):
+ * @y: (out):
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_get_glyph_advance_for_direction (hb_font_t *font,
hb_codepoint_t glyph,
@@ -432,6 +660,18 @@ hb_font_get_glyph_advance_for_direction (hb_font_t *font,
return font->get_glyph_advance_for_direction (glyph, direction, x, y);
}
+/**
+ * hb_font_get_glyph_origin_for_direction:
+ * @font: a font.
+ * @glyph:
+ * @direction:
+ * @x: (out):
+ * @y: (out):
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_get_glyph_origin_for_direction (hb_font_t *font,
hb_codepoint_t glyph,
@@ -441,6 +681,18 @@ hb_font_get_glyph_origin_for_direction (hb_font_t *font,
return font->get_glyph_origin_for_direction (glyph, direction, x, y);
}
+/**
+ * hb_font_add_glyph_origin_for_direction:
+ * @font: a font.
+ * @glyph:
+ * @direction:
+ * @x: (out):
+ * @y: (out):
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_add_glyph_origin_for_direction (hb_font_t *font,
hb_codepoint_t glyph,
@@ -450,6 +702,18 @@ hb_font_add_glyph_origin_for_direction (hb_font_t *font,
return font->add_glyph_origin_for_direction (glyph, direction, x, y);
}
+/**
+ * hb_font_subtract_glyph_origin_for_direction:
+ * @font: a font.
+ * @glyph:
+ * @direction:
+ * @x: (out):
+ * @y: (out):
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_subtract_glyph_origin_for_direction (hb_font_t *font,
hb_codepoint_t glyph,
@@ -459,6 +723,19 @@ hb_font_subtract_glyph_origin_for_direction (hb_font_t *font,
return font->subtract_glyph_origin_for_direction (glyph, direction, x, y);
}
+/**
+ * hb_font_get_glyph_kerning_for_direction:
+ * @font: a font.
+ * @first_glyph:
+ * @second_glyph:
+ * @direction:
+ * @x: (out):
+ * @y: (out):
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_get_glyph_kerning_for_direction (hb_font_t *font,
hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
@@ -468,6 +745,19 @@ hb_font_get_glyph_kerning_for_direction (hb_font_t *font,
return font->get_glyph_kerning_for_direction (first_glyph, second_glyph, direction, x, y);
}
+/**
+ * hb_font_get_glyph_extents_for_origin:
+ * @font: a font.
+ * @glyph:
+ * @direction:
+ * @extents: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_get_glyph_extents_for_origin (hb_font_t *font,
hb_codepoint_t glyph,
@@ -477,6 +767,21 @@ hb_font_get_glyph_extents_for_origin (hb_font_t *font,
return font->get_glyph_extents_for_origin (glyph, direction, extents);
}
+/**
+ * hb_font_get_glyph_contour_point_for_origin:
+ * @font: a font.
+ * @glyph:
+ * @point_index:
+ * @direction:
+ * @x: (out):
+ * @y: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_get_glyph_contour_point_for_origin (hb_font_t *font,
hb_codepoint_t glyph, unsigned int point_index,
@@ -487,6 +792,17 @@ hb_font_get_glyph_contour_point_for_origin (hb_font_t *font,
}
/* Generates gidDDD if glyph has no name. */
+/**
+ * hb_font_glyph_to_string:
+ * @font: a font.
+ * @glyph:
+ * @s: (array length=size):
+ * @size:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_glyph_to_string (hb_font_t *font,
hb_codepoint_t glyph,
@@ -496,6 +812,19 @@ hb_font_glyph_to_string (hb_font_t *font,
}
/* Parses gidDDD and uniUUUU strings automatically. */
+/**
+ * hb_font_glyph_from_string:
+ * @font: a font.
+ * @s: (array length=len):
+ * @len:
+ * @glyph: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_glyph_from_string (hb_font_t *font,
const char *s, int len, /* -1 means nul-terminated */
@@ -509,6 +838,16 @@ hb_font_glyph_from_string (hb_font_t *font,
* hb_font_t
*/
+/**
+ * hb_font_create: (constructor)
+ * @face: a face.
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_font_t *
hb_font_create (hb_face_t *face)
{
@@ -528,6 +867,16 @@ hb_font_create (hb_face_t *face)
return font;
}
+/**
+ * hb_font_create_sub_font:
+ * @parent: parent font.
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_font_t *
hb_font_create_sub_font (hb_font_t *parent)
{
@@ -550,6 +899,15 @@ hb_font_create_sub_font (hb_font_t *parent)
return font;
}
+/**
+ * hb_font_get_empty:
+ *
+ *
+ *
+ * Return value: (transfer full)
+ *
+ * Since: 1.0
+ **/
hb_font_t *
hb_font_get_empty (void)
{
@@ -581,12 +939,30 @@ hb_font_get_empty (void)
return const_cast<hb_font_t *> (&_hb_font_nil);
}
+/**
+ * hb_font_reference: (skip)
+ * @font: a font.
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_font_t *
hb_font_reference (hb_font_t *font)
{
return hb_object_reference (font);
}
+/**
+ * hb_font_destroy: (skip)
+ * @font: a font.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_destroy (hb_font_t *font)
{
@@ -606,6 +982,20 @@ hb_font_destroy (hb_font_t *font)
free (font);
}
+/**
+ * hb_font_set_user_data: (skip)
+ * @font: a font.
+ * @key:
+ * @data:
+ * @destroy:
+ * @replace:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_set_user_data (hb_font_t *font,
hb_user_data_key_t *key,
@@ -616,6 +1006,17 @@ hb_font_set_user_data (hb_font_t *font,
return hb_object_set_user_data (font, key, data, destroy, replace);
}
+/**
+ * hb_font_get_user_data: (skip)
+ * @font: a font.
+ * @key:
+ *
+ *
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
void *
hb_font_get_user_data (hb_font_t *font,
hb_user_data_key_t *key)
@@ -623,6 +1024,14 @@ hb_font_get_user_data (hb_font_t *font,
return hb_object_get_user_data (font, key);
}
+/**
+ * hb_font_make_immutable:
+ * @font: a font.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_make_immutable (hb_font_t *font)
{
@@ -632,18 +1041,48 @@ hb_font_make_immutable (hb_font_t *font)
font->immutable = true;
}
+/**
+ * hb_font_is_immutable:
+ * @font: a font.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_font_is_immutable (hb_font_t *font)
{
return font->immutable;
}
+/**
+ * hb_font_get_parent:
+ * @font: a font.
+ *
+ *
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
hb_font_t *
hb_font_get_parent (hb_font_t *font)
{
return font->parent;
}
+/**
+ * hb_font_get_face:
+ * @font: a font.
+ *
+ *
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
hb_face_t *
hb_font_get_face (hb_font_t *font)
{
@@ -651,6 +1090,17 @@ hb_font_get_face (hb_font_t *font)
}
+/**
+ * hb_font_set_funcs:
+ * @font: a font.
+ * @klass:
+ * @user_data:
+ * @destroy:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_set_funcs (hb_font_t *font,
hb_font_funcs_t *klass,
@@ -676,6 +1126,16 @@ hb_font_set_funcs (hb_font_t *font,
font->destroy = destroy;
}
+/**
+ * hb_font_set_funcs_data:
+ * @font: a font.
+ * @user_data:
+ * @destroy:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_set_funcs_data (hb_font_t *font,
void *user_data,
@@ -696,6 +1156,16 @@ hb_font_set_funcs_data (hb_font_t *font,
}
+/**
+ * hb_font_set_scale:
+ * @font: a font.
+ * @x_scale:
+ * @y_scale:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_set_scale (hb_font_t *font,
int x_scale,
@@ -708,6 +1178,16 @@ hb_font_set_scale (hb_font_t *font,
font->y_scale = y_scale;
}
+/**
+ * hb_font_get_scale:
+ * @font: a font.
+ * @x_scale: (out):
+ * @y_scale: (out):
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_get_scale (hb_font_t *font,
int *x_scale,
@@ -717,6 +1197,16 @@ hb_font_get_scale (hb_font_t *font,
if (y_scale) *y_scale = font->y_scale;
}
+/**
+ * hb_font_set_ppem:
+ * @font: a font.
+ * @x_ppem:
+ * @y_ppem:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_set_ppem (hb_font_t *font,
unsigned int x_ppem,
@@ -729,6 +1219,16 @@ hb_font_set_ppem (hb_font_t *font,
font->y_ppem = y_ppem;
}
+/**
+ * hb_font_get_ppem:
+ * @font: a font.
+ * @x_ppem: (out):
+ * @y_ppem: (out):
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_font_get_ppem (hb_font_t *font,
unsigned int *x_ppem,
diff --git a/src/hb-set.cc b/src/hb-set.cc
index 054eb5a..161924e 100644
--- a/src/hb-set.cc
+++ b/src/hb-set.cc
@@ -53,7 +53,7 @@ hb_set_create (void)
/**
* hb_set_get_empty:
*
- * Return value: (transfer none):
+ * Return value: (transfer full):
*
* Since: 1.0
**/
diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc
index a6d2d26..4e734d7 100644
--- a/src/hb-shape-plan.cc
+++ b/src/hb-shape-plan.cc
@@ -83,6 +83,20 @@ hb_shape_plan_plan (hb_shape_plan_t *shape_plan,
* hb_shape_plan_t
*/
+/**
+ * hb_shape_plan_create: (constructor)
+ * @face:
+ * @props:
+ * @user_features: (array length=num_user_features):
+ * @num_user_features:
+ * @shaper_list: (array zero-terminated=1):
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_shape_plan_t *
hb_shape_plan_create (hb_face_t *face,
const hb_segment_properties_t *props,
@@ -111,6 +125,15 @@ hb_shape_plan_create (hb_face_t *face,
return shape_plan;
}
+/**
+ * hb_shape_plan_get_empty:
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_shape_plan_t *
hb_shape_plan_get_empty (void)
{
@@ -134,12 +157,30 @@ hb_shape_plan_get_empty (void)
return const_cast<hb_shape_plan_t *> (&_hb_shape_plan_nil);
}
+/**
+ * hb_shape_plan_reference: (skip)
+ * @shape_plan: a shape plan.
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_shape_plan_t *
hb_shape_plan_reference (hb_shape_plan_t *shape_plan)
{
return hb_object_reference (shape_plan);
}
+/**
+ * hb_shape_plan_destroy: (skip)
+ * @shape_plan: a shape plan.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_shape_plan_destroy (hb_shape_plan_t *shape_plan)
{
@@ -154,6 +195,20 @@ hb_shape_plan_destroy (hb_shape_plan_t *shape_plan)
free (shape_plan);
}
+/**
+ * hb_shape_plan_set_user_data: (skip)
+ * @shape_plan: a shape plan.
+ * @key:
+ * @data:
+ * @destroy:
+ * @replace:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_shape_plan_set_user_data (hb_shape_plan_t *shape_plan,
hb_user_data_key_t *key,
@@ -164,6 +219,17 @@ hb_shape_plan_set_user_data (hb_shape_plan_t *shape_plan,
return hb_object_set_user_data (shape_plan, key, data, destroy, replace);
}
+/**
+ * hb_shape_plan_get_user_data: (skip)
+ * @shape_plan: a shape plan.
+ * @key:
+ *
+ *
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
void *
hb_shape_plan_get_user_data (hb_shape_plan_t *shape_plan,
hb_user_data_key_t *key)
@@ -172,6 +238,20 @@ hb_shape_plan_get_user_data (hb_shape_plan_t *shape_plan,
}
+/**
+ * hb_shape_plan_execute:
+ * @shape_plan: a shape plan.
+ * @font: a font.
+ * @buffer: a buffer.
+ * @features: (array length=num_features):
+ * @num_features:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_shape_plan_execute (hb_shape_plan_t *shape_plan,
hb_font_t *font,
@@ -238,6 +318,20 @@ hb_shape_plan_matches (const hb_shape_plan_t *shape_plan,
(shape_plan->shaper_func == proposal->shaper_func));
}
+/**
+ * hb_shape_plan_create_cached:
+ * @face:
+ * @props:
+ * @user_features: (array length=num_user_features):
+ * @num_user_features:
+ * @shaper_list: (array zero-terminated=1):
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_shape_plan_t *
hb_shape_plan_create_cached (hb_face_t *face,
const hb_segment_properties_t *props,
@@ -307,6 +401,16 @@ retry:
return hb_shape_plan_reference (shape_plan);
}
+/**
+ * hb_shape_plan_get_shaper:
+ * @shape_plan: a shape plan.
+ *
+ *
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
const char *
hb_shape_plan_get_shaper (hb_shape_plan_t *shape_plan)
{
diff --git a/src/hb-shape.cc b/src/hb-shape.cc
index 80d8c13..c1b7524 100644
--- a/src/hb-shape.cc
+++ b/src/hb-shape.cc
@@ -153,6 +153,18 @@ parse_one_feature (const char **pp, const char *end, hb_feature_t *feature)
*pp == end;
}
+/**
+ * hb_feature_from_string:
+ * @str: (array length=len):
+ * @len:
+ * @feature: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_feature_from_string (const char *str, int len,
hb_feature_t *feature)
@@ -163,6 +175,16 @@ hb_feature_from_string (const char *str, int len,
return parse_one_feature (&str, str + len, feature);
}
+/**
+ * hb_feature_to_string:
+ * @feature:
+ * @buf: (array length=size):
+ * @size:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_feature_to_string (hb_feature_t *feature,
char *buf, unsigned int size)
@@ -209,6 +231,15 @@ void free_static_shaper_list (void)
free (static_shaper_list);
}
+/**
+ * hb_shape_list_shapers:
+ *
+ *
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
const char **
hb_shape_list_shapers (void)
{
@@ -244,6 +275,20 @@ retry:
}
+/**
+ * hb_shape_full:
+ * @font: a font.
+ * @buffer: a buffer.
+ * @features: (array length=num_features):
+ * @num_features:
+ * @shaper_list: (array zero-terminated=1):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_shape_full (hb_font_t *font,
hb_buffer_t *buffer,
@@ -265,6 +310,17 @@ hb_shape_full (hb_font_t *font,
return res;
}
+/**
+ * hb_shape:
+ * @font: a font.
+ * @buffer: a buffer.
+ * @features: (array length=num_features):
+ * @num_features:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_shape (hb_font_t *font,
hb_buffer_t *buffer,
diff --git a/src/hb-unicode.cc b/src/hb-unicode.cc
index b7e0987..807d5c1 100644
--- a/src/hb-unicode.cc
+++ b/src/hb-unicode.cc
@@ -150,6 +150,16 @@ hb_unicode_funcs_get_default (void)
#pragma message("To suppress this warnings, define HB_NO_UNICODE_FUNCS.")
#endif
+/**
+ * hb_unicode_funcs_create: (constructor)
+ * @parent: (allow-none):
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_unicode_funcs_t *
hb_unicode_funcs_create (hb_unicode_funcs_t *parent)
{
@@ -187,18 +197,45 @@ const hb_unicode_funcs_t _hb_unicode_funcs_nil = {
}
};
+/**
+ * hb_unicode_funcs_get_empty:
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_unicode_funcs_t *
hb_unicode_funcs_get_empty (void)
{
return const_cast<hb_unicode_funcs_t *> (&_hb_unicode_funcs_nil);
}
+/**
+ * hb_unicode_funcs_reference: (skip)
+ * @ufuncs: Unicode functions.
+ *
+ *
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_unicode_funcs_t *
hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs)
{
return hb_object_reference (ufuncs);
}
+/**
+ * hb_unicode_funcs_destroy: (skip)
+ * @ufuncs: Unicode functions.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs)
{
@@ -214,6 +251,20 @@ hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs)
free (ufuncs);
}
+/**
+ * hb_unicode_funcs_set_user_data: (skip)
+ * @ufuncs: Unicode functions.
+ * @key:
+ * @data:
+ * @destroy:
+ * @replace:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs,
hb_user_data_key_t *key,
@@ -224,6 +275,17 @@ hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs,
return hb_object_set_user_data (ufuncs, key, data, destroy, replace);
}
+/**
+ * hb_unicode_funcs_get_user_data: (skip)
+ * @ufuncs: Unicode functions.
+ * @key:
+ *
+ *
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
void *
hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs,
hb_user_data_key_t *key)
@@ -232,6 +294,14 @@ hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs,
}
+/**
+ * hb_unicode_funcs_make_immutable:
+ * @ufuncs: Unicode functions.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs)
{
@@ -241,12 +311,32 @@ hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs)
ufuncs->immutable = true;
}
+/**
+ * hb_unicode_funcs_is_immutable:
+ * @ufuncs: Unicode functions.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs)
{
return ufuncs->immutable;
}
+/**
+ * hb_unicode_funcs_get_parent:
+ * @ufuncs: Unicode functions.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_unicode_funcs_t *
hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs)
{
@@ -294,6 +384,19 @@ hb_unicode_##name (hb_unicode_funcs_t *ufuncs, \
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
#undef HB_UNICODE_FUNC_IMPLEMENT
+/**
+ * hb_unicode_compose:
+ * @ufuncs: Unicode functions.
+ * @a:
+ * @b:
+ * @ab: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_unicode_compose (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t a,
@@ -303,6 +406,19 @@ hb_unicode_compose (hb_unicode_funcs_t *ufuncs,
return ufuncs->compose (a, b, ab);
}
+/**
+ * hb_unicode_decompose:
+ * @ufuncs: Unicode functions.
+ * @ab:
+ * @a: (out):
+ * @b: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_unicode_decompose (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t ab,
@@ -312,6 +428,18 @@ hb_unicode_decompose (hb_unicode_funcs_t *ufuncs,
return ufuncs->decompose (ab, a, b);
}
+/**
+ * hb_unicode_decompose_compatibility:
+ * @ufuncs: Unicode functions.
+ * @u:
+ * @decomposed: (out):
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
unsigned int
hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t u,
commit 17905c54f1bab9e6dfe13f59f5ec208de12832f7
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Fri Sep 6 16:57:01 2013 -0400
[introspection] Work around g-i limitation with hb_language_t
diff --git a/src/hb-gobject-structs.cc b/src/hb-gobject-structs.cc
index 6525542..2451b66 100644
--- a/src/hb-gobject-structs.cc
+++ b/src/hb-gobject-structs.cc
@@ -94,10 +94,6 @@ static hb_glyph_position_t *glyph_position_reference (hb_glyph_position_t *g)
static void glyph_position_destroy (hb_glyph_position_t *g) { free (g); }
HB_DEFINE_BOXED_TYPE (glyph_position, glyph_position_reference, glyph_position_destroy)
-static hb_language_t language_reference (hb_language_t l) { return l; }
-static void language_destroy (hb_language_t l) { }
-HB_DEFINE_BOXED_TYPE (language, language_reference, language_destroy)
-
static hb_segment_properties_t *segment_properties_reference (hb_segment_properties_t *g)
{
hb_segment_properties_t *c = (hb_segment_properties_t *) calloc (1, sizeof (hb_segment_properties_t));
@@ -111,3 +107,14 @@ HB_DEFINE_BOXED_TYPE (segment_properties, segment_properties_reference, segment_
static hb_user_data_key_t user_data_key_reference (hb_user_data_key_t l) { return l; }
static void user_data_key_destroy (hb_user_data_key_t l) { }
HB_DEFINE_BOXED_TYPE (user_data_key, user_data_key_reference, user_data_key_destroy)
+
+
+static hb_language_t *language_reference (hb_language_t *l)
+{
+ hb_language_t *c = (hb_language_t *) calloc (1, sizeof (hb_language_t));
+ if (unlikely (!c)) return NULL;
+ *c = *l;
+ return c;
+}
+static void language_destroy (hb_language_t *l) { free (l); }
+HB_DEFINE_BOXED_TYPE (language, language_reference, language_destroy)
diff --git a/src/hb-gobject-structs.h b/src/hb-gobject-structs.h
index 48af088..4a88d56 100644
--- a/src/hb-gobject-structs.h
+++ b/src/hb-gobject-structs.h
@@ -81,6 +81,14 @@ GType hb_gobject_segment_properties_get_type (void);
GType hb_gobject_user_data_key_get_type (void);
#define HB_GOBJECT_TYPE_USER_DATA_KEY (hb_gobject_user_data_key_get_type ())
+/* Currently gobject-introspection doesn't understand that hb_language_t
+ * can be passed by-value. As such we box it up. May remove in the
+ * future.
+ *
+ * https://bugzilla.gnome.org/show_bug.cgi?id=707656
+ */
+GType hb_gobject_language_get_type (void);
+#define HB_GOBJECT_TYPE_LANGUAGE (hb_gobject_language_get_type ())
HB_END_DECLS
commit cd361c3cbe4a288e3019b9a029f44e4c5f24436c
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Fri Sep 6 16:20:21 2013 -0400
Minor change to hb_language_t
Let me know if this breaks anyone's anything.
diff --git a/src/hb-common.cc b/src/hb-common.cc
index 7c6d262..666d77d 100644
--- a/src/hb-common.cc
+++ b/src/hb-common.cc
@@ -187,7 +187,7 @@ struct hb_language_item_t {
return *this;
}
- void finish (void) { free (lang); }
+ void finish (void) { free ((void *) lang); }
};
diff --git a/src/hb-common.h b/src/hb-common.h
index 9079b2c..40c1887 100644
--- a/src/hb-common.h
+++ b/src/hb-common.h
@@ -131,7 +131,7 @@ hb_direction_to_string (hb_direction_t direction);
/* hb_language_t */
-typedef struct hb_language_impl_t *hb_language_t;
+typedef const struct hb_language_impl_t *hb_language_t;
/* len=-1 means str is NUL-terminated */
hb_language_t
commit 20cbc1f8eb0811e6cefa3be3550e80df9c372782
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Fri Sep 6 15:29:22 2013 -0400
Annotate hb-set a bit; add HB_SET_VALUE_INVALID
diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh
index adfa88f..ca2a07b 100644
--- a/src/hb-set-private.hh
+++ b/src/hb-set-private.hh
@@ -171,7 +171,7 @@ struct hb_set_t
inline void add (hb_codepoint_t g)
{
if (unlikely (in_error)) return;
- if (unlikely (g == SENTINEL)) return;
+ if (unlikely (g == INVALID)) return;
if (unlikely (g > MAX_G)) return;
elt (g) |= mask (g);
}
@@ -256,19 +256,22 @@ struct hb_set_t
}
inline bool next (hb_codepoint_t *codepoint) const
{
- if (unlikely (*codepoint == SENTINEL)) {
+ if (unlikely (*codepoint == INVALID)) {
hb_codepoint_t i = get_min ();
- if (i != SENTINEL) {
+ if (i != INVALID) {
*codepoint = i;
return true;
- } else
+ } else {
+ *codepoint = INVALID;
return false;
+ }
}
for (hb_codepoint_t i = *codepoint + 1; i < MAX_G + 1; i++)
if (has (i)) {
*codepoint = i;
return true;
}
+ *codepoint = INVALID;
return false;
}
inline bool next_range (hb_codepoint_t *first, hb_codepoint_t *last) const
@@ -277,7 +280,10 @@ struct hb_set_t
i = *last;
if (!next (&i))
+ {
+ *last = *first = INVALID;
return false;
+ }
*last = *first = i;
while (next (&i) && i == *last + 1)
@@ -300,7 +306,7 @@ struct hb_set_t
for (unsigned int j = 0; j < BITS; j++)
if (elts[i] & (1 << j))
return i * BITS + j;
- return SENTINEL;
+ return INVALID;
}
inline hb_codepoint_t get_max (void) const
{
@@ -309,7 +315,7 @@ struct hb_set_t
for (unsigned int j = BITS; j; j--)
if (elts[i - 1] & (1 << (j - 1)))
return (i - 1) * BITS + (j - 1);
- return SENTINEL;
+ return INVALID;
}
typedef uint32_t elt_t;
@@ -318,7 +324,7 @@ struct hb_set_t
static const unsigned int BITS = (1 << SHIFT);
static const unsigned int MASK = BITS - 1;
static const unsigned int ELTS = (MAX_G + 1 + (BITS - 1)) / BITS;
- static const hb_codepoint_t SENTINEL = (hb_codepoint_t) -1;
+ static const hb_codepoint_t INVALID = HB_SET_VALUE_INVALID;
elt_t &elt (hb_codepoint_t g) { return elts[g >> SHIFT]; }
elt_t elt (hb_codepoint_t g) const { return elts[g >> SHIFT]; }
diff --git a/src/hb-set.cc b/src/hb-set.cc
index 3c9573f..054eb5a 100644
--- a/src/hb-set.cc
+++ b/src/hb-set.cc
@@ -30,6 +30,13 @@
/* Public API */
+/**
+ * hb_set_create: (constructor)
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_set_t *
hb_set_create (void)
{
@@ -43,6 +50,13 @@ hb_set_create (void)
return set;
}
+/**
+ * hb_set_get_empty:
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
hb_set_t *
hb_set_get_empty (void)
{
@@ -56,12 +70,26 @@ hb_set_get_empty (void)
return const_cast<hb_set_t *> (&_hb_set_nil);
}
+/**
+ * hb_set_reference: (skip)
+ * @set: a set.
+ *
+ * Return value: (transfer full):
+ *
+ * Since: 1.0
+ **/
hb_set_t *
hb_set_reference (hb_set_t *set)
{
return hb_object_reference (set);
}
+/**
+ * hb_set_destroy: (skip)
+ * @set: a set.
+ *
+ * Since: 1.0
+ **/
void
hb_set_destroy (hb_set_t *set)
{
@@ -72,6 +100,18 @@ hb_set_destroy (hb_set_t *set)
free (set);
}
+/**
+ * hb_set_set_user_data: (skip)
+ * @set: a set.
+ * @key:
+ * @data:
+ * @destroy (closure data):
+ * @replace:
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_set_set_user_data (hb_set_t *set,
hb_user_data_key_t *key,
@@ -82,6 +122,15 @@ hb_set_set_user_data (hb_set_t *set,
return hb_object_set_user_data (set, key, data, destroy, replace);
}
+/**
+ * hb_set_get_user_data: (skip)
+ * @set: a set.
+ * @key:
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 1.0
+ **/
void *
hb_set_get_user_data (hb_set_t *set,
hb_user_data_key_t *key)
@@ -90,24 +139,63 @@ hb_set_get_user_data (hb_set_t *set,
}
+/**
+ * hb_set_allocation_successful:
+ * @set: a set.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_set_allocation_successful (const hb_set_t *set HB_UNUSED)
{
return !set->in_error;
}
+/**
+ * hb_set_clear:
+ * @set: a set.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_set_clear (hb_set_t *set)
{
set->clear ();
}
+/**
+ * hb_set_is_empty:
+ * @set: a set.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_set_is_empty (const hb_set_t *set)
{
return set->is_empty ();
}
+/**
+ * hb_set_has:
+ * @set: a set.
+ * @codepoint:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_set_has (const hb_set_t *set,
hb_codepoint_t codepoint)
@@ -115,6 +203,15 @@ hb_set_has (const hb_set_t *set,
return set->has (codepoint);
}
+/**
+ * hb_set_add:
+ * @set: a set.
+ * @codepoint:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_set_add (hb_set_t *set,
hb_codepoint_t codepoint)
@@ -122,6 +219,16 @@ hb_set_add (hb_set_t *set,
set->add (codepoint);
}
+/**
+ * hb_set_add_range:
+ * @set: a set.
+ * @first:
+ * @last:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_set_add_range (hb_set_t *set,
hb_codepoint_t first,
@@ -130,6 +237,15 @@ hb_set_add_range (hb_set_t *set,
set->add_range (first, last);
}
+/**
+ * hb_set_del:
+ * @set: a set.
+ * @codepoint:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_set_del (hb_set_t *set,
hb_codepoint_t codepoint)
@@ -137,6 +253,16 @@ hb_set_del (hb_set_t *set,
set->del (codepoint);
}
+/**
+ * hb_set_del_range:
+ * @set: a set.
+ * @first:
+ * @last:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_set_del_range (hb_set_t *set,
hb_codepoint_t first,
@@ -145,6 +271,17 @@ hb_set_del_range (hb_set_t *set,
set->del_range (first, last);
}
+/**
+ * hb_set_is_equal:
+ * @set: a set.
+ * @other:
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_set_is_equal (const hb_set_t *set,
const hb_set_t *other)
@@ -152,6 +289,15 @@ hb_set_is_equal (const hb_set_t *set,
return set->is_equal (other);
}
+/**
+ * hb_set_set:
+ * @set: a set.
+ * @other:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_set_set (hb_set_t *set,
const hb_set_t *other)
@@ -159,6 +305,15 @@ hb_set_set (hb_set_t *set,
set->set (other);
}
+/**
+ * hb_set_union:
+ * @set: a set.
+ * @other:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_set_union (hb_set_t *set,
const hb_set_t *other)
@@ -166,6 +321,15 @@ hb_set_union (hb_set_t *set,
set->union_ (other);
}
+/**
+ * hb_set_intersect:
+ * @set: a set.
+ * @other:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_set_intersect (hb_set_t *set,
const hb_set_t *other)
@@ -173,6 +337,15 @@ hb_set_intersect (hb_set_t *set,
set->intersect (other);
}
+/**
+ * hb_set_subtract:
+ * @set: a set.
+ * @other:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_set_subtract (hb_set_t *set,
const hb_set_t *other)
@@ -180,6 +353,15 @@ hb_set_subtract (hb_set_t *set,
set->subtract (other);
}
+/**
+ * hb_set_symmetric_difference:
+ * @set: a set.
+ * @other:
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_set_symmetric_difference (hb_set_t *set,
const hb_set_t *other)
@@ -187,30 +369,79 @@ hb_set_symmetric_difference (hb_set_t *set,
set->symmetric_difference (other);
}
+/**
+ * hb_set_invert:
+ * @set: a set.
+ *
+ *
+ *
+ * Since: 1.0
+ **/
void
hb_set_invert (hb_set_t *set)
{
set->invert ();
}
+/**
+ * hb_set_get_population:
+ * @set: a set.
+ *
+ * Returns the number of numbers in the set.
+ *
+ * Return value: set population.
+ *
+ * Since: 1.0
+ **/
unsigned int
hb_set_get_population (const hb_set_t *set)
{
return set->get_population ();
}
+/**
+ * hb_set_get_min:
+ * @set: a set.
+ *
+ * Finds the minimum number in the set.
+ *
+ * Return value: minimum of the set, or %HB_SET_VALUE_INVALID if set is empty.
+ *
+ * Since: 1.0
+ **/
hb_codepoint_t
hb_set_get_min (const hb_set_t *set)
{
return set->get_min ();
}
+/**
+ * hb_set_get_max:
+ * @set: a set.
+ *
+ * Finds the maximum number in the set.
+ *
+ * Return value: minimum of the set, or %HB_SET_VALUE_INVALID if set is empty.
+ *
+ * Since: 1.0
+ **/
hb_codepoint_t
hb_set_get_max (const hb_set_t *set)
{
return set->get_max ();
}
+/**
+ * hb_set_next:
+ * @set: a set.
+ * @codepoint: (inout):
+ *
+ *
+ *
+ * Return value: whether there was a next value.
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_set_next (const hb_set_t *set,
hb_codepoint_t *codepoint)
@@ -218,6 +449,19 @@ hb_set_next (const hb_set_t *set,
return set->next (codepoint);
}
+/**
+ * hb_set_next_range:
+ * @set: a set.
+ * @first: (out): output first codepoint in the range.
+ * @last: (inout): input current last and output last codepoint in the range.
+ *
+ * Gets the next consecutive range of numbers in @set that
+ * are greater than current value of @last.
+ *
+ * Return value: whether there was a next range.
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_set_next_range (const hb_set_t *set,
hb_codepoint_t *first,
diff --git a/src/hb-set.h b/src/hb-set.h
index 291e249..bafdae9 100644
--- a/src/hb-set.h
+++ b/src/hb-set.h
@@ -36,6 +36,8 @@
HB_BEGIN_DECLS
+#define HB_SET_VALUE_INVALID ((hb_codepoint_t) -1)
+
typedef struct hb_set_t hb_set_t;
diff --git a/src/hb-version.h.in b/src/hb-version.h.in
index c7e9d98..17276fb 100644
--- a/src/hb-version.h.in
+++ b/src/hb-version.h.in
@@ -56,7 +56,7 @@ HB_BEGIN_DECLS
* Returns library version as three integer components.
*
* Since: 1.0
- */
+ **/
void
hb_version (unsigned int *major,
unsigned int *minor,
@@ -67,8 +67,10 @@ hb_version (unsigned int *major,
*
* Returns library version as a string with three components.
*
+ * Return value: library version string.
+ *
* Since: 1.0
- */
+ **/
const char *
hb_version_string (void);
diff --git a/test/api/test-set.c b/test/api/test-set.c
index 90d0437..8c4eafd 100644
--- a/test/api/test-set.c
+++ b/test/api/test-set.c
@@ -32,24 +32,24 @@
static void
test_empty (hb_set_t *s)
{
- hb_codepoint_t next = (hb_codepoint_t) -1;
+ hb_codepoint_t next = HB_SET_VALUE_INVALID;
g_assert_cmpint (hb_set_get_population (s), ==, 0);
- g_assert_cmpint (hb_set_get_min (s), ==, (hb_codepoint_t) -1);
- g_assert_cmpint (hb_set_get_max (s), ==, (hb_codepoint_t) -1);
+ g_assert_cmpint (hb_set_get_min (s), ==, HB_SET_VALUE_INVALID);
+ g_assert_cmpint (hb_set_get_max (s), ==, HB_SET_VALUE_INVALID);
g_assert (!hb_set_has (s, 13));
g_assert (!hb_set_next (s, &next));
- g_assert_cmpint (next, ==, (hb_codepoint_t) -1);
+ g_assert_cmpint (next, ==, HB_SET_VALUE_INVALID);
}
static void
test_not_empty (hb_set_t *s)
{
- hb_codepoint_t next = (hb_codepoint_t) -1;
+ hb_codepoint_t next = HB_SET_VALUE_INVALID;
g_assert_cmpint (hb_set_get_population (s), !=, 0);
- g_assert_cmpint (hb_set_get_min (s), !=, (hb_codepoint_t) -1);
- g_assert_cmpint (hb_set_get_max (s), !=, (hb_codepoint_t) -1);
+ g_assert_cmpint (hb_set_get_min (s), !=, HB_SET_VALUE_INVALID);
+ g_assert_cmpint (hb_set_get_max (s), !=, HB_SET_VALUE_INVALID);
g_assert (hb_set_next (s, &next));
- g_assert_cmpint (next, !=, (hb_codepoint_t) -1);
+ g_assert_cmpint (next, !=, HB_SET_VALUE_INVALID);
}
static void
@@ -166,7 +166,7 @@ test_set_iter (void)
test_not_empty (s);
- next = (hb_codepoint_t) -1;
+ next = HB_SET_VALUE_INVALID;
g_assert (hb_set_next (s, &next));
g_assert_cmpint (next, ==, 6);
g_assert (hb_set_next (s, &next));
@@ -181,9 +181,9 @@ test_set_iter (void)
g_assert (hb_set_next (s, &next));
g_assert_cmpint (next, ==, 20005);
g_assert (!hb_set_next (s, &next));
- g_assert_cmpint (next, ==, 20005);
+ g_assert_cmpint (next, ==, HB_SET_VALUE_INVALID);
- first = last = (hb_codepoint_t) -1;
+ first = last = HB_SET_VALUE_INVALID;
g_assert (hb_set_next_range (s, &first, &last));
g_assert_cmpint (first, ==, 6);
g_assert_cmpint (last, ==, 6);
@@ -194,8 +194,8 @@ test_set_iter (void)
g_assert_cmpint (first, ==, 20005);
g_assert_cmpint (last, ==, 20005);
g_assert (!hb_set_next_range (s, &first, &last));
- g_assert_cmpint (first, ==, 20005);
- g_assert_cmpint (last, ==, 20005);
+ g_assert_cmpint (first, ==, HB_SET_VALUE_INVALID);
+ g_assert_cmpint (last, ==, HB_SET_VALUE_INVALID);
}
static void
commit c44b81833d5bfb9a926d348a76463314c3ec2018
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Fri Sep 6 15:13:16 2013 -0400
Whitespace
diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index 495e702..2bfdfad 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -862,7 +862,7 @@ hb_buffer_set_length (hb_buffer_t *buffer,
* Return value: buffer length.
*
* Since: 1.0
- */
+ **/
unsigned int
hb_buffer_get_length (hb_buffer_t *buffer)
{
@@ -880,7 +880,7 @@ hb_buffer_get_length (hb_buffer_t *buffer)
* Return value: (transfer none) (array length=length): buffer glyph information array.
*
* Since: 1.0
- */
+ **/
hb_glyph_info_t *
hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
unsigned int *length)
@@ -902,7 +902,7 @@ hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
* Return value: (transfer none) (array length=length): buffer glyph position array.
*
* Since: 1.0
- */
+ **/
hb_glyph_position_t *
hb_buffer_get_glyph_positions (hb_buffer_t *buffer,
unsigned int *length)
@@ -923,7 +923,7 @@ hb_buffer_get_glyph_positions (hb_buffer_t *buffer,
* Reverses buffer contents.
*
* Since: 1.0
- */
+ **/
void
hb_buffer_reverse (hb_buffer_t *buffer)
{
@@ -939,7 +939,7 @@ hb_buffer_reverse (hb_buffer_t *buffer)
* same cluster number) are reversed again.
*
* Since: 1.0
- */
+ **/
void
hb_buffer_reverse_clusters (hb_buffer_t *buffer)
{
@@ -969,7 +969,7 @@ hb_buffer_reverse_clusters (hb_buffer_t *buffer)
* taking buffer script into consideration when choosing a language.
*
* Since: 1.0
- */
+ **/
void
hb_buffer_guess_segment_properties (hb_buffer_t *buffer)
{
More information about the HarfBuzz
mailing list