summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc
index fab2aa3a9f8..e1492756cfc 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc
@@ -33,7 +33,6 @@
#include "hb-open-file-private.hh"
-
/**
* hb_face_count: Get number of faces on the blob
* @blob:
@@ -51,7 +50,8 @@ hb_face_count (hb_blob_t *blob)
return 0;
/* TODO We shouldn't be sanitizing blob. Port to run sanitizer and return if not sane. */
- hb_blob_t *sanitized = OT::hb_sanitize_context_t().sanitize_blob<OT::OpenTypeFontFile> (hb_blob_reference (blob));
+ /* Make API signature const after. */
+ hb_blob_t *sanitized = hb_sanitize_context_t ().sanitize_blob<OT::OpenTypeFontFile> (hb_blob_reference (blob));
const OT::OpenTypeFontFile& ot = *sanitized->as<OT::OpenTypeFontFile> ();
unsigned int ret = ot.get_face_count ();
hb_blob_destroy (sanitized);
@@ -63,7 +63,8 @@ hb_face_count (hb_blob_t *blob)
* hb_face_t
*/
-const hb_face_t _hb_face_nil = {
+DEFINE_NULL_INSTANCE (hb_face_t) =
+{
HB_OBJECT_HEADER_STATIC,
true, /* immutable */
@@ -189,7 +190,7 @@ hb_face_create (hb_blob_t *blob,
if (unlikely (!blob))
blob = hb_blob_get_empty ();
- hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (OT::hb_sanitize_context_t().sanitize_blob<OT::OpenTypeFontFile> (hb_blob_reference (blob)), index);
+ hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (hb_sanitize_context_t ().sanitize_blob<OT::OpenTypeFontFile> (hb_blob_reference (blob)), index);
if (unlikely (!closure))
return hb_face_get_empty ();
@@ -215,7 +216,7 @@ hb_face_create (hb_blob_t *blob,
hb_face_t *
hb_face_get_empty (void)
{
- return const_cast<hb_face_t *> (&_hb_face_nil);
+ return const_cast<hb_face_t *> (&Null(hb_face_t));
}
@@ -302,7 +303,7 @@ hb_face_set_user_data (hb_face_t *face,
* Since: 0.9.2
**/
void *
-hb_face_get_user_data (hb_face_t *face,
+hb_face_get_user_data (const hb_face_t *face,
hb_user_data_key_t *key)
{
return hb_object_get_user_data (face, key);
@@ -336,7 +337,7 @@ hb_face_make_immutable (hb_face_t *face)
* Since: 0.9.2
**/
hb_bool_t
-hb_face_is_immutable (hb_face_t *face)
+hb_face_is_immutable (const hb_face_t *face)
{
return face->immutable;
}
@@ -354,8 +355,8 @@ hb_face_is_immutable (hb_face_t *face)
* Since: 0.9.2
**/
hb_blob_t *
-hb_face_reference_table (hb_face_t *face,
- hb_tag_t tag)
+hb_face_reference_table (const hb_face_t *face,
+ hb_tag_t tag)
{
return face->reference_table (tag);
}
@@ -406,7 +407,7 @@ hb_face_set_index (hb_face_t *face,
* Since: 0.9.2
**/
unsigned int
-hb_face_get_index (hb_face_t *face)
+hb_face_get_index (const hb_face_t *face)
{
return face->index;
}
@@ -441,7 +442,7 @@ hb_face_set_upem (hb_face_t *face,
* Since: 0.9.2
**/
unsigned int
-hb_face_get_upem (hb_face_t *face)
+hb_face_get_upem (const hb_face_t *face)
{
return face->get_upem ();
}
@@ -476,7 +477,7 @@ hb_face_set_glyph_count (hb_face_t *face,
* Since: 0.9.7
**/
unsigned int
-hb_face_get_glyph_count (hb_face_t *face)
+hb_face_get_glyph_count (const hb_face_t *face)
{
return face->get_num_glyphs ();
}
@@ -492,7 +493,7 @@ hb_face_get_glyph_count (hb_face_t *face)
* Since: 1.6.0
**/
unsigned int
-hb_face_get_table_tags (hb_face_t *face,
+hb_face_get_table_tags (const hb_face_t *face,
unsigned int start_offset,
unsigned int *table_count, /* IN/OUT */
hb_tag_t *table_tags /* OUT */)