Start filling hb_shape() in
This commit is contained in:
parent
ae070b7d39
commit
2f50d87368
|
@ -131,6 +131,7 @@ _hb_buffer_allocate_lig_id (hb_buffer_t *buffer);
|
|||
#define IN_GLYPH(pos) (buffer->in_string[(pos)].codepoint)
|
||||
#define IN_INFO(pos) (&buffer->in_string[(pos)])
|
||||
#define IN_CURGLYPH() (buffer->in_string[buffer->in_pos].codepoint)
|
||||
#define IN_NEXTGLYPH() (buffer->in_string[buffer->in_pos + 1].codepoint)
|
||||
#define IN_CURINFO() (&buffer->in_string[buffer->in_pos])
|
||||
#define IN_MASK(pos) (buffer->in_string[(pos)].mask)
|
||||
#define IN_LIGID(pos) (buffer->in_string[(pos)].lig_id)
|
||||
|
|
|
@ -28,6 +28,35 @@
|
|||
|
||||
#include "hb-shape.h"
|
||||
|
||||
#include "hb-buffer-private.h"
|
||||
|
||||
static inline hb_bool_t
|
||||
is_variation_selector (hb_codepoint_t unicode)
|
||||
{
|
||||
return (unicode >= 0xFE00 && unicode <= 0xFE0F) ||
|
||||
(unicode >= 0xE0100 && unicode <= 0xE01EF);
|
||||
}
|
||||
|
||||
static void
|
||||
map_glyphs (hb_face_t *face,
|
||||
hb_font_t *font,
|
||||
hb_buffer_t *buffer)
|
||||
{
|
||||
unsigned int count;
|
||||
|
||||
count = buffer->in_length - 1;
|
||||
|
||||
for (buffer->in_pos = 0; buffer->in_pos < count; buffer->in_pos++) {
|
||||
if (HB_UNLIKELY (is_variation_selector (IN_NEXTGLYPH()))) {
|
||||
IN_CURGLYPH() = hb_font_get_glyph (face, font, IN_CURGLYPH(), IN_NEXTGLYPH());
|
||||
buffer->in_pos++;
|
||||
} else {
|
||||
IN_CURGLYPH() = hb_font_get_glyph (face, font, IN_CURGLYPH(), 0);
|
||||
}
|
||||
}
|
||||
IN_CURGLYPH() = hb_font_get_glyph (face, font, IN_CURGLYPH(), 0);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
hb_shape (hb_face_t *face,
|
||||
|
@ -36,5 +65,14 @@ hb_shape (hb_face_t *face,
|
|||
hb_feature_t *features,
|
||||
unsigned int num_features)
|
||||
{
|
||||
}
|
||||
/* form_clusters (buffer); */
|
||||
/* do_mirroring (buffer); */
|
||||
/* natural direction analysis */
|
||||
/* OT preprocess */
|
||||
|
||||
map_glyphs (face, font, buffer);
|
||||
|
||||
/* GSUB */
|
||||
/* Default positioning */
|
||||
/* GPOS / kern */
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue