/*
- * Copyright (C) 2007,2008,2009 Red Hat, Inc.
+ * Copyright © 2007,2008,2009 Red Hat, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
#ifndef HB_OT_LAYOUT_PRIVATE_HH
#define HB_OT_LAYOUT_PRIVATE_HH
-#include "hb-private.h"
+#include "hb-private.hh"
#include "hb-ot-layout.h"
-#include "hb-ot-head-private.hh"
-#include "hb-font-private.h"
+#include "hb-font-private.hh"
#include "hb-buffer-private.hh"
HB_BEGIN_DECLS
-/* XXX */
-#define component() var1.u16[0]
-#define lig_id() var1.u16[1]
-#define gproperty() var2.u32
-#define back() var.u16[0] /* number of glyphs to go back for drawing current glyph */
-#define cursive_chain() var.i16[1] /* character to which this connects, may be positive or negative */
+/*
+ * GDEF
+ */
+
+/* buffer var allocations */
+#define props_cache() var1.u16[1] /* glyph_props cache */
+/* XXX cleanup */
typedef enum {
HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0x0001,
HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH = 0x0002,
} hb_ot_layout_glyph_class_t;
+HB_INTERNAL unsigned int
+_hb_ot_layout_get_glyph_property (hb_face_t *face,
+ hb_glyph_info_t *info);
+
+HB_INTERNAL hb_bool_t
+_hb_ot_layout_check_glyph_property (hb_face_t *face,
+ hb_glyph_info_t *ginfo,
+ unsigned int lookup_props,
+ unsigned int *property_out);
+
+HB_INTERNAL hb_bool_t
+_hb_ot_layout_skip_mark (hb_face_t *face,
+ hb_glyph_info_t *ginfo,
+ unsigned int lookup_props,
+ unsigned int *property_out);
+
+
+/*
+ * head
+ */
+
+HB_INTERNAL unsigned int
+_hb_ot_layout_get_upem (hb_face_t *face);
+
+
/*
* hb_ot_layout_t
*/
hb_blob_t *gdef_blob;
hb_blob_t *gsub_blob;
hb_blob_t *gpos_blob;
+ hb_blob_t *head_blob;
const struct GDEF *gdef;
const struct GSUB *gsub;
const struct GPOS *gpos;
-};
-
-struct hb_ot_layout_context_t
-{
- hb_face_t *face;
- hb_font_t *font;
-
- /* Convert from font-space to user-space */
- inline hb_position_t scale_x (int16_t v) { return scale (v, this->font->x_scale); }
- inline hb_position_t scale_y (int16_t v) { return scale (v, this->font->y_scale); }
-
- private:
- inline hb_position_t scale (int16_t v, unsigned int scale) { return v * (int64_t) scale / this->face->head_table->get_upem (); }
+ const struct head *head;
};
HB_INTERNAL hb_ot_layout_t *
-_hb_ot_layout_new (hb_face_t *face);
+_hb_ot_layout_create (hb_face_t *face);
HB_INTERNAL void
-_hb_ot_layout_free (hb_ot_layout_t *layout);
-
-
-/*
- * GDEF
- */
-
-HB_INTERNAL unsigned int
-_hb_ot_layout_get_glyph_property (hb_face_t *face,
- hb_glyph_info_t *info);
-
-HB_INTERNAL hb_bool_t
-_hb_ot_layout_check_glyph_property (hb_face_t *face,
- hb_glyph_info_t *ginfo,
- unsigned int lookup_props,
- unsigned int *property);
-
-static inline hb_bool_t
-_hb_ot_layout_skip_mark (hb_face_t *face,
- hb_glyph_info_t *ginfo,
- unsigned int lookup_props,
- unsigned int *property_out)
-{
- unsigned int property;
-
- property = _hb_ot_layout_get_glyph_property (face, ginfo);
- if (property_out)
- *property_out = property;
-
- /* If it's a mark, skip it we don't accept it. */
- if (property & HB_OT_LAYOUT_GLYPH_CLASS_MARK)
- return !_hb_ot_layout_check_glyph_property (face, ginfo, lookup_props, NULL);
-
- /* If not a mark, don't skip. */
- return false;
-}
-
+_hb_ot_layout_destroy (hb_ot_layout_t *layout);
HB_END_DECLS