From 0a920f8028fec9bf3c4d563c106eb20f1588c072 Mon Sep 17 00:00:00 2001 From: Kushal K S V S Date: Sun, 6 Aug 2017 11:43:02 -0700 Subject: Changing image names and location --- tests/make_png/bitmap.c | 4 ++-- tests/make_png/html/README | 1 + tests/make_png/html/images/README | 2 ++ tests/make_png/html/script.js | 22 ++++++++++++++++++++++ tests/make_png/html/style.css | 38 ++++++++++++++++++++++++++++++++++++++ tests/make_png/images/README | 2 -- tests/make_png/make_sprite.c | 12 +++++++++--- tests/make_png/script.js | 22 ---------------------- tests/make_png/style.css | 38 -------------------------------------- 9 files changed, 74 insertions(+), 67 deletions(-) create mode 100644 tests/make_png/html/README create mode 100644 tests/make_png/html/images/README create mode 100644 tests/make_png/html/script.js create mode 100644 tests/make_png/html/style.css delete mode 100644 tests/make_png/images/README delete mode 100644 tests/make_png/script.js delete mode 100644 tests/make_png/style.css diff --git a/tests/make_png/bitmap.c b/tests/make_png/bitmap.c index 4ee3e564b..f00618457 100644 --- a/tests/make_png/bitmap.c +++ b/tests/make_png/bitmap.c @@ -453,8 +453,8 @@ void Print_Row( FILE* fp, int index, char* name, int diff ) %04d\n\ %s\n\ %04d\n\ - \n\ - \n", index, name, diff, index); + \n\ + \n", index, name, diff, name); } int First_Column(IMAGE* input){ diff --git a/tests/make_png/html/README b/tests/make_png/html/README new file mode 100644 index 000000000..16091d123 --- /dev/null +++ b/tests/make_png/html/README @@ -0,0 +1 @@ +The HTML files generated are in this directory \ No newline at end of file diff --git a/tests/make_png/html/images/README b/tests/make_png/html/images/README new file mode 100644 index 000000000..96f91f238 --- /dev/null +++ b/tests/make_png/html/images/README @@ -0,0 +1,2 @@ +This folder includes all the images generated + diff --git a/tests/make_png/html/script.js b/tests/make_png/html/script.js new file mode 100644 index 000000000..274538fbb --- /dev/null +++ b/tests/make_png/html/script.js @@ -0,0 +1,22 @@ +var people, asc1 = 1,asc2 = 1,asc3 = 1; + +function sort_t(tbody, col, asc){ + var rows = tbody.rows, rlen = rows.length, arr = new Array(), i, j, cells, clen; + // fill the array with values from the table + for(i = 0; i < rlen; i++){ + cells = rows[i].cells; + clen = cells.length; + arr[i] = new Array(); + for(j = 0; j < clen; j++){ + arr[i][j] = cells[j].innerHTML; + } + } + // sort the array by the specified column number (col) and order (asc) + arr.sort(function(a, b){ + return (a[col] == b[col]) ? 0 : ((a[col] > b[col]) ? asc : -1*asc); + }); + for(i = 0; i < rlen; i++){ + arr[i] = ""+arr[i].join("")+""; + } + tbody.innerHTML = ""+arr.join("")+""; +} diff --git a/tests/make_png/html/style.css b/tests/make_png/html/style.css new file mode 100644 index 000000000..281b5806b --- /dev/null +++ b/tests/make_png/html/style.css @@ -0,0 +1,38 @@ +.freeze{ + height: 50px; + line-height: 60%; + padding: 4px 16px; +} +#sprite { + image-rendering: optimizeSpeed; /* STOP SMOOTHING, GIVE ME SPEED */ + image-rendering: -moz-crisp-edges; /* Firefox */ + image-rendering: -o-crisp-edges; /* Opera */ + image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */ + image-rendering: pixelated; /* Chrome */ + image-rendering: optimize-contrast; /* CSS3 Proposed */ + -ms-interpolation-mode: nearest-neighbor; /* IE8+ */ + width: 50%; + height: auto; +} +table { + border-collapse: collapse; + border: none; + position: relative; + top: 60px; +} +th, +td { + border: 1px solid black; + padding: 4px 16px; + font-family: "Courier New", Courier, monospace; + font-size: 16px; + text-align: left; +} +th { + background-color: #C8C8C8; + cursor: pointer; +} +#hash{ + font-size: 12px; +} + diff --git a/tests/make_png/images/README b/tests/make_png/images/README deleted file mode 100644 index 96f91f238..000000000 --- a/tests/make_png/images/README +++ /dev/null @@ -1,2 +0,0 @@ -This folder includes all the images generated - diff --git a/tests/make_png/make_sprite.c b/tests/make_png/make_sprite.c index 603aa2b54..867788248 100644 --- a/tests/make_png/make_sprite.c +++ b/tests/make_png/make_sprite.c @@ -49,7 +49,7 @@ int main(int argc, char const *argv[]) FT_Error error; int alignment = 4; - char * output_file_name = ( char * )calloc(20,sizeof(char)); + char * output_file_name = ( char * )calloc(50,sizeof(char)); IMAGE* base_png = (IMAGE*)malloc(sizeof(IMAGE)); IMAGE* test_png = (IMAGE*)malloc(sizeof(IMAGE)); @@ -309,6 +309,10 @@ int main(int argc, char const *argv[]) mkdir("./images/", 0777); } + if (stat("./html/images/", &st) == -1) { + mkdir("./html/images/", 0777); + } + FILE* fp = fopen("index.html","w"); fprintf(fp, @@ -455,8 +459,6 @@ int main(int argc, char const *argv[]) Stitch( combi_effect_1, combi_effect_2, output); - Generate_PNG ( output, output_file_name, render_mode ); - if (FT_HAS_GLYPH_NAMES(base_face)) { FT_Get_Glyph_Name( base_face, @@ -465,6 +467,10 @@ int main(int argc, char const *argv[]) 50 ); } + sprintf( output_file_name, "./html/images/%s.png", glyph_name ); + + Generate_PNG ( output, output_file_name, render_mode ); + Print_Row(fp,i,glyph_name,pixel_diff ); } } diff --git a/tests/make_png/script.js b/tests/make_png/script.js deleted file mode 100644 index 274538fbb..000000000 --- a/tests/make_png/script.js +++ /dev/null @@ -1,22 +0,0 @@ -var people, asc1 = 1,asc2 = 1,asc3 = 1; - -function sort_t(tbody, col, asc){ - var rows = tbody.rows, rlen = rows.length, arr = new Array(), i, j, cells, clen; - // fill the array with values from the table - for(i = 0; i < rlen; i++){ - cells = rows[i].cells; - clen = cells.length; - arr[i] = new Array(); - for(j = 0; j < clen; j++){ - arr[i][j] = cells[j].innerHTML; - } - } - // sort the array by the specified column number (col) and order (asc) - arr.sort(function(a, b){ - return (a[col] == b[col]) ? 0 : ((a[col] > b[col]) ? asc : -1*asc); - }); - for(i = 0; i < rlen; i++){ - arr[i] = ""+arr[i].join("")+""; - } - tbody.innerHTML = ""+arr.join("")+""; -} diff --git a/tests/make_png/style.css b/tests/make_png/style.css deleted file mode 100644 index 281b5806b..000000000 --- a/tests/make_png/style.css +++ /dev/null @@ -1,38 +0,0 @@ -.freeze{ - height: 50px; - line-height: 60%; - padding: 4px 16px; -} -#sprite { - image-rendering: optimizeSpeed; /* STOP SMOOTHING, GIVE ME SPEED */ - image-rendering: -moz-crisp-edges; /* Firefox */ - image-rendering: -o-crisp-edges; /* Opera */ - image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */ - image-rendering: pixelated; /* Chrome */ - image-rendering: optimize-contrast; /* CSS3 Proposed */ - -ms-interpolation-mode: nearest-neighbor; /* IE8+ */ - width: 50%; - height: auto; -} -table { - border-collapse: collapse; - border: none; - position: relative; - top: 60px; -} -th, -td { - border: 1px solid black; - padding: 4px 16px; - font-family: "Courier New", Courier, monospace; - font-size: 16px; - text-align: left; -} -th { - background-color: #C8C8C8; - cursor: pointer; -} -#hash{ - font-size: 12px; -} - -- cgit v1.2.1