C99 partial port of harfbuzz