Skip to content

Commit

Permalink
[makeotfexe] Remove major version number warning
Browse files Browse the repository at this point in the history
Fixes #610
  • Loading branch information
miguelsousa committed Sep 21, 2018
1 parent b3e5c8f commit b1d76f9
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 4 deletions.
4 changes: 0 additions & 4 deletions c/makeotf/makeotf_lib/source/hotconv/feat.c
Original file line number Diff line number Diff line change
Expand Up @@ -3936,10 +3936,6 @@ static void setFontRev(char *rev) {

long major = strtol(rev, &fraction, 10);

if (major < 1 || major > 255) {
featMsg(hotWARNING, "Major version number not in range 1 .. 255");
}

if ((fraction != 0) && (strlen(fraction) > 0)) {
short strLen = strlen(fraction);
minor = strtod(fraction, NULL);
Expand Down
65 changes: 65 additions & 0 deletions tests/makeotfexe_data/input/bug610/font.pfa

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions tests/makeotfexe_data/input/bug610/v0005.fea
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
table head {
FontRevision 0.005;
} head;
17 changes: 17 additions & 0 deletions tests/makeotfexe_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,20 @@ def test_DFLT_script_with_any_lang_bug438():
' <created value=' + SPLIT_MARKER +
' <modified value=',
'-r', r'^\s+Version.*;hotconv.*;makeotfexe'])


def test_version_warning_bug610():
input_filename = 'bug610/font.pfa'
feat_filename = 'bug610/v0005.fea'
otf_path = _get_temp_file_path()

stderr_path = runner(
CMD + ['-s', '-e', '-o',
'f', '_{}'.format(_get_input_path(input_filename)),
'ff', '_{}'.format(_get_input_path(feat_filename)),
'o', '_{}'.format(otf_path)])

with open(stderr_path, 'rb') as f:
output = f.read()
assert (b"[WARNING] <SourceSans-Test> Major version number not in "
b"range 1 .. 255") not in output

0 comments on commit b1d76f9

Please sign in to comment.