- cmap14 support in get_glyph callback
- Use size_t in sanitize?
-- Move unicode_funcs to buffer
- Buffer error handling?
hb-ot:
#include "hb-private.h"
#include "hb-buffer.h"
+#include "hb-unicode-private.h"
HB_BEGIN_DECLS
struct _hb_buffer_t {
hb_reference_count_t ref_count;
+ /* Information about how the text in the buffer should be treated */
+
+ hb_unicode_funcs_t *unicode;
+ hb_direction_t direction;
+
+
+ /* Buffer contents */
+
unsigned int allocated;
hb_bool_t have_output; /* weather we have an output buffer going on */
hb_internal_glyph_info_t *out_string;
hb_internal_glyph_position_t *positions;
- hb_direction_t direction;
+ /* Other stuff */
+
unsigned int max_lig_id;
};
static hb_buffer_t _hb_buffer_nil = {
- HB_REFERENCE_COUNT_INVALID /* ref_count */
+ HB_REFERENCE_COUNT_INVALID, /* ref_count */
+
+ &_hb_unicode_funcs_nil /* unicode */
};
/* Here is how the buffer works internally:
if (pre_alloc_size)
hb_buffer_ensure(buffer, pre_alloc_size);
+ buffer->unicode = &_hb_unicode_funcs_nil;
+
return buffer;
}
{
HB_OBJECT_DO_DESTROY (buffer);
+ hb_unicode_funcs_destroy (buffer->unicode);
+
free (buffer->in_string);
free (buffer->positions);
free (buffer);
}
+
+void
+hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
+ hb_unicode_funcs_t *unicode)
+{
+ hb_unicode_funcs_reference (unicode);
+ hb_unicode_funcs_destroy (buffer->unicode);
+ buffer->unicode = unicode;
+}
+
+hb_unicode_funcs_t *
+hb_buffer_get_unicode_funcs (hb_buffer_t *buffer)
+{
+ return buffer->unicode;
+}
+
+void
+hb_buffer_set_direction (hb_buffer_t *buffer,
+ hb_direction_t direction)
+
+{
+ buffer->direction = direction;
+}
+
+hb_direction_t
+hb_buffer_get_direction (hb_buffer_t *buffer)
+{
+ return buffer->direction;
+}
+
+
void
hb_buffer_clear (hb_buffer_t *buffer)
{
buffer->in_length++;
}
-void
-hb_buffer_set_direction (hb_buffer_t *buffer,
- hb_direction_t direction)
-
-{
- buffer->direction = direction;
-}
-
/* HarfBuzz-Internal API */
#define HB_BUFFER_H
#include "hb-common.h"
+#include "hb-unicode.h"
HB_BEGIN_DECLS
void
+hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
+ hb_unicode_funcs_t *unicode_funcs);
+
+hb_unicode_funcs_t *
+hb_buffer_get_unicode_funcs (hb_buffer_t *buffer);
+
+
+void
hb_buffer_set_direction (hb_buffer_t *buffer,
hb_direction_t direction);
hb_buffer_get_direction (hb_buffer_t *buffer);
+
void
hb_buffer_clear (hb_buffer_t *buffer);
#include "hb-font.h"
-#include "hb-unicode-private.h"
#include "hb-ot-layout-private.h"
HB_BEGIN_DECLS
hb_destroy_func_t destroy;
void *user_data;
- hb_unicode_funcs_t *unicode;
-
hb_ot_layout_t ot_layout;
};
#include "hb-private.h"
#include "hb-font-private.h"
-#include "hb-unicode-private.h"
#include "hb-open-file-private.hh"
#include "hb-blob.h"
NULL, /* destroy */
NULL, /* user_data */
- &_hb_unicode_funcs_nil, /* unicode */
-
{} /* ot_layout */
};
if (face->destroy)
face->destroy (face->user_data);
- hb_unicode_funcs_destroy (face->unicode);
-
free (face);
}
-void
-hb_face_set_unicode_funcs (hb_face_t *face,
- hb_unicode_funcs_t *unicode)
-{
- if (HB_OBJECT_IS_INERT (face))
- return;
-
- hb_unicode_funcs_reference (unicode);
- hb_unicode_funcs_destroy (face->unicode);
- face->unicode = unicode;
-}
-
hb_blob_t *
hb_face_get_table (hb_face_t *face,
hb_tag_t tag)
#include "hb-common.h"
#include "hb-blob.h"
-#include "hb-unicode.h"
HB_BEGIN_DECLS
void
hb_face_destroy (hb_face_t *face);
-void
-hb_face_set_unicode_funcs (hb_face_t *face,
- hb_unicode_funcs_t *unicode_funcs);
-
hb_blob_t *
hb_face_get_table (hb_face_t *face,
hb_tag_t tag);
hb_font_set_funcs (hb_font_t *font,
hb_font_funcs_t *klass);
+hb_font_funcs_t *
+hb_font_get_funcs (hb_font_t *font);
+
+
/*
* XXX
* should we decompose this to units_per_EM and font-size?