mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 08:21:32 +01:00
[face] Clarify face_index handling
Fixes https://github.com/harfbuzz/harfbuzz/issues/3347
This commit is contained in:
1 parent
6da4b80e5f
commit
da7dba0002
1 file changed
+13
-6
+13
-6
@@ -143,7 +143,7 @@ hb_face_create_for_tables (hb_reference_table_func_t reference_table_func,
|
||||
|
||||
typedef struct hb_face_for_data_closure_t {
|
||||
hb_blob_t *blob;
|
||||
unsigned int index;
|
||||
uint16_t index;
|
||||
} hb_face_for_data_closure_t;
|
||||
|
||||
static hb_face_for_data_closure_t *
|
||||
@@ -156,7 +156,7 @@ _hb_face_for_data_closure_create (hb_blob_t *blob, unsigned int index)
|
||||
return nullptr;
|
||||
|
||||
closure->blob = blob;
|
||||
closure->index = index;
|
||||
closure->index = (uint16_t) (index & 0xFFFFu);
|
||||
|
||||
return closure;
|
||||
}
|
||||
@@ -195,9 +195,15 @@ _hb_face_for_data_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void
|
||||
* @index: The index of the face within @blob
|
||||
*
|
||||
* Constructs a new face object from the specified blob and
|
||||
* a face index into that blob. This is used for blobs of
|
||||
* file formats such as Dfont and TTC that can contain more
|
||||
* than one face.
|
||||
* a face index into that blob.
|
||||
*
|
||||
* The face index is used for blobs of file formats such as TTC and
|
||||
* and DFont that can contain more than one face. Face indices within
|
||||
* such collections are zero-based.
|
||||
*
|
||||
* <note>Note: If the blob font format is not a collection, @index
|
||||
* is ignored. Otherwise, only the lower 16-bits of @index are used.
|
||||
* The unmodified @index can be accessed via hb_face_get_index().</note>
|
||||
*
|
||||
* Return value: (transfer full): The new face object
|
||||
*
|
||||
@@ -420,7 +426,8 @@ hb_face_reference_blob (hb_face_t *face)
|
||||
* Assigns the specified face-index to @face. Fails if the
|
||||
* face is immutable.
|
||||
*
|
||||
* <note>Note: face indices within a collection are zero-based.</note>
|
||||
* <note>Note: changing the index has no effect on the face itself
|
||||
* This only changes the value returned by hb_face_get_index().</note>
|
||||
*
|
||||
* Since: 0.9.2
|
||||
**/
|
||||
|
||||
Reference in new issue
Block a user