Add script and language to buffer

This commit is contained in:
Behdad Esfahbod 2009-11-04 20:29:54 -05:00
parent 8a3511ac6c
commit ae070b7d39
4 changed files with 43 additions and 5 deletions

1
TODO
View File

@ -1,4 +1,3 @@
- cmap14 support in get_glyph callback
- Use size_t in sanitize?
- Buffer error handling?
- Better define HB_INTERNAL

View File

@ -71,10 +71,10 @@ 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;
hb_script_t script;
hb_language_t language;
/* Buffer contents */

View File

@ -146,6 +146,32 @@ hb_buffer_get_direction (hb_buffer_t *buffer)
return buffer->direction;
}
void
hb_buffer_set_script (hb_buffer_t *buffer,
hb_script_t script)
{
buffer->script = script;
}
hb_script_t
hb_buffer_get_script (hb_buffer_t *buffer)
{
return buffer->script;
}
void
hb_buffer_set_language (hb_buffer_t *buffer,
hb_language_t language)
{
buffer->language = language;
}
hb_language_t
hb_buffer_get_language (hb_buffer_t *buffer)
{
return buffer->language;
}
void
hb_buffer_clear (hb_buffer_t *buffer)

View File

@ -30,6 +30,7 @@
#include "hb-common.h"
#include "hb-unicode.h"
#include "hb-language.h"
HB_BEGIN_DECLS
@ -88,7 +89,6 @@ hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
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);
@ -96,6 +96,19 @@ hb_buffer_set_direction (hb_buffer_t *buffer,
hb_direction_t
hb_buffer_get_direction (hb_buffer_t *buffer);
void
hb_buffer_set_script (hb_buffer_t *buffer,
hb_script_t script);
hb_script_t
hb_buffer_get_script (hb_buffer_t *buffer);
void
hb_buffer_set_language (hb_buffer_t *buffer,
hb_language_t language);
hb_language_t
hb_buffer_get_language (hb_buffer_t *buffer);
void