Skip to content

Commit

Permalink
metrics: Improve messages a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledhosny committed Dec 20, 2020
1 parent 1141c81 commit 318e75a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ bool OpenTypeMetricsHeader::Parse(const uint8_t *data, size_t length) {
}

if (this->ascent < 0) {
Warning("bad ascent: %d", this->ascent);
Warning("Negative ascent, setting to 0: %d", this->ascent);
this->ascent = 0;
}
if (this->linegap < 0) {
Warning("bad linegap: %d", this->linegap);
Warning("Negative linegap, setting to: %d", this->linegap);
this->linegap = 0;
}

Expand All @@ -52,7 +52,7 @@ bool OpenTypeMetricsHeader::Parse(const uint8_t *data, size_t length) {
// if the font is non-slanted, caret_offset should be zero.
if (!(head->mac_style & 2) &&
(this->caret_offset != 0)) {
Warning("bad caret offset: %d", this->caret_offset);
Warning("Non-zero caretOffset but head.macStyle italic bit is not set, setting to caretOffset to 0: %d", this->caret_offset);
this->caret_offset = 0;
}

Expand All @@ -66,7 +66,7 @@ bool OpenTypeMetricsHeader::Parse(const uint8_t *data, size_t length) {
return Error("Failed to read metricDataFormat");
}
if (data_format) {
return Error("Bad metricDataFormat: %d", data_format);
return Error("Unsupported metricDataFormat: %d", data_format);
}

if (!table.ReadU16(&this->num_metrics)) {
Expand Down

0 comments on commit 318e75a

Please sign in to comment.