[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] GSoC-2017-kushal 0a920f8 44/70: Changing image names and loc
From: |
Kushal K S V S |
Subject: |
[freetype2] GSoC-2017-kushal 0a920f8 44/70: Changing image names and location |
Date: |
Sun, 18 Mar 2018 11:21:16 -0400 (EDT) |
branch: GSoC-2017-kushal
commit 0a920f8028fec9bf3c4d563c106eb20f1588c072
Author: Kushal K S V S <address@hidden>
Commit: Kushal K S V S <address@hidden>
Changing image names and location
---
tests/make_png/bitmap.c | 4 ++--
tests/make_png/html/README | 1 +
tests/make_png/{ => html}/images/README | 0
tests/make_png/{ => html}/script.js | 0
tests/make_png/{ => html}/style.css | 0
tests/make_png/make_sprite.c | 12 +++++++++---
6 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/tests/make_png/bitmap.c b/tests/make_png/bitmap.c
index 4ee3e56..f006184 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 )
<td>%04d</td>\n\
<td>%s</td>\n\
<td>%04d</td>\n\
- <td id=\"image_row\"><img id=\"sprite\"
src=\"images/sprite_%04d.png\"></td>\n\
- </tr>\n", index, name, diff, index);
+ <td id=\"image_row\"><img id=\"sprite\" src=\"images/%s.png\"></td>\n\
+ </tr>\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 0000000..16091d1
--- /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/images/README b/tests/make_png/html/images/README
similarity index 100%
rename from tests/make_png/images/README
rename to tests/make_png/html/images/README
diff --git a/tests/make_png/script.js b/tests/make_png/html/script.js
similarity index 100%
rename from tests/make_png/script.js
rename to tests/make_png/html/script.js
diff --git a/tests/make_png/style.css b/tests/make_png/html/style.css
similarity index 100%
rename from tests/make_png/style.css
rename to tests/make_png/html/style.css
diff --git a/tests/make_png/make_sprite.c b/tests/make_png/make_sprite.c
index 603aa2b..8677882 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 );
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] GSoC-2017-kushal 0a920f8 44/70: Changing image names and location,
Kushal K S V S <=