Skip to content

Getting at notdef unicode codepoints #70

@talltyler

Description

@talltyler

From my understanding var result = buffer.json(font);
should return an array of https://harfbuzz.github.io/harfbuzz-hb-buffer.html#hb_glyph_info_t
but the current implementation is only returning clusters without the original unicode codepoints

There is other unused data inside of infos I thought it might be in

var infosPtr = exports.hb_buffer_get_glyph_infos(ptr, 0);
var infosPtr32 = infosPtr / 4;
var infos = heapu32.subarray(infosPtr32, infosPtr32 + 5 * length);

but none of this additional unreturned data seems to be what I'm looking for.

I'm looking to use the unicode codepoints from the original buffer to handle fallbacks for glyphs that are not available in the font.
Currently the glyphId is returned as 0 for all of these cases which isn't very helpful.

I'm open to alternative ways of handling this if you all have better ideas for ways to connect the original text with the shaped output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions