*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_shape_plan_t *
hb_shape_plan_create (hb_face_t *face,
if (unlikely (!face))
face = hb_face_get_empty ();
- if (unlikely (!props || hb_object_is_inert (face)))
+ if (unlikely (!props))
return hb_shape_plan_get_empty ();
- if (num_user_features && !(features = (hb_feature_t *) malloc (num_user_features * sizeof (hb_feature_t))))
+ if (num_user_features && !(features = (hb_feature_t *) calloc (num_user_features, sizeof (hb_feature_t))))
return hb_shape_plan_get_empty ();
if (!(shape_plan = hb_object_create<hb_shape_plan_t> ())) {
free (features);
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_shape_plan_t *
hb_shape_plan_get_empty (void)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_shape_plan_t *
hb_shape_plan_reference (hb_shape_plan_t *shape_plan)
*
*
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void
hb_shape_plan_destroy (hb_shape_plan_t *shape_plan)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_bool_t
hb_shape_plan_set_user_data (hb_shape_plan_t *shape_plan,
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void *
hb_shape_plan_get_user_data (hb_shape_plan_t *shape_plan,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_bool_t
hb_shape_plan_execute (hb_shape_plan_t *shape_plan,
num_features,
shape_plan->shaper_func);
- if (unlikely (hb_object_is_inert (shape_plan) ||
- hb_object_is_inert (font) ||
- hb_object_is_inert (buffer)))
+ if (unlikely (!buffer->len))
+ return true;
+
+ assert (!hb_object_is_inert (buffer));
+ assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_UNICODE);
+
+ if (unlikely (hb_object_is_inert (shape_plan)))
return false;
assert (shape_plan->face_unsafe == font->face);
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_shape_plan_t *
hb_shape_plan_create_cached (hb_face_t *face,
hb_shape_plan_t *shape_plan = hb_shape_plan_create (face, props, user_features, num_user_features, shaper_list);
+ /* Don't add to the cache if face is inert. */
+ if (unlikely (hb_object_is_inert (face)))
+ return shape_plan;
+
/* Don't add the plan to the cache if there were user features with non-global ranges */
if (hb_non_global_user_features_present (user_features, num_user_features))
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
const char *
hb_shape_plan_get_shaper (hb_shape_plan_t *shape_plan)