|
|
|
@ -33,6 +33,7 @@ |
|
|
|
|
#include "hb-ot-layout-gdef-private.hh" |
|
|
|
|
#include "hb-ot-layout-gsub-private.hh" |
|
|
|
|
#include "hb-ot-layout-gpos-private.hh" |
|
|
|
|
#include "hb-ot-head-private.hh" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h> |
|
|
|
@ -42,7 +43,7 @@ HB_BEGIN_DECLS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hb_ot_layout_t * |
|
|
|
|
_hb_ot_layout_new (hb_face_t *face) |
|
|
|
|
_hb_ot_layout_create (hb_face_t *face) |
|
|
|
|
{ |
|
|
|
|
/* Remove this object altogether */ |
|
|
|
|
hb_ot_layout_t *layout = (hb_ot_layout_t *) calloc (1, sizeof (hb_ot_layout_t)); |
|
|
|
@ -56,19 +57,24 @@ _hb_ot_layout_new (hb_face_t *face) |
|
|
|
|
layout->gpos_blob = Sanitizer<GPOS>::sanitize (hb_face_reference_table (face, HB_OT_TAG_GPOS)); |
|
|
|
|
layout->gpos = Sanitizer<GPOS>::lock_instance (layout->gpos_blob); |
|
|
|
|
|
|
|
|
|
layout->head_blob = Sanitizer<head>::sanitize (hb_face_reference_table (face, HB_OT_TAG_head)); |
|
|
|
|
layout->head = Sanitizer<head>::lock_instance (layout->head_blob); |
|
|
|
|
|
|
|
|
|
return layout; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
_hb_ot_layout_free (hb_ot_layout_t *layout) |
|
|
|
|
_hb_ot_layout_destroy (hb_ot_layout_t *layout) |
|
|
|
|
{ |
|
|
|
|
hb_blob_unlock (layout->gdef_blob); |
|
|
|
|
hb_blob_unlock (layout->gsub_blob); |
|
|
|
|
hb_blob_unlock (layout->gpos_blob); |
|
|
|
|
hb_blob_unlock (layout->head_blob); |
|
|
|
|
|
|
|
|
|
hb_blob_destroy (layout->gdef_blob); |
|
|
|
|
hb_blob_destroy (layout->gsub_blob); |
|
|
|
|
hb_blob_destroy (layout->gpos_blob); |
|
|
|
|
hb_blob_destroy (layout->head_blob); |
|
|
|
|
|
|
|
|
|
free (layout); |
|
|
|
|
} |
|
|
|
@ -78,18 +84,21 @@ _get_gdef (hb_face_t *face) |
|
|
|
|
{ |
|
|
|
|
return likely (face->ot_layout && face->ot_layout->gdef) ? *face->ot_layout->gdef : Null(GDEF); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static inline const GSUB& |
|
|
|
|
_get_gsub (hb_face_t *face) |
|
|
|
|
{ |
|
|
|
|
return likely (face->ot_layout && face->ot_layout->gsub) ? *face->ot_layout->gsub : Null(GSUB); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static inline const GPOS& |
|
|
|
|
_get_gpos (hb_face_t *face) |
|
|
|
|
{ |
|
|
|
|
return likely (face->ot_layout && face->ot_layout->gpos) ? *face->ot_layout->gpos : Null(GPOS); |
|
|
|
|
} |
|
|
|
|
static inline const head& |
|
|
|
|
_get_head (hb_face_t *face) |
|
|
|
|
{ |
|
|
|
|
return likely (face->ot_layout && face->ot_layout->head) ? *face->ot_layout->head : Null(head); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -486,4 +495,15 @@ hb_ot_layout_position_finish (hb_buffer_t *buffer) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* head |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
unsigned int |
|
|
|
|
_hb_ot_layout_get_upem (hb_face_t *face) |
|
|
|
|
{ |
|
|
|
|
return _get_head (face).get_upem (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HB_END_DECLS |
|
|
|
|