Skip to content

Commit

Permalink
Merge pull request #88 from harfbuzz/fix-shape-trace
Browse files Browse the repository at this point in the history
Update shape_with_trace to new logging messages
  • Loading branch information
simoncozens authored Jun 27, 2023
2 parents d7c5b7b + 5b4e454 commit 3e84869
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hbjs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ static hb_bool_t do_trace (hb_buffer_t *buffer,
unsigned int consumed;
unsigned int num_glyphs = hb_buffer_get_length (buffer);

if (strcmp(message, "start table GSUB") == 0) {
if (strncmp(message, "start table GSUB", 16) == 0) {
user_data->current_phase = HB_SHAPE_GSUB_PHASE;
} else if (strcmp(message, "start table GPOS") == 0) {
} else if (strncmp(message, "start table GPOS", 16) == 0) {
user_data->current_phase = HB_SHAPE_GPOS_PHASE;
}

Expand All @@ -170,10 +170,10 @@ static hb_bool_t do_trace (hb_buffer_t *buffer,
if (user_data->stop_phase != HB_SHAPE_DONT_STOP) {
// Do we need to start stopping?
char buf[12];
snprintf (buf, 12, "%d", user_data->stop_at);
snprintf (buf, 12, "%d ", user_data->stop_at);
if ((user_data->current_phase == user_data->stop_phase) &&
(strncmp(message, "end lookup ", 11) == 0) &&
(strcmp(message + 11, buf) == 0)) {
(strncmp(message + 11, buf, strlen(buf)) == 0)) {
user_data->stopping = true;
}
}
Expand Down

0 comments on commit 3e84869

Please sign in to comment.