Merge pull request #1676 from n8willis/docs-gtkdoc-core

[Docs] Add gtkdoc comments for low-level core APIs
This commit is contained in:
Khaled Hosny 2020-12-26 01:16:32 +02:00 committed by GitHub
commit 462b71eaf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 1709 additions and 910 deletions

View File

@ -359,6 +359,8 @@ hb_font_get_font_h_extents_func_t
hb_font_get_font_v_extents_func_t
hb_font_get_h_extents
hb_font_get_v_extents
hb_font_extents_t
hb_glyph_extents_t
</SECTION>
<SECTION>

View File

@ -58,7 +58,7 @@
* @length: Length of @data in bytes.
* @mode: Memory mode for @data.
* @user_data: Data parameter to pass to @destroy.
* @destroy: Callback to call when @data is not needed anymore.
* @destroy: (optional): 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.
@ -156,7 +156,7 @@ hb_blob_create_sub_blob (hb_blob_t *parent,
*
* Makes a writable copy of @blob.
*
* Return value: New blob, or nullptr if allocation failed.
* Return value: The new blob, or nullptr if allocation failed
*
* Since: 1.8.0
**/
@ -182,7 +182,7 @@ hb_blob_copy_writable_or_fail (hb_blob_t *blob)
*
* See TODO:link object types for more information.
*
* Return value: (transfer full): the empty blob.
* Return value: (transfer full): The empty blob.
*
* Since: 0.9.2
**/
@ -234,13 +234,15 @@ hb_blob_destroy (hb_blob_t *blob)
/**
* 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.
* @blob: An #hb_blob_t
* @key: The user-data key to set
* @data: A pointer to the user data to set
* @destroy: (optional): A callback to call when @data is not needed anymore
* @replace: Whether to replace an existing data with the same key
*
* Return value:
* Attaches a user-data key/data pair to the specified blob.
*
* Return value: %true if success, %false otherwise
*
* Since: 0.9.2
**/
@ -256,12 +258,13 @@ hb_blob_set_user_data (hb_blob_t *blob,
/**
* hb_blob_get_user_data: (skip)
* @blob: a blob.
* @key: key for data to get.
* @blob: a blob
* @key: The user-data key to query
*
* Fetches the user data associated with the specified key,
* attached to the specified font-functions structure.
*
*
* Return value: (transfer none):
* Return value: (transfer none): A pointer to the user data
*
* Since: 0.9.2
**/
@ -275,9 +278,9 @@ hb_blob_get_user_data (hb_blob_t *blob,
/**
* hb_blob_make_immutable:
* @blob: a blob.
*
* @blob: a blob
*
* Makes a blob immutable.
*
* Since: 0.9.2
**/
@ -294,9 +297,9 @@ hb_blob_make_immutable (hb_blob_t *blob)
* hb_blob_is_immutable:
* @blob: a blob.
*
* Tests whether a blob is immutable.
*
*
* Return value: TODO
* Return value: %true if @blob is immutable, false otherwise
*
* Since: 0.9.2
**/
@ -311,9 +314,9 @@ hb_blob_is_immutable (hb_blob_t *blob)
* hb_blob_get_length:
* @blob: a blob.
*
* Fetches the length of a blob's data.
*
*
* Return value: the length of blob data in bytes.
* Return value: the length of @blob data in bytes.
*
* Since: 0.9.2
**/
@ -326,11 +329,11 @@ hb_blob_get_length (hb_blob_t *blob)
/**
* hb_blob_get_data:
* @blob: a blob.
* @length: (out):
* @length: (out): The length in bytes of the data retrieved
*
* Fetches the data from a blob.
*
*
* Returns: (transfer none) (array length=length):
* Returns: (transfer none) (array length=length): the byte data of @blob.
*
* Since: 0.9.2
**/
@ -558,9 +561,12 @@ _open_resource_fork (const char *file_name, hb_mapped_file_t *file)
/**
* hb_blob_create_from_file:
* @file_name: font filename.
* @file_name: A font filename
*
* Returns: A hb_blob_t pointer with the content of the file
* Creates a new blob containing the data from the
* specified binary font file.
*
* Returns: An #hb_blob_t pointer with the content of the file
*
* Since: 1.7.7
**/

View File

@ -36,25 +36,34 @@
HB_BEGIN_DECLS
/*
* Note re various memory-modes:
/**
* hb_memory_mode_t:
* @HB_MEMORY_MODE_DUPLICATE
* @HB_MEMORY_MODE_READONLY
* @HB_MEMORY_MODE_WRITABLE
* @HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE
*
* Data type holding the memory modes available to
* client programs.
*
* Regarding these various memory-modes:
*
* - In no case shall the HarfBuzz client modify memory
* that is passed to HarfBuzz in a blob. If there is
* any such possibility, MODE_DUPLICATE should be used
* any such possibility, @HB_MEMORY_MODE_DUPLICATE should be used
* such that HarfBuzz makes a copy immediately,
*
* - Use MODE_READONLY otherwise, unless you really really
* - Use @HB_MEMORY_MODE_READONLY otherwise, unless you really really
* really know what you are doing,
*
* - MODE_WRITABLE is appropriate if you really made a
* - @HB_MEMORY_MODE_WRITABLE is appropriate if you really made a
* copy of data solely for the purpose of passing to
* HarfBuzz and doing that just once (no reuse!),
*
* - If the font is mmap()ed, it's ok to use
* READONLY_MAY_MAKE_WRITABLE, however, using that mode
* correctly is very tricky. Use MODE_READONLY instead.
*/
* - If the font is mmap()ed, it's okay to use
* @HB_MEMORY_READONLY_MAY_MAKE_WRITABLE, however, using that mode
* correctly is very tricky. Use @HB_MEMORY_MODE_READONLY instead.
**/
typedef enum {
HB_MEMORY_MODE_DUPLICATE,
HB_MEMORY_MODE_READONLY,
@ -62,6 +71,14 @@ typedef enum {
HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE
} hb_memory_mode_t;
/**
* hb_blob_t:
*
* Data type for blobs. A blob wraps a chunk of binary
* data and facilitates its lifecycle management between
* a client program and HarfBuzz.
*
**/
typedef struct hb_blob_t hb_blob_t;
HB_EXTERN hb_blob_t *

View File

@ -37,8 +37,9 @@
* @short_description: Input and output buffers
* @include: hb.h
*
* Buffers serve dual role in HarfBuzz; they hold the input characters that are
* passed to hb_shape(), and after shaping they hold the output glyphs.
* Buffers serve a dual role in HarfBuzz; before shaping, they hold
* the input characters that are passed to hb_shape(), and after
* shaping they hold the output glyphs.
**/
@ -705,9 +706,9 @@ hb_buffer_create ()
/**
* hb_buffer_get_empty:
*
* Fetches an empty #hb_buffer_t.
*
*
* Return value: (transfer full):
* Return value: (transfer full): The empty buffer
*
* Since: 0.9.2
**/
@ -719,7 +720,7 @@ hb_buffer_get_empty ()
/**
* hb_buffer_reference: (skip)
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Increases the reference count on @buffer by one. This prevents @buffer from
* being destroyed until a matching call to hb_buffer_destroy() is made.
@ -737,7 +738,7 @@ hb_buffer_reference (hb_buffer_t *buffer)
/**
* hb_buffer_destroy: (skip)
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Deallocate the @buffer.
* Decreases the reference count on @buffer by one. If the result is zero, then
@ -764,15 +765,15 @@ hb_buffer_destroy (hb_buffer_t *buffer)
/**
* hb_buffer_set_user_data: (skip)
* @buffer: an #hb_buffer_t.
* @key:
* @data:
* @destroy:
* @replace:
* @buffer: An #hb_buffer_t
* @key: The user-data key
* @data: A pointer to the user data
* @destroy: (optional): A callback to call when @data is not needed anymore
* @replace: Whether to replace an existing data with the same key
*
* Attaches a user-data key/data pair to the specified buffer.
*
*
* Return value:
* Return value: %true if success, %false otherwise
*
* Since: 0.9.2
**/
@ -788,12 +789,13 @@ hb_buffer_set_user_data (hb_buffer_t *buffer,
/**
* hb_buffer_get_user_data: (skip)
* @buffer: an #hb_buffer_t.
* @key:
* @buffer: An #hb_buffer_t
* @key: The user-data key to query
*
* Fetches the user data associated with the specified key,
* attached to the specified buffer.
*
*
* Return value:
* Return value: (transfer-none): A pointer to the user data
*
* Since: 0.9.2
**/
@ -807,11 +809,11 @@ hb_buffer_get_user_data (hb_buffer_t *buffer,
/**
* hb_buffer_set_content_type:
* @buffer: an #hb_buffer_t.
* @content_type: the type of buffer contents to set
* @buffer: An #hb_buffer_t
* @content_type: The type of buffer contents to set
*
* Sets the type of @buffer contents, buffers are either empty, contain
* characters (before shaping) or glyphs (the result of shaping).
* Sets the type of @buffer contents. Buffers are either empty, contain
* characters (before shaping), or contain glyphs (the result of shaping).
*
* Since: 0.9.5
**/
@ -824,12 +826,13 @@ hb_buffer_set_content_type (hb_buffer_t *buffer,
/**
* hb_buffer_get_content_type:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* see hb_buffer_set_content_type().
* Fetches the type of @buffer contents. Buffers are either empty, contain
* characters (before shaping), or contain glyphs (the result of shaping).
*
* Return value:
* The type of @buffer contents.
* The type of @buffer contents
*
* Since: 0.9.5
**/
@ -842,10 +845,11 @@ hb_buffer_get_content_type (hb_buffer_t *buffer)
/**
* hb_buffer_set_unicode_funcs:
* @buffer: an #hb_buffer_t.
* @unicode_funcs:
*
* @buffer: An #hb_buffer_t
* @unicode_funcs: The Unicode-functions structure
*
* Sets the Unicode-functions structure of a buffer to
* @unicode_funcs.
*
* Since: 0.9.2
**/
@ -866,11 +870,11 @@ hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
/**
* hb_buffer_get_unicode_funcs:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Fetches the Unicode-functions structure of a buffer.
*
*
* Return value:
* Return value: The Unicode-functions structure
*
* Since: 0.9.2
**/
@ -882,7 +886,7 @@ hb_buffer_get_unicode_funcs (hb_buffer_t *buffer)
/**
* hb_buffer_set_direction:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @direction: the #hb_direction_t of the @buffer
*
* Set the text flow direction of the buffer. No shaping can happen without
@ -908,7 +912,7 @@ hb_buffer_set_direction (hb_buffer_t *buffer,
/**
* hb_buffer_get_direction:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_direction()
*
@ -925,8 +929,8 @@ hb_buffer_get_direction (hb_buffer_t *buffer)
/**
* hb_buffer_set_script:
* @buffer: an #hb_buffer_t.
* @script: an #hb_script_t to set.
* @buffer: An #hb_buffer_t
* @script: An #hb_script_t to set.
*
* Sets the script of @buffer to @script.
*
@ -952,12 +956,12 @@ hb_buffer_set_script (hb_buffer_t *buffer,
/**
* hb_buffer_get_script:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_script().
* Fetches the script of @buffer.
*
* Return value:
* The #hb_script_t of the @buffer.
* The #hb_script_t of the @buffer
*
* Since: 0.9.2
**/
@ -969,8 +973,8 @@ hb_buffer_get_script (hb_buffer_t *buffer)
/**
* hb_buffer_set_language:
* @buffer: an #hb_buffer_t.
* @language: an hb_language_t to set.
* @buffer: An #hb_buffer_t
* @language: An hb_language_t to set
*
* Sets the language of @buffer to @language.
*
@ -996,7 +1000,7 @@ hb_buffer_set_language (hb_buffer_t *buffer,
/**
* hb_buffer_get_language:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_language().
*
@ -1013,8 +1017,8 @@ hb_buffer_get_language (hb_buffer_t *buffer)
/**
* hb_buffer_set_segment_properties:
* @buffer: an #hb_buffer_t.
* @props: an #hb_segment_properties_t to use.
* @buffer: An #hb_buffer_t
* @props: An #hb_segment_properties_t to use
*
* Sets the segment properties of the buffer, a shortcut for calling
* hb_buffer_set_direction(), hb_buffer_set_script() and
@ -1034,8 +1038,8 @@ hb_buffer_set_segment_properties (hb_buffer_t *buffer,
/**
* hb_buffer_get_segment_properties:
* @buffer: an #hb_buffer_t.
* @props: (out): the output #hb_segment_properties_t.
* @buffer: An #hb_buffer_t
* @props: (out): The output #hb_segment_properties_t
*
* Sets @props to the #hb_segment_properties_t of @buffer.
*
@ -1051,8 +1055,8 @@ hb_buffer_get_segment_properties (hb_buffer_t *buffer,
/**
* hb_buffer_set_flags:
* @buffer: an #hb_buffer_t.
* @flags: the buffer flags to set.
* @buffer: An #hb_buffer_t
* @flags: The buffer flags to set
*
* Sets @buffer flags to @flags. See #hb_buffer_flags_t.
*
@ -1070,12 +1074,12 @@ hb_buffer_set_flags (hb_buffer_t *buffer,
/**
* hb_buffer_get_flags:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_flags().
* Fetches the #hb_buffer_flags_t of @buffer.
*
* Return value:
* The @buffer flags.
* The @buffer flags
*
* Since: 0.9.7
**/
@ -1087,10 +1091,12 @@ hb_buffer_get_flags (hb_buffer_t *buffer)
/**
* hb_buffer_set_cluster_level:
* @buffer: an #hb_buffer_t.
* @cluster_level:
*
* @buffer: An #hb_buffer_t
* @cluster_level: The cluster level to set on the buffer
*
* Sets the cluster level of a buffer. The #hb_buffer_cluster_level_t
* dictates one aspect of how HarfBuzz will treat non-base characters
* during shaping.
*
* Since: 0.9.42
**/
@ -1106,11 +1112,13 @@ hb_buffer_set_cluster_level (hb_buffer_t *buffer,
/**
* hb_buffer_get_cluster_level:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Fetches the cluster level of a buffer. The #hb_buffer_cluster_level_t
* dictates one aspect of how HarfBuzz will treat non-base characters
* during shaping.
*
*
* Return value:
* Return value: The cluster level of @buffer
*
* Since: 0.9.42
**/
@ -1123,7 +1131,7 @@ hb_buffer_get_cluster_level (hb_buffer_t *buffer)
/**
* hb_buffer_set_replacement_codepoint:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @replacement: the replacement #hb_codepoint_t
*
* Sets the #hb_codepoint_t that replaces invalid entries for a given encoding
@ -1145,12 +1153,13 @@ hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer,
/**
* hb_buffer_get_replacement_codepoint:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_replacement_codepoint().
* Fetches the #hb_codepoint_t that replaces invalid entries for a given encoding
* when adding text to @buffer.
*
* Return value:
* The @buffer replacement #hb_codepoint_t.
* The @buffer replacement #hb_codepoint_t
*
* Since: 0.9.31
**/
@ -1163,7 +1172,7 @@ hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer)
/**
* hb_buffer_set_invisible_glyph:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @invisible: the invisible #hb_codepoint_t
*
* Sets the #hb_codepoint_t that replaces invisible characters in
@ -1185,12 +1194,12 @@ hb_buffer_set_invisible_glyph (hb_buffer_t *buffer,
/**
* hb_buffer_get_invisible_glyph:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_invisible_glyph().
*
* Return value:
* The @buffer invisible #hb_codepoint_t.
* The @buffer invisible #hb_codepoint_t
*
* Since: 2.0.0
**/
@ -1203,7 +1212,7 @@ hb_buffer_get_invisible_glyph (hb_buffer_t *buffer)
/**
* hb_buffer_reset:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Resets the buffer to its initial status, as if it was just newly created
* with hb_buffer_create().
@ -1218,7 +1227,7 @@ hb_buffer_reset (hb_buffer_t *buffer)
/**
* hb_buffer_clear_contents:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Similar to hb_buffer_reset(), but does not clear the Unicode functions and
* the replacement code point.
@ -1233,13 +1242,13 @@ hb_buffer_clear_contents (hb_buffer_t *buffer)
/**
* hb_buffer_pre_allocate:
* @buffer: an #hb_buffer_t.
* @size: number of items to pre allocate.
* @buffer: An #hb_buffer_t
* @size: Number of items to pre allocate.
*
* Pre allocates memory for @buffer to fit at least @size number of items.
*
* Return value:
* %true if @buffer memory allocation succeeded, %false otherwise.
* %true if @buffer memory allocation succeeded, %false otherwise
*
* Since: 0.9.2
**/
@ -1251,7 +1260,7 @@ hb_buffer_pre_allocate (hb_buffer_t *buffer, unsigned int size)
/**
* hb_buffer_allocation_successful:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Check if allocating memory for the buffer succeeded.
*
@ -1268,9 +1277,9 @@ hb_buffer_allocation_successful (hb_buffer_t *buffer)
/**
* hb_buffer_add:
* @buffer: an #hb_buffer_t.
* @codepoint: a Unicode code point.
* @cluster: the cluster value of @codepoint.
* @buffer: An #hb_buffer_t
* @codepoint: A Unicode code point.
* @cluster: The cluster value of @codepoint.
*
* Appends a character with the Unicode value of @codepoint to @buffer, and
* gives it the initial cluster value of @cluster. Clusters can be any thing
@ -1294,8 +1303,8 @@ hb_buffer_add (hb_buffer_t *buffer,
/**
* hb_buffer_set_length:
* @buffer: an #hb_buffer_t.
* @length: the new length of @buffer.
* @buffer: An #hb_buffer_t
* @length: The new length of @buffer
*
* Similar to hb_buffer_pre_allocate(), but clears any new items added at the
* end.
@ -1336,7 +1345,7 @@ hb_buffer_set_length (hb_buffer_t *buffer,
/**
* hb_buffer_get_length:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Returns the number of items in the buffer.
*
@ -1354,8 +1363,8 @@ hb_buffer_get_length (hb_buffer_t *buffer)
/**
* hb_buffer_get_glyph_infos:
* @buffer: an #hb_buffer_t.
* @length: (out): output array length.
* @buffer: An #hb_buffer_t
* @length: (out): The output-array length.
*
* Returns @buffer glyph information array. Returned pointer
* is valid as long as @buffer contents are not modified.
@ -1378,8 +1387,8 @@ hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
/**
* hb_buffer_get_glyph_positions:
* @buffer: an #hb_buffer_t.
* @length: (out): output length.
* @buffer: An #hb_buffer_t
* @length: (out): The output length
*
* Returns @buffer glyph position array. Returned pointer
* is valid as long as @buffer contents are not modified.
@ -1424,12 +1433,12 @@ hb_buffer_has_positions (hb_buffer_t *buffer)
/**
* hb_glyph_info_get_glyph_flags:
* @info: a #hb_glyph_info_t.
* @info: a #hb_glyph_info_t
*
* Returns glyph flags encoded within a #hb_glyph_info_t.
*
* Return value:
* The #hb_glyph_flags_t encoded within @info.
* The #hb_glyph_flags_t encoded within @info
*
* Since: 1.5.0
**/
@ -1441,7 +1450,7 @@ hb_glyph_flags_t
/**
* hb_buffer_reverse:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Reverses buffer contents.
*
@ -1455,11 +1464,11 @@ hb_buffer_reverse (hb_buffer_t *buffer)
/**
* hb_buffer_reverse_range:
* @buffer: an #hb_buffer_t.
* @start: start index.
* @end: end index.
* @buffer: An #hb_buffer_t
* @start: start index
* @end: end index
*
* Reverses buffer contents between start to end.
* Reverses buffer contents between @start and @end.
*
* Since: 0.9.41
**/
@ -1472,7 +1481,7 @@ hb_buffer_reverse_range (hb_buffer_t *buffer,
/**
* hb_buffer_reverse_clusters:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Reverses buffer clusters. That is, the buffer contents are
* reversed, then each cluster (consecutive items having the
@ -1488,7 +1497,7 @@ hb_buffer_reverse_clusters (hb_buffer_t *buffer)
/**
* hb_buffer_guess_segment_properties:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Sets unset buffer segment properties based on buffer Unicode
* contents. If buffer is not empty, it must have content type
@ -1590,12 +1599,12 @@ hb_buffer_add_utf (hb_buffer_t *buffer,
/**
* hb_buffer_add_utf8:
* @buffer: an #hb_buffer_t.
* @text: (array length=text_length) (element-type uint8_t): an array of UTF-8
* @buffer: An #hb_buffer_t
* @text: (array length=text_length) (element-type uint8_t): An array of UTF-8
* characters to append.
* @text_length: the length of the @text, or -1 if it is %NULL terminated.
* @item_offset: the offset of the first character to add to the @buffer.
* @item_length: the number of characters to add to the @buffer, or -1 for the
* @text_length: The length of the @text, or -1 if it is %NULL terminated.
* @item_offset: The offset of the first character to add to the @buffer.
* @item_length: The number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated).
*
* See hb_buffer_add_codepoints().
@ -1617,12 +1626,12 @@ hb_buffer_add_utf8 (hb_buffer_t *buffer,
/**
* hb_buffer_add_utf16:
* @buffer: an #hb_buffer_t.
* @text: (array length=text_length): an array of UTF-16 characters to append.
* @text_length: the length of the @text, or -1 if it is %NULL terminated.
* @item_offset: the offset of the first character to add to the @buffer.
* @item_length: the number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated).
* @buffer: An #hb_buffer_t
* @text: (array length=text_length): An array of UTF-16 characters to append
* @text_length: The length of the @text, or -1 if it is %NULL terminated
* @item_offset: The offset of the first character to add to the @buffer
* @item_length: The number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated)
*
* See hb_buffer_add_codepoints().
*
@ -1643,12 +1652,12 @@ hb_buffer_add_utf16 (hb_buffer_t *buffer,
/**
* hb_buffer_add_utf32:
* @buffer: an #hb_buffer_t.
* @text: (array length=text_length): an array of UTF-32 characters to append.
* @text_length: the length of the @text, or -1 if it is %NULL terminated.
* @item_offset: the offset of the first character to add to the @buffer.
* @item_length: the number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated).
* @buffer: An #hb_buffer_t
* @text: (array length=text_length): An array of UTF-32 characters to append
* @text_length: The length of the @text, or -1 if it is %NULL terminated
* @item_offset: The offset of the first character to add to the @buffer
* @item_length: The number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated)
*
* See hb_buffer_add_codepoints().
*
@ -1669,13 +1678,13 @@ hb_buffer_add_utf32 (hb_buffer_t *buffer,
/**
* hb_buffer_add_latin1:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @text: (array length=text_length) (element-type uint8_t): an array of UTF-8
* characters to append.
* @text_length: the length of the @text, or -1 if it is %NULL terminated.
* @item_offset: the offset of the first character to add to the @buffer.
* characters to append
* @text_length: the length of the @text, or -1 if it is %NULL terminated
* @item_offset: the offset of the first character to add to the @buffer
* @item_length: the number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated).
* end of @text (assuming it is %NULL terminated)
*
* Similar to hb_buffer_add_codepoints(), but allows only access to first 256
* Unicode code points that can fit in 8-bit strings.
@ -1731,8 +1740,8 @@ hb_buffer_add_codepoints (hb_buffer_t *buffer,
/**
* hb_buffer_append:
* @buffer: an #hb_buffer_t.
* @source: source #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @source: source #hb_buffer_t
* @start: start index into source buffer to copy. Use 0 to copy from start of buffer.
* @end: end index into source buffer to copy. Use @HB_FEATURE_GLOBAL_END to copy to end of buffer.
*
@ -1838,7 +1847,7 @@ normalize_glyphs_cluster (hb_buffer_t *buffer,
/**
* hb_buffer_normalize_glyphs:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Reorders a glyph buffer to have canonical in-cluster glyph order / position.
* The resulting clusters should behave identical to pre-reordering clusters.
@ -1984,7 +1993,7 @@ hb_buffer_diff (hb_buffer_t *buffer,
#ifndef HB_NO_BUFFER_MESSAGE
/**
* hb_buffer_set_message_func:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:

View File

@ -315,6 +315,23 @@ hb_buffer_get_flags (hb_buffer_t *buffer);
* @HB_BUFFER_CLUSTER_LEVEL_DEFAULT: Default cluster level,
* equal to @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES.
*
* Data type for holding HarfBuzz's clustering behavior options. The cluster level
* dictates one aspect of how HarfBuzz will treat non-base characters
* during shaping.
*
* In @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES, non-base
* characters are merged into the cluster of the base character that precedes them.
*
* In @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS, non-base characters are initially
* assigned their own cluster values, which are not merged into preceding base
* clusters. This allows HarfBuzz to perform additional operations like reorder
* sequences of adjacent marks.
*
* @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES is the default, because it maintains
* backward compatibility with older versions of HarfBuzz. New client programs that
* do not need to maintain such backward compatibility are recommended to use
* @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS instead of the default.
*
* Since: 0.9.42
*/
typedef enum {

View File

@ -86,12 +86,15 @@ _hb_options_init ()
/**
* hb_tag_from_string:
* @str: (array length=len) (element-type uint8_t):
* @len:
* @str: (array length=len) (element-type uint8_t): String to convert
* @len: Length of @str, or -1 if it is %NULL-terminated
*
* Converts a string into an #hb_tag_t. Valid tags
* are four characters. Shorter input strings will be
* padded with spaces. Longer input strings will be
* truncated.
*
*
* Return value:
* Return value: The #hb_tag_t corresponding to @str
*
* Since: 0.9.2
**/
@ -116,10 +119,11 @@ hb_tag_from_string (const char *str, int len)
/**
* hb_tag_to_string:
* @tag:
* @buf: (out caller-allocates) (array fixed-size=4) (element-type uint8_t):
*
* @tag: #hb_tag_t to convert
* @buf: (out caller-allocates) (array fixed-size=4) (element-type uint8_t): Converted string
*
* Converts an #hb_tag_t to a string and returns it in @buf.
* Strings will be four characters long.
*
* Since: 0.9.5
**/
@ -144,12 +148,17 @@ const char direction_strings[][4] = {
/**
* hb_direction_from_string:
* @str: (array length=len) (element-type uint8_t):
* @len:
* @str: (array length=len) (element-type uint8_t): String to convert
* @len: Length of @str, or -1 if it is %NULL-terminated
*
* Converts a string to an #hb_direction_t.
*
* Matching is loose and applies only to the first letter. For
* examples, "LTR" and "left-to-right" will both return #HB_DIRECTION_LTR.
*
* Return value:
* Unmatched strings will return #HB_DIRECTION_INVALID.
*
* Return value: The #hb_direction_t matching @str
*
* Since: 0.9.2
**/
@ -172,11 +181,11 @@ hb_direction_from_string (const char *str, int len)
/**
* hb_direction_to_string:
* @direction:
* @direction: The #hb_direction_t to convert
*
* Converts an #hb_direction_t to a string.
*
*
* Return value: (transfer none):
* Return value: (transfer none): The string corresponding to @direction
*
* Since: 0.9.2
**/
@ -367,9 +376,9 @@ hb_language_from_string (const char *str, int len)
/**
* hb_language_to_string:
* @language: an #hb_language_t to convert.
* @language: The #hb_language_t to convert
*
* See hb_language_from_string().
* Converts an #hb_language_t to a string.
*
* Return value: (transfer none):
* A %NULL-terminated string representing the @language. Must not be freed by
@ -388,16 +397,17 @@ hb_language_to_string (hb_language_t language)
/**
* hb_language_get_default:
*
* Get default language from current locale.
* Fetch the default language from current locale.
*
* Note that the first time this function is called, it calls
* <note>Note that the first time this function is called, it calls
* "setlocale (LC_CTYPE, nullptr)" to fetch current locale. The underlying
* setlocale function is, in many implementations, NOT threadsafe. To avoid
* problems, call this function once before multiple threads can call it.
* This function is only used from hb_buffer_guess_segment_properties() by
* HarfBuzz itself.
* HarfBuzz itself.</note>
*
* Return value: (transfer none):
* Return value: (transfer none): The default language of the locale as
* an #hb_language_t
*
* Since: 0.9.2
**/
@ -494,7 +504,7 @@ hb_script_from_string (const char *str, int len)
* hb_script_to_iso15924_tag:
* @script: an #hb_script_t to convert.
*
* See hb_script_from_iso15924_tag().
* Converts an #hb_script_t to a corresponding ISO 15924 script tag.
*
* Return value:
* An #hb_tag_t representing an ISO 15924 script tag.
@ -509,11 +519,16 @@ hb_script_to_iso15924_tag (hb_script_t script)
/**
* hb_script_get_horizontal_direction:
* @script:
* @script: The #hb_script_t to query
*
* Fetches the #hb_direction_t of a script when it is
* set horizontally. All right-to-left scripts will return
* #HB_DIRECTION_RTL. All left-to-right scripts will return
* #HB_DIRECTION_LTR. Scripts that can be written either
* horizontally or vertically will return #HB_DIRECTION_INVALID.
* Unknown scripts will return #HB_DIRECTION_LTR.
*
*
* Return value:
* Return value: The horizontal #hb_direction_t of @script
*
* Since: 0.9.2
**/
@ -618,9 +633,9 @@ hb_script_get_horizontal_direction (hb_script_t script)
/**
* hb_version:
* @major: (out): Library major version component.
* @minor: (out): Library minor version component.
* @micro: (out): Library micro version component.
* @major: (out): Library major version component
* @minor: (out): Library minor version component
* @micro: (out): Library micro version component
*
* Returns library version as three integer components.
*
@ -641,7 +656,7 @@ hb_version (unsigned int *major,
*
* Returns library version as a string with three components.
*
* Return value: library version string.
* Return value: Library version string
*
* Since: 0.9.2
**/
@ -653,13 +668,15 @@ hb_version_string ()
/**
* hb_version_atleast:
* @major:
* @minor:
* @micro:
* @major: Library major version component
* @minor: Library minor version component
* @micro: Library micro version component
*
* Tests the library version against a minimum value,
* as three integer components.
*
*
* Return value:
* Return value: True if the library is equal to or greater than
* the test value, false otherwise
*
* Since: 0.9.30
**/
@ -888,7 +905,7 @@ parse_one_feature (const char **pp, const char *end, hb_feature_t *feature)
* </informaltable>
*
* Return value:
* %true if @str is successfully parsed, %false otherwise.
* %true if @str is successfully parsed, %false otherwise
*
* Since: 0.9.5
**/

View File

@ -88,11 +88,37 @@ typedef unsigned __int64 uint64_t;
HB_BEGIN_DECLS
/**
* hb_bool_t:
*
* Data type for booleans.
*
**/
typedef int hb_bool_t;
/**
* hb_codepoint_t:
*
* Data type for holding Unicode codepoints. Also
* used to hold glyph IDs.
*
**/
typedef uint32_t hb_codepoint_t;
/**
* hb_position_t:
*
* Data type for holding a single coordinate value.
* Contour points and other multi-dimensional data are
* stored as tuples of #hb_position_t's.
*
**/
typedef int32_t hb_position_t;
/**
* hb_mask_t:
*
* Data type for bitmasks.
*
**/
typedef uint32_t hb_mask_t;
typedef union _hb_var_int_t {
@ -107,9 +133,33 @@ typedef union _hb_var_int_t {
/* hb_tag_t */
/**
* hb_tag_t:
*
* Data type for tag identifiers. Tags are four
* byte integers, each byte representing a character.
*
* Tags are used to identify tables, design-variation axes,
* scripts, languages, font features, and baselines with
* human-readable names.
*
**/
typedef uint32_t hb_tag_t;
/**
* HB_TAG:
*
* Constructs an #hb_tag_t from four characters.
*
**/
#define HB_TAG(c1,c2,c3,c4) ((hb_tag_t)((((uint32_t)(c1)&0xFF)<<24)|(((uint32_t)(c2)&0xFF)<<16)|(((uint32_t)(c3)&0xFF)<<8)|((uint32_t)(c4)&0xFF)))
/**
* HB_UNTAG:
*
* Extracts the characters from an #hb_tag_t.
*
**/
#define HB_UNTAG(tag) (uint8_t)(((tag)>>24)&0xFF), (uint8_t)(((tag)>>16)&0xFF), (uint8_t)(((tag)>>8)&0xFF), (uint8_t)((tag)&0xFF)
#define HB_TAG_NONE HB_TAG(0,0,0,0)
@ -132,6 +182,13 @@ hb_tag_to_string (hb_tag_t tag, char *buf);
* @HB_DIRECTION_RTL: Text is set horizontally from right to left.
* @HB_DIRECTION_TTB: Text is set vertically from top to bottom.
* @HB_DIRECTION_BTT: Text is set vertically from bottom to top.
*
* The direction of a text segment or buffer.
*
* A segment can also be tested for horizontal or vertical
* orientation (irrespective of specific direction) with
* HB_DIRECTION_IS_HORIZONTAL() or HB_DIRECTION_IS_VERTICAL().
*
*/
typedef enum {
HB_DIRECTION_INVALID = 0,
@ -148,12 +205,59 @@ hb_direction_from_string (const char *str, int len);
HB_EXTERN const char *
hb_direction_to_string (hb_direction_t direction);
/**
* HB_DIRECTION_IS_VALID:
* @dir: #hb_direction_t to test
*
* Tests whether a text direction is valid.
*
**/
#define HB_DIRECTION_IS_VALID(dir) ((((unsigned int) (dir)) & ~3U) == 4)
/* Direction must be valid for the following */
/**
* HB_DIRECTION_IS_HORIZONTAL:
* @dir: #hb_direction_t to test
*
* Tests whether a text direction is horizontal. Requires
* that the direction be valid.
*
**/
#define HB_DIRECTION_IS_HORIZONTAL(dir) ((((unsigned int) (dir)) & ~1U) == 4)
/**
* HB_DIRECTION_IS_VERTICAL:
* @dir: #hb_direction_t to test
*
* Tests whether a text direction is vertical. Requires
* that the direction be valid.
*
**/
#define HB_DIRECTION_IS_VERTICAL(dir) ((((unsigned int) (dir)) & ~1U) == 6)
/**
* HB_DIRECTION_IS_FORWARD:
* @dir: #hb_direction_t to test
*
* Tests whether a text direction moves forward (from left to right, or from
* top to bottom). Requires that the direction be valid.
*
**/
#define HB_DIRECTION_IS_FORWARD(dir) ((((unsigned int) (dir)) & ~2U) == 4)
/**
* HB_DIRECTION_IS_BACKWARD:
* @dir: #hb_direction_t to test
*
* Tests whether a text direction moves backward (from right to left, or from
* bottom to top). Requires that the direction be valid.
*
**/
#define HB_DIRECTION_IS_BACKWARD(dir) ((((unsigned int) (dir)) & ~2U) == 5)
/**
* HB_DIRECTION_REVERSE:
* @dir: #hb_direction_t to reverse
*
* Reverses a text direction. Requires that the direction
* be valid.
*
**/
#define HB_DIRECTION_REVERSE(dir) ((hb_direction_t) (((unsigned int) (dir)) ^ 1))
@ -173,7 +277,169 @@ HB_EXTERN hb_language_t
hb_language_get_default (void);
/* hb_script_t */
/**
* hb_script_t:
* @HB_SCRIPT_COMMON: HB_TAG ('Z','y','y','y')
* @HB_SCRIPT_INHERITED: HB_TAG ('Z','i','n','h')
* @HB_SCRIPT_UNKNOWN: HB_TAG ('Z','z','z','z')
* @HB_SCRIPT_ARABIC
* @HB_SCRIPT_ARMENIAN
* @HB_SCRIPT_BENGALI
* @HB_SCRIPT_CYRILLIC
* @HB_SCRIPT_DEVANAGARI
* @HB_SCRIPT_GEORGIAN
* @HB_SCRIPT_GREEK
* @HB_SCRIPT_GUJARATI
* @HB_SCRIPT_GURMUKHI
* @HB_SCRIPT_HANGUL
* @HB_SCRIPT_HAN
* @HB_SCRIPT_HEBREW
* @HB_SCRIPT_HIRAGANA
* @HB_SCRIPT_KANNADA
* @HB_SCRIPT_KATAKANA
* @HB_SCRIPT_LAO
* @HB_SCRIPT_LATIN
* @HB_SCRIPT_MALAYALAM
* @HB_SCRIPT_ORIYA
* @HB_SCRIPT_TAMIL
* @HB_SCRIPT_TELUGU
* @HB_SCRIPT_THAI
* @HB_SCRIPT_TIBETAN
* @HB_SCRIPT_BOPOMOFO
* @HB_SCRIPT_BRAILLE
* @HB_SCRIPT_CANADIAN_SYLLABICS
* @HB_SCRIPT_CHEROKEE
* @HB_SCRIPT_ETHIOPIC
* @HB_SCRIPT_KHMER
* @HB_SCRIPT_MONGOLIAN
* @HB_SCRIPT_MYANMAR
* @HB_SCRIPT_OGHAM
* @HB_SCRIPT_RUNIC
* @HB_SCRIPT_SINHALA
* @HB_SCRIPT_SYRIAC
* @HB_SCRIPT_THAANA
* @HB_SCRIPT_YI
* @HB_SCRIPT_DESERET
* @HB_SCRIPT_GOTHIC
* @HB_SCRIPT_OLD_ITALIC
* @HB_SCRIPT_BUHID
* @HB_SCRIPT_HANUNOO
* @HB_SCRIPT_TAGALOG
* @HB_SCRIPT_TAGBANWA
* @HB_SCRIPT_CYPRIOT
* @HB_SCRIPT_LIMBU
* @HB_SCRIPT_LINEAR_B
* @HB_SCRIPT_OSMANYA
* @HB_SCRIPT_SHAVIAN
* @HB_SCRIPT_TAI_LE
* @HB_SCRIPT_UGARITIC
* @HB_SCRIPT_BUGINESE
* @HB_SCRIPT_COPTIC
* @HB_SCRIPT_GLAGOLITIC
* @HB_SCRIPT_KHAROSHTHI
* @HB_SCRIPT_NEW_TAI_LUE
* @HB_SCRIPT_OLD_PERSIAN
* @HB_SCRIPT_SYLOTI_NAGRI
* @HB_SCRIPT_TIFINAGH
* @HB_SCRIPT_BALINESE
* @HB_SCRIPT_CUNEIFORM
* @HB_SCRIPT_NKO
* @HB_SCRIPT_PHAGS_PA
* @HB_SCRIPT_PHOENICIAN
* @HB_SCRIPT_CARIAN
* @HB_SCRIPT_CHAM
* @HB_SCRIPT_KAYAH_LI
* @HB_SCRIPT_LEPCHA
* @HB_SCRIPT_LYCIAN
* @HB_SCRIPT_LYDIAN
* @HB_SCRIPT_OL_CHIKI
* @HB_SCRIPT_REJANG
* @HB_SCRIPT_SAURASHTRA
* @HB_SCRIPT_SUNDANESE
* @HB_SCRIPT_VAI
* @HB_SCRIPT_AVESTAN
* @HB_SCRIPT_BAMUM
* @HB_SCRIPT_EGYPTIAN_HIEROGLYPHS
* @HB_SCRIPT_IMPERIAL_ARAMAIC
* @HB_SCRIPT_INSCRIPTIONAL_PAHLAVI
* @HB_SCRIPT_INSCRIPTIONAL_PARTHIAN
* @HB_SCRIPT_JAVANESE
* @HB_SCRIPT_KAITHI
* @HB_SCRIPT_LISU
* @HB_SCRIPT_MEETEI_MAYEK
* @HB_SCRIPT_OLD_SOUTH_ARABIAN
* @HB_SCRIPT_OLD_TURKIC
* @HB_SCRIPT_SAMARITAN
* @HB_SCRIPT_TAI_THAM
* @HB_SCRIPT_TAI_VIET
* @HB_SCRIPT_BATAK
* @HB_SCRIPT_BRAHMI
* @HB_SCRIPT_MANDAIC
* @HB_SCRIPT_CHAKMA
* @HB_SCRIPT_MEROITIC_CURSIVE
* @HB_SCRIPT_MEROITIC_HIEROGLYPHS
* @HB_SCRIPT_MIAO
* @HB_SCRIPT_SHARADA
* @HB_SCRIPT_SORA_SOMPENG
* @HB_SCRIPT_TAKRI
* @HB_SCRIPT_BASSA_VAH
* @HB_SCRIPT_CAUCASIAN_ALBANIAN
* @HB_SCRIPT_DUPLOYAN
* @HB_SCRIPT_ELBASAN
* @HB_SCRIPT_GRANTHA
* @HB_SCRIPT_KHOJKI
* @HB_SCRIPT_KHUDAWADI
* @HB_SCRIPT_LINEAR_A
* @HB_SCRIPT_MAHAJANI
* @HB_SCRIPT_MANICHAEAN
* @HB_SCRIPT_MENDE_KIKAKUI
* @HB_SCRIPT_MODI
* @HB_SCRIPT_MRO
* @HB_SCRIPT_NABATAEAN
* @HB_SCRIPT_OLD_NORTH_ARABIAN
* @HB_SCRIPT_OLD_PERMIC
* @HB_SCRIPT_PAHAWH_HMONG
* @HB_SCRIPT_PALMYRENE
* @HB_SCRIPT_PAU_CIN_HAU
* @HB_SCRIPT_PSALTER_PAHLAVI
* @HB_SCRIPT_SIDDHAM
* @HB_SCRIPT_TIRHUTA
* @HB_SCRIPT_WARANG_CITI
* @HB_SCRIPT_AHOM
* @HB_SCRIPT_ANATOLIAN_HIEROGLYPHS
* @HB_SCRIPT_HATRAN
* @HB_SCRIPT_MULTANI
* @HB_SCRIPT_OLD_HUNGARIAN
* @HB_SCRIPT_SIGNWRITING
* @HB_SCRIPT_ADLAM
* @HB_SCRIPT_BHAIKSUKI
* @HB_SCRIPT_MARCHEN
* @HB_SCRIPT_OSAGE
* @HB_SCRIPT_TANGUT
* @HB_SCRIPT_NEWA
* @HB_SCRIPT_MASARAM_GONDI
* @HB_SCRIPT_NUSHU
* @HB_SCRIPT_SOYOMBO
* @HB_SCRIPT_ZANABAZAR_SQUARE
* @HB_SCRIPT_DOGRA
* @HB_SCRIPT_GUNJALA_GONDI
* @HB_SCRIPT_HANIFI_ROHINGYA
* @HB_SCRIPT_MAKASAR
* @HB_SCRIPT_MEDEFAIDRIN
* @HB_SCRIPT_OLD_SOGDIAN
* @HB_SCRIPT_SOGDIAN
* @HB_SCRIPT_ELYMAIC
* @HB_SCRIPT_NANDINAGARI
* @HB_SCRIPT_NYIAKENG_PUACHUE_HMONG
* @HB_SCRIPT_WANCHO
* @HB_SCRIPT_INVALID: #HB_TAG_NONE
*
* Data type for scripts. Each #hb_script_t's value is an #hb_tag_t corresponding
* to the four-letter values defined by [ISO 15924](https://unicode.org/iso15924/).
*
* See also the Script (sc) property of the Unicode Character Database.
*
**/
/* https://unicode.org/iso15924/ */
/* https://docs.google.com/spreadsheets/d/1Y90M0Ie3MUJ6UVCRDOypOtijlMDLNNyyLk36T6iMu0o */
@ -410,6 +676,12 @@ hb_script_get_horizontal_direction (hb_script_t script);
/* User data */
/**
* hb_user_data_key_t:
*
* Data structure for holding user-data keys.
*
**/
typedef struct hb_user_data_key_t {
/*< private >*/
char unused;
@ -435,10 +707,10 @@ typedef void (*hb_destroy_func_t) (void *user_data);
/**
* hb_feature_t:
* @tag: a feature tag
* @value: 0 disables the feature, non-zero (usually 1) enables the feature.
* For features implemented as lookup type 3 (like 'salt') the @value is a one
* based index into the alternates.
* @tag: The #hb_tag_t tag of the feature
* @value: The value of the feature. 0 disables the feature, non-zero (usually
* 1) enables the feature. For features implemented as lookup type 3 (like
* 'salt') the @value is a one based index into the alternates.
* @start: the cluster to start applying this feature setting (inclusive).
* @end: the cluster to end applying this feature setting (exclusive).
*
@ -465,6 +737,12 @@ hb_feature_to_string (hb_feature_t *feature,
/**
* hb_variation_t:
* @tag: The #hb_tag_t tag of the variation-axis name
* @value: The value of the variation axis
*
* Data type for holding variation data. Registered OpenType
* variation-axis tags are listed at
* https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg
*
* Since: 1.4.2
*/
@ -484,7 +762,8 @@ hb_variation_to_string (hb_variation_t *variation,
/**
* hb_color_t:
*
* Data type for holding color values.
* Data type for holding color values. Colors are eight bits per
* channel RGB plus alpha transparency.
*
* Since: 2.1.0
*/

View File

@ -304,7 +304,7 @@ hb_face_destroy (hb_face_t *face)
*
* Attaches a user-data key/data pair to the given face object.
*
* Return value: %true if success, false otherwise
* Return value: %true if success, %false otherwise
*
* Since: 0.9.2
**/

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,19 @@ typedef struct hb_font_t hb_font_t;
* hb_font_funcs_t
*/
/**
* hb_font_funcs_t:
*
* Data type containing a set of virtual methods used for
* working on #hb_font_t font objects.
*
* HarfBuzz provides a lightweight default function for each of
* the methods in #hb_font_funcs_t. Client programs can implement
* their own replacements for the individual font functions, as
* needed, and replace the default by calling the setter for a
* method.
*
**/
typedef struct hb_font_funcs_t hb_font_funcs_t;
HB_EXTERN hb_font_funcs_t *
@ -81,11 +94,21 @@ hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs);
/* font and glyph extents */
/* Note that typically ascender is positive and descender negative in coordinate systems that grow up. */
/**
* hb_font_extents_t:
* @ascender: The height of typographic ascenders.
* @descender: The depth of typographic descenders.
* @line_gap: The suggested line-spacing gap.
*
* Font-wide extent values, measured in font units.
*
* Note that typically @ascender is positive and @descender
* negative, in coordinate systems that grow up.
**/
typedef struct hb_font_extents_t {
hb_position_t ascender; /* typographic ascender. */
hb_position_t descender; /* typographic descender. */
hb_position_t line_gap; /* suggested line spacing gap. */
hb_position_t ascender;
hb_position_t descender;
hb_position_t line_gap;
/*< private >*/
hb_position_t reserved9;
hb_position_t reserved8;
@ -98,12 +121,22 @@ typedef struct hb_font_extents_t {
hb_position_t reserved1;
} hb_font_extents_t;
/* Note that height is negative in coordinate systems that grow up. */
/**
* hb_glyph_extents_t:
* @x_bearing: Distance from the x-origin to the left extremum of the glyph.
* @y_bearing: Distance from the top extremum of the glyph to the y-origin.
* @width: Distance from the left extremum of the glyph to the right extremum.
* @height: Distance from the top extremum of the glyph to the bottom extremum.
*
* Glyph extent values, measured in font units.
*
* Note that @height is negative, in coordinate systems that grow up.
**/
typedef struct hb_glyph_extents_t {
hb_position_t x_bearing; /* left side of glyph from origin. */
hb_position_t y_bearing; /* top side of glyph from origin. */
hb_position_t width; /* distance from left to right side. */
hb_position_t height; /* distance from top to bottom side. */
hb_position_t x_bearing;
hb_position_t y_bearing;
hb_position_t width;
hb_position_t height;
} hb_glyph_extents_t;
/* func types */
@ -111,19 +144,72 @@ typedef struct hb_glyph_extents_t {
typedef hb_bool_t (*hb_font_get_font_extents_func_t) (hb_font_t *font, void *font_data,
hb_font_extents_t *extents,
void *user_data);
/**
* hb_font_get_font_h_extents_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the extents for a font, in horizontal-direction
* text segments. Extents must be returned in an #hb_glyph_extents output
* parameter.
*
**/
typedef hb_font_get_font_extents_func_t hb_font_get_font_h_extents_func_t;
/**
* hb_font_get_font_v_extents_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the extents for a font, in vertical-direction
* text segments. Extents must be returned in an #hb_glyph_extents output
* parameter.
*
**/
typedef hb_font_get_font_extents_func_t hb_font_get_font_v_extents_func_t;
/**
* hb_font_get_nominal_glyph_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the nominal glyph ID for a specified Unicode code
* point. Glyph IDs must be returned in a #hb_codepoint_t output parameter.
*
**/
typedef hb_bool_t (*hb_font_get_nominal_glyph_func_t) (hb_font_t *font, void *font_data,
hb_codepoint_t unicode,
hb_codepoint_t *glyph,
void *user_data);
/**
* hb_font_get_variation_glyph_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the glyph ID for a specified Unicode code point
* followed by a specified Variation Selector code point. Glyph IDs must be
* returned in a #hb_codepoint_t output parameter.
*
**/
typedef hb_bool_t (*hb_font_get_variation_glyph_func_t) (hb_font_t *font, void *font_data,
hb_codepoint_t unicode, hb_codepoint_t variation_selector,
hb_codepoint_t *glyph,
void *user_data);
/**
* hb_font_get_nominal_glyphs_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the nominal glyph IDs for a sequence of
* Unicode code points. Glyph IDs must be returned in a #hb_codepoint_t
* output parameter.
*
**/
typedef unsigned int (*hb_font_get_nominal_glyphs_func_t) (hb_font_t *font, void *font_data,
unsigned int count,
const hb_codepoint_t *first_unicode,
@ -132,13 +218,51 @@ typedef unsigned int (*hb_font_get_nominal_glyphs_func_t) (hb_font_t *font, void
unsigned int glyph_stride,
void *user_data);
/**
* hb_font_get_glyph_advance_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the advance for a specified glyph. The
* method must return an #hb_position_t.
*
**/
typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void *font_data,
hb_codepoint_t glyph,
void *user_data);
/**
* hb_font_get_glyph_h_advance_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the advance for a specified glyph, in
* horizontal-direction text segments. Advances must be returned in
* an #hb_position_t output parameter.
*
**/
typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_h_advance_func_t;
/**
* hb_font_get_glyph_v_advance_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the advance for a specified glyph, in
* vertical-direction text segments. Advances must be returned in
* an #hb_position_t output parameter.
*
**/
typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_v_advance_func_t;
/**
* hb_font_get_glyph_advances_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the advances for a sequence of glyphs.
*
**/
typedef void (*hb_font_get_glyph_advances_func_t) (hb_font_t* font, void* font_data,
unsigned int count,
const hb_codepoint_t *first_glyph,
@ -146,14 +270,66 @@ typedef void (*hb_font_get_glyph_advances_func_t) (hb_font_t* font, void* font_d
hb_position_t *first_advance,
unsigned advance_stride,
void *user_data);
/**
* hb_font_get_glyph_h_advances_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the advances for a sequence of glyphs, in
* horizontal-direction text segments.
*
**/
typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_h_advances_func_t;
/**
* hb_font_get_glyph_v_advances_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the advances for a sequence of glyphs, in
* vertical-direction text segments.
*
**/
typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_v_advances_func_t;
/**
* hb_font_get_glyph_origin_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the (X,Y) coordinates (in font units) of the
* origin for a glyph. Each coordinate must be returned in an #hb_position_t
* output parameter.
*
**/
typedef hb_bool_t (*hb_font_get_glyph_origin_func_t) (hb_font_t *font, void *font_data,
hb_codepoint_t glyph,
hb_position_t *x, hb_position_t *y,
void *user_data);
/**
* hb_font_get_glyph_h_origin_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the (X,Y) coordinates (in font units) of the
* origin for a glyph, in horizontal-direction text segments. Each
* coordinate must be returned in an #hb_position_t output parameter.
*
**/
typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_h_origin_func_t;
/**
* hb_font_get_glyph_v_origin_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the (X,Y) coordinates (in font units) of the
* origin for a glyph, in vertical-direction text segments. Each coordinate
* must be returned in an #hb_position_t output parameter.
*
**/
typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_v_origin_func_t;
typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data,
@ -162,20 +338,59 @@ typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void
typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t;
/**
* hb_font_get_glyph_extents_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the extents for a specified glyph. Extents must be
* returned in an #hb_glyph_extents output parameter.
*
**/
typedef hb_bool_t (*hb_font_get_glyph_extents_func_t) (hb_font_t *font, void *font_data,
hb_codepoint_t glyph,
hb_glyph_extents_t *extents,
void *user_data);
/**
* hb_font_get_glyph_contour_point_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the (X,Y) coordinates (in font units) for a
* specified contour point in a glyph. Each coordinate must be returned as
* an #hb_position_t output parameter.
*
**/
typedef hb_bool_t (*hb_font_get_glyph_contour_point_func_t) (hb_font_t *font, void *font_data,
hb_codepoint_t glyph, unsigned int point_index,
hb_position_t *x, hb_position_t *y,
void *user_data);
/**
* hb_font_get_glyph_name_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the glyph name that corresponds to a
* glyph ID. The name should be returned in a string output parameter.
*
**/
typedef hb_bool_t (*hb_font_get_glyph_name_func_t) (hb_font_t *font, void *font_data,
hb_codepoint_t glyph,
char *name, unsigned int size,
void *user_data);
/**
* hb_font_get_glyph_from_name_func_t:
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
* This method should retrieve the glyph ID that corresponds to a glyph-name
* string.
*
**/
typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *font_data,
const char *name, int len, /* -1 means nul-terminated */
hb_codepoint_t *glyph,
@ -186,12 +401,12 @@ typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *
/**
* hb_font_funcs_set_font_h_extents_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_font_h_extents_func_t.
*
* Since: 1.1.2
**/
@ -202,12 +417,12 @@ hb_font_funcs_set_font_h_extents_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_font_v_extents_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_font_v_extents_func_t.
*
* Since: 1.1.2
**/
@ -218,12 +433,12 @@ hb_font_funcs_set_font_v_extents_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_nominal_glyph_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_nominal_glyph_func_t.
*
* Since: 1.2.3
**/
@ -234,12 +449,12 @@ hb_font_funcs_set_nominal_glyph_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_nominal_glyphs_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_nominal_glyphs_func_t.
*
* Since: 2.0.0
**/
@ -250,12 +465,12 @@ hb_font_funcs_set_nominal_glyphs_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_variation_glyph_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_variation_glyph_func_t.
*
* Since: 1.2.3
**/
@ -266,12 +481,12 @@ hb_font_funcs_set_variation_glyph_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_glyph_h_advance_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_glyph_h_advance_func_t.
*
* Since: 0.9.2
**/
@ -282,12 +497,12 @@ hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_glyph_v_advance_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_glyph_v_advance_func_t.
*
* Since: 0.9.2
**/
@ -298,12 +513,12 @@ hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_glyph_h_advances_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_glyph_h_advances_func_t.
*
* Since: 1.8.6
**/
@ -314,12 +529,12 @@ hb_font_funcs_set_glyph_h_advances_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_glyph_v_advances_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_glyph_v_advances_func_t.
*
* Since: 1.8.6
**/
@ -330,12 +545,12 @@ hb_font_funcs_set_glyph_v_advances_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_glyph_h_origin_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_glyph_h_origin_func_t.
*
* Since: 0.9.2
**/
@ -346,12 +561,12 @@ hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_glyph_v_origin_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_glyph_v_origin_func_t.
*
* Since: 0.9.2
**/
@ -378,12 +593,12 @@ hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_glyph_extents_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_glyph_extents_func_t.
*
* Since: 0.9.2
**/
@ -394,12 +609,12 @@ hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_glyph_contour_point_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_glyph_contour_point_func_t.
*
* Since: 0.9.2
**/
@ -410,12 +625,12 @@ hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_glyph_name_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_glyph_name_func_t.
*
* Since: 0.9.2
**/
@ -426,12 +641,12 @@ hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_set_glyph_from_name_func:
* @ffuncs: font functions.
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:
*
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_font_get_glyph_from_name_func_t.
*
* Since: 0.9.2
**/

View File

@ -661,7 +661,7 @@ _hb_ft_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data
/**
* hb_ft_face_create:
* @ft_face: (destroy destroy) (scope notified): FT_Face to work upon
* @destroy: A callback to call when the face object is not needed anymore
* @destroy: (optional): A callback to call when the face object is not needed anymore
*
* Creates an #hb_face_t face object from the specified FT_Face.
*

View File

@ -42,7 +42,9 @@
/**
* hb_map_create: (Xconstructor)
*
* Return value: (transfer full):
* Creates a new, initially empty map.
*
* Return value: (transfer full): The new #hb_map_t
*
* Since: 1.7.7
**/
@ -62,7 +64,9 @@ hb_map_create ()
/**
* hb_map_get_empty:
*
* Return value: (transfer full):
* Fetches the singleton empty #hb_map_t.
*
* Return value: (transfer full): The empty #hb_map_t
*
* Since: 1.7.7
**/
@ -74,9 +78,11 @@ hb_map_get_empty ()
/**
* hb_map_reference: (skip)
* @map: a map.
* @map: A map
*
* Return value: (transfer full):
* Increases the reference count on a map.
*
* Return value: (transfer full): The map
*
* Since: 1.7.7
**/
@ -88,7 +94,11 @@ hb_map_reference (hb_map_t *map)
/**
* hb_map_destroy: (skip)
* @map: a map.
* @map: A map
*
* Decreases the reference count on a map. When
* the reference count reaches zero, the map is
* destroyed, freeing all memory.
*
* Since: 1.7.7
**/
@ -104,13 +114,15 @@ hb_map_destroy (hb_map_t *map)
/**
* hb_map_set_user_data: (skip)
* @map: a map.
* @key:
* @data:
* @destroy:
* @replace:
* @map: A map
* @key: The user-data key to set
* @data: A pointer to the user data to set
* @destroy: (optional): A callback to call when @data is not needed anymore
* @replace: Whether to replace an existing data with the same key
*
* Return value:
* Attaches a user-data key/data pair to the specified map.
*
* Return value: %true if success, %false otherwise
*
* Since: 1.7.7
**/
@ -126,10 +138,13 @@ hb_map_set_user_data (hb_map_t *map,
/**
* hb_map_get_user_data: (skip)
* @map: a map.
* @key:
* @map: A map
* @key: The user-data key to query
*
* Return value: (transfer none):
* Fetches the user data associated with the specified key,
* attached to the specified map.
*
* Return value: (transfer none): A pointer to the user data
*
* Since: 1.7.7
**/
@ -143,11 +158,11 @@ hb_map_get_user_data (hb_map_t *map,
/**
* hb_map_allocation_successful:
* @map: a map.
* @map: A map
*
* Tests whether memory allocation for a set was successful.
*
*
* Return value:
* Return value: %true if allocation succeeded, false otherwise
*
* Since: 1.7.7
**/
@ -160,11 +175,11 @@ hb_map_allocation_successful (const hb_map_t *map)
/**
* hb_map_set:
* @map: a map.
* @key:
* @value:
*
* @map: A map
* @key: The key to store in the map
* @value: The value to store for @key
*
* Stores @key:@value in the map.
*
* Since: 1.7.7
**/
@ -178,10 +193,10 @@ hb_map_set (hb_map_t *map,
/**
* hb_map_get:
* @map: a map.
* @key:
*
* @map: A map
* @key: The key to query
*
* Fetches the value stored for @key in @map.
*
* Since: 1.7.7
**/
@ -194,10 +209,10 @@ hb_map_get (const hb_map_t *map,
/**
* hb_map_del:
* @map: a map.
* @key:
*
* @map: A map
* @key: The key to delete
*
* Removes @key and its stored value from @map.
*
* Since: 1.7.7
**/
@ -210,10 +225,12 @@ hb_map_del (hb_map_t *map,
/**
* hb_map_has:
* @map: a map.
* @key:
* @map: A map
* @key: The key to query
*
* Tests whether @key is an element of @map.
*
* Return value: %true if @key is found in @map, false otherwise
*
* Since: 1.7.7
**/
@ -227,9 +244,9 @@ hb_map_has (const hb_map_t *map,
/**
* hb_map_clear:
* @map: a map.
*
* @map: A map
*
* Clears out the contents of @map.
*
* Since: 1.7.7
**/
@ -241,9 +258,11 @@ hb_map_clear (hb_map_t *map)
/**
* hb_map_is_empty:
* @map: a map.
* @map: A map
*
* Tests whether @map is empty (contains no elements).
*
* Return value: %true if @map is empty
*
* Since: 1.7.7
**/
@ -255,9 +274,11 @@ hb_map_is_empty (const hb_map_t *map)
/**
* hb_map_get_population:
* @map: a map.
* @map: A map
*
* Returns the number of key-value pairs in the map.
*
* Return value: The population of @map
*
* Since: 1.7.7
**/

View File

@ -41,6 +41,12 @@ HB_BEGIN_DECLS
*/
#define HB_MAP_VALUE_INVALID ((hb_codepoint_t) -1)
/**
* hb_map_t:
*
* Data type for holding integer-to-integer hash maps.
*
**/
typedef struct hb_map_t hb_map_t;

View File

@ -30,11 +30,11 @@
/**
* SECTION:hb-set
* @title: hb-set
* @short_description: Object representing a set of integers
* @short_description: Objects representing a set of integers
* @include: hb.h
*
* Set objects represent a mathematical set of integer values. They are
* used in non-shaping API to query certain set of characters or glyphs,
* used in non-shaping APIs to query certain sets of characters or glyphs,
* or other integer values.
**/
@ -42,7 +42,9 @@
/**
* hb_set_create: (Xconstructor)
*
* Return value: (transfer full):
* Creates a new, initially empty set.
*
* Return value: (transfer full): The new #hb_set_t
*
* Since: 0.9.2
**/
@ -62,7 +64,9 @@ hb_set_create ()
/**
* hb_set_get_empty:
*
* Return value: (transfer full):
* Fetches the singleton empty #hb_set_t.
*
* Return value: (transfer full): The empty #hb_set_t
*
* Since: 0.9.2
**/
@ -74,9 +78,11 @@ hb_set_get_empty ()
/**
* hb_set_reference: (skip)
* @set: a set.
* @set: A set
*
* Return value: (transfer full):
* Increases the reference count on a set.
*
* Return value: (transfer full): The set
*
* Since: 0.9.2
**/
@ -88,7 +94,11 @@ hb_set_reference (hb_set_t *set)
/**
* hb_set_destroy: (skip)
* @set: a set.
* @set: A set
*
* Decreases the reference count on a set. When
* the reference count reaches zero, the set is
* destroyed, freeing all memory.
*
* Since: 0.9.2
**/
@ -104,13 +114,15 @@ hb_set_destroy (hb_set_t *set)
/**
* hb_set_set_user_data: (skip)
* @set: a set.
* @key:
* @data:
* @destroy:
* @replace:
* @set: A set
* @key: The user-data key to set
* @data: A pointer to the user data to set
* @destroy: (optional): A callback to call when @data is not needed anymore
* @replace: Whether to replace an existing data with the same key
*
* Return value:
* Attaches a user-data key/data pair to the specified set.
*
* Return value: %true if success, %false otherwise
*
* Since: 0.9.2
**/
@ -126,10 +138,13 @@ hb_set_set_user_data (hb_set_t *set,
/**
* hb_set_get_user_data: (skip)
* @set: a set.
* @key:
* @set: A set
* @key: The user-data key to query
*
* Return value: (transfer none):
* Fetches the user data associated with the specified key,
* attached to the specified set.
*
* Return value: (transfer none): A pointer to the user data
*
* Since: 0.9.2
**/
@ -143,11 +158,11 @@ hb_set_get_user_data (hb_set_t *set,
/**
* hb_set_allocation_successful:
* @set: a set.
* @set: A set
*
* Tests whether memory allocation for a set was successful.
*
*
* Return value:
* Return value: %true if allocation succeeded, false otherwise
*
* Since: 0.9.2
**/
@ -159,9 +174,9 @@ hb_set_allocation_successful (const hb_set_t *set)
/**
* hb_set_clear:
* @set: a set.
*
* @set: A set
*
* Clears out the contents of a set.
*
* Since: 0.9.2
**/
@ -175,9 +190,9 @@ hb_set_clear (hb_set_t *set)
* hb_set_is_empty:
* @set: a set.
*
* Tests whether a set is empty (contains no elements).
*
*
* Return value:
* Return value: %true if @set is empty
*
* Since: 0.9.7
**/
@ -189,12 +204,12 @@ hb_set_is_empty (const hb_set_t *set)
/**
* hb_set_has:
* @set: a set.
* @codepoint:
* @set: A set
* @codepoint: The element to query
*
* Tests whether @codepoint belongs to @set.
*
*
* Return value:
* Return value: %true if @codepoint is in @set, false otherwise
*
* Since: 0.9.2
**/
@ -207,10 +222,10 @@ hb_set_has (const hb_set_t *set,
/**
* hb_set_add:
* @set: a set.
* @codepoint:
*
* @set: A set
* @codepoint: The element to add to @set
*
* Adds @codepoint to @set.
*
* Since: 0.9.2
**/
@ -223,11 +238,12 @@ hb_set_add (hb_set_t *set,
/**
* hb_set_add_range:
* @set: a set.
* @first:
* @last:
*
* @set: A set
* @first: The first element to add to @set
* @last: The final element to add to @set
*
* Adds all of the elements from @first to @last
* (inclusive) to @set.
*
* Since: 0.9.7
**/
@ -241,10 +257,10 @@ hb_set_add_range (hb_set_t *set,
/**
* hb_set_del:
* @set: a set.
* @codepoint:
*
* @set: A set
* @codepoint: Removes @codepoint from @set
*
* Removes @codepoint from @set.
*
* Since: 0.9.2
**/
@ -257,11 +273,12 @@ hb_set_del (hb_set_t *set,
/**
* hb_set_del_range:
* @set: a set.
* @first:
* @last:
*
* @set: A set
* @first: The first element to remove from @set
* @last: The final element to remove from @set
*
* Removes all of the elements from @first to @last
* (inclusive) from @set.
*
* Since: 0.9.7
**/
@ -275,10 +292,11 @@ hb_set_del_range (hb_set_t *set,
/**
* hb_set_is_equal:
* @set: a set.
* @other: other set.
*
* @set: A set
* @other: Another set
*
* Tests whether @set and @other are equal (contain the same
* elements).
*
* Return value: %TRUE if the two sets are equal, %FALSE otherwise.
*
@ -293,10 +311,10 @@ hb_set_is_equal (const hb_set_t *set,
/**
* hb_set_is_subset:
* @set: a set.
* @larger_set: other set.
*
* @set: A set
* @larger_set: Another set
*
* Tests whether @set is a subset of @larger_set.
*
* Return value: %TRUE if the @set is a subset of (or equal to) @larger_set, %FALSE otherwise.
*
@ -311,10 +329,10 @@ hb_set_is_subset (const hb_set_t *set,
/**
* hb_set_set:
* @set: a set.
* @other:
*
* @set: A set
* @other: Another set
*
* Makes the contents of @set equal to the contents of @other.
*
* Since: 0.9.2
**/
@ -327,10 +345,10 @@ hb_set_set (hb_set_t *set,
/**
* hb_set_union:
* @set: a set.
* @other:
*
* @set: A set
* @other: Another set
*
* Makes @set the union of @set and @other.
*
* Since: 0.9.2
**/
@ -343,10 +361,10 @@ hb_set_union (hb_set_t *set,
/**
* hb_set_intersect:
* @set: a set.
* @other:
*
* @set: A set
* @other: Another set
*
* Makes @set the intersection of @set and @other.
*
* Since: 0.9.2
**/
@ -359,10 +377,10 @@ hb_set_intersect (hb_set_t *set,
/**
* hb_set_subtract:
* @set: a set.
* @other:
*
* @set: A set
* @other: Another set
*
* Subtracts the contents of @other from @set.
*
* Since: 0.9.2
**/
@ -375,10 +393,11 @@ hb_set_subtract (hb_set_t *set,
/**
* hb_set_symmetric_difference:
* @set: a set.
* @other:
*
* @set: A set
* @other: Another set
*
* Makes @set the symmetric difference of @set
* and @other.
*
* Since: 0.9.2
**/
@ -392,9 +411,9 @@ hb_set_symmetric_difference (hb_set_t *set,
#ifndef HB_DISABLE_DEPRECATED
/**
* hb_set_invert:
* @set: a set.
*
* @set: A set
*
* Inverts the contents of @set.
*
* Since: 0.9.10
*
@ -408,11 +427,11 @@ hb_set_invert (hb_set_t *set HB_UNUSED)
/**
* hb_set_get_population:
* @set: a set.
* @set: A set
*
* Returns the number of numbers in the set.
* Returns the number of elements in the set.
*
* Return value: set population.
* Return value: The population of @set
*
* Since: 0.9.7
**/
@ -424,11 +443,11 @@ hb_set_get_population (const hb_set_t *set)
/**
* hb_set_get_min:
* @set: a set.
* @set: A set
*
* Finds the minimum number in the set.
* Finds the smallest element in the set.
*
* Return value: minimum of the set, or %HB_SET_VALUE_INVALID if set is empty.
* Return value: minimum of @set, or %HB_SET_VALUE_INVALID if @set is empty.
*
* Since: 0.9.7
**/
@ -440,11 +459,11 @@ hb_set_get_min (const hb_set_t *set)
/**
* hb_set_get_max:
* @set: a set.
* @set: A set
*
* Finds the maximum number in the set.
* Finds the largest element in the set.
*
* Return value: minimum of the set, or %HB_SET_VALUE_INVALID if set is empty.
* Return value: maximum of @set, or %HB_SET_VALUE_INVALID if @set is empty.
*
* Since: 0.9.7
**/
@ -456,14 +475,15 @@ hb_set_get_max (const hb_set_t *set)
/**
* hb_set_next:
* @set: a set.
* @codepoint: (inout):
* @set: A set
* @codepoint: (inout): Input = Code point to query
* Output = Code point retrieved
*
* Gets the next number in @set that is greater than current value of @codepoint.
* Fetches the next element in @set that is greater than current value of @codepoint.
*
* Set @codepoint to %HB_SET_VALUE_INVALID to get started.
*
* Return value: whether there was a next value.
* Return value: %true if there was a next value, false otherwise
*
* Since: 0.9.2
**/
@ -476,14 +496,15 @@ hb_set_next (const hb_set_t *set,
/**
* hb_set_previous:
* @set: a set.
* @codepoint: (inout):
* @set: A set
* @codepoint: (inout): Input = Code point to query
* Output = Code point retrieved
*
* Gets the previous number in @set that is lower than current value of @codepoint.
* Fetches the previous element in @set that is lower than current value of @codepoint.
*
* Set @codepoint to %HB_SET_VALUE_INVALID to get started.
*
* Return value: whether there was a previous value.
* Return value: %true if there was a previous value, false otherwise
*
* Since: 1.8.0
**/
@ -496,16 +517,17 @@ hb_set_previous (const hb_set_t *set,
/**
* 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.
* @set: A set
* @first: (out): The first code point in the range
* @last: (inout): Input = The current last code point in the range
* Output = The last code point in the range
*
* Gets the next consecutive range of numbers in @set that
* Fetches the next consecutive range of elements in @set that
* are greater than current value of @last.
*
* Set @last to %HB_SET_VALUE_INVALID to get started.
*
* Return value: whether there was a next range.
* Return value: %true if there was a next range, false otherwise
*
* Since: 0.9.7
**/
@ -519,16 +541,17 @@ hb_set_next_range (const hb_set_t *set,
/**
* hb_set_previous_range:
* @set: a set.
* @first: (inout): input current first and output first codepoint in the range.
* @last: (out): output last codepoint in the range.
* @set: A set
* @first: (inout): Input = The current first code point in the range
* Output = The first code point in the range
* @last: (out): The last code point in the range
*
* Gets the previous consecutive range of numbers in @set that
* are less than current value of @first.
* Fetches the previous consecutive range of elements in @set that
* are greater than current value of @last.
*
* Set @first to %HB_SET_VALUE_INVALID to get started.
*
* Return value: whether there was a previous range.
* Return value: %true if there was a previous range, false otherwise
*
* Since: 1.8.0
**/

View File

@ -41,6 +41,15 @@ HB_BEGIN_DECLS
*/
#define HB_SET_VALUE_INVALID ((hb_codepoint_t) -1)
/**
* hb_set_t:
*
* Data type for holding a set of integers. #hb_set_t's are
* used to gather and contain glyph IDs, Unicode code
* points, and various other collections of discrete
* values.
*
**/
typedef struct hb_set_t hb_set_t;

View File

@ -329,7 +329,7 @@ hb_shape_plan_destroy (hb_shape_plan_t *shape_plan)
* @shape_plan: A shaping plan
* @key: The user-data key to set
* @data: A pointer to the user data
* @destroy: A callback to call when @data is not needed anymore
* @destroy: (optional): A callback to call when @data is not needed anymore
* @replace: Whether to replace an existing data with the same key
*
* Attaches a user-data key/data pair to the given shaping plan.

View File

@ -276,12 +276,12 @@ hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs)
* @ufuncs: The Unicode-functions structure
* @key: The user-data key
* @data: A pointer to the user data
* @destroy: A callback to call when @data is not needed anymore
* @destroy: (optional): A callback to call when @data is not needed anymore
* @replace: Whether to replace an existing data with the same key
*
* Attaches a user-data key/data pair to the specified Unicode-functions structure.
*
* Return value: %true if success, false otherwise
* Return value: %true if success, %false otherwise
*
* Since: 0.9.2
**/

View File

@ -431,7 +431,7 @@ typedef hb_bool_t (*hb_unicode_decompose_func_t) (hb_unicode_funcs_t *ufuncs,
* @ufuncs: A Unicode-functions structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: The function to call when @user_data is not needed anymore
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_unicode_combining_class_func_t.
*
@ -447,7 +447,7 @@ hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs,
* @ufuncs: A Unicode-functions structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: The function to call when @user_data is not needed anymore
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_unicode_general_category_func_t.
*
@ -463,7 +463,7 @@ hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs,
* @ufuncs: A Unicode-functions structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: The function to call when @user_data is not needed anymore
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_unicode_mirroring_func_t.
*
@ -479,7 +479,7 @@ hb_unicode_funcs_set_mirroring_func (hb_unicode_funcs_t *ufuncs,
* @ufuncs: A Unicode-functions structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: The function to call when @user_data is not needed anymore
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_unicode_script_func_t.
*
@ -495,7 +495,7 @@ hb_unicode_funcs_set_script_func (hb_unicode_funcs_t *ufuncs,
* @ufuncs: A Unicode-functions structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: The function to call when @user_data is not needed anymore
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_unicode_compose_func_t.
*
@ -511,7 +511,7 @@ hb_unicode_funcs_set_compose_func (hb_unicode_funcs_t *ufuncs,
* @ufuncs: A Unicode-functions structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: The function to call when @user_data is not needed anymore
* @destroy: (optional): The function to call when @user_data is not needed anymore
*
* Sets the implementation function for #hb_unicode_decompose_func_t.
*