summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal K S V S <kkushal32@gmail.com>2018-03-22 16:25:26 +0530
committerKushal K S V S <kkushal32@gmail.com>2018-03-22 16:25:26 +0530
commit7b9c8e88bacedcb968e90cde0d9412cd379cdb98 (patch)
tree40aabc1ca205709da6cad207b102515415bdc667
parent9fdda1ad75fef791373fcd5289f5272ea947ed9d (diff)
downloadfreetype2-7b9c8e88bacedcb968e90cde0d9412cd379cdb98.tar.gz
Adding functions to differentiate Font Type
-rw-r--r--.DS_Storebin10244 -> 10244 bytes
-rw-r--r--tests/bitmap.c41
-rw-r--r--tests/bitmap.h4
3 files changed, 42 insertions, 3 deletions
diff --git a/.DS_Store b/.DS_Store
index 4fcda8343..4b65ed6a2 100644
--- a/.DS_Store
+++ b/.DS_Store
Binary files differ
diff --git a/tests/bitmap.c b/tests/bitmap.c
index 98917527e..77a50a461 100644
--- a/tests/bitmap.c
+++ b/tests/bitmap.c
@@ -659,8 +659,8 @@ void Print_Head( FILE* fp ){
<title>\n\
Glyph_Diff\n\
</title>\n\
- <script src=\"../../../../../source/scripts/top.js\" type=\"text/javascript\"></script>\n\
- <link href=\"../../../../../source/styles/top.css\" rel=\"stylesheet\" type=\"text/css\" >\n\
+ <script src=\"../../../../../../source/scripts/top.js\" type=\"text/javascript\"></script>\n\
+ <link href=\"../../../../../../source/styles/top.css\" rel=\"stylesheet\" type=\"text/css\" >\n\
</head>\n\
<body>\n\
<button onclick=\"topFunction()\" id=\"myBtn\" title=\"Go to top\">Top</button>\n\
@@ -703,7 +703,7 @@ void Print_Row( FILE* fp, int index, char* name, int diff )
}
/* To calculate the Difference-Metric used in the list-view page */
-int Image_Diff( IMAGE* base, IMAGE* test){
+int Image_Diff(IMAGE* base, IMAGE* test){
int diff = 0;
@@ -718,4 +718,39 @@ int Image_Diff( IMAGE* base, IMAGE* test){
return diff;
}
+
+/* This function takes font file name and returns the font name */
+/* Returns a string */
+char* Get_Font_File_Name(const char* font_file_full_name){
+ int file_name_length = strlen(font_file_full_name);
+ char* name = (char*)malloc(file_name_length*sizeof(char));
+
+ int count = 0;
+ while(font_file_full_name[count] != '.'){
+ name[count] = font_file_full_name[count];
+ count++;
+ }
+ name[count] = '\0'; /* Ending the String */
+
+ return name;
+}
+
+/* This function takes font file name and returns the file extension*/
+/* Returns a string */
+char* Get_Font_File_Type(const char* font_file_full_name){
+ int file_name_length = strlen(font_file_full_name);
+ char* extension = (char*)malloc(file_name_length*sizeof(char));
+
+ int count = 0;
+ while(font_file_full_name[count++] != '.'){}
+
+ int i = 0;
+ while(count < file_name_length){
+ extension[i++] = font_file_full_name[count++];
+ }
+ extension[i] = '\0'; /* Ending the String */
+
+ return extension;
+}
+
/* For more information on the list-view page, go to README */
diff --git a/tests/bitmap.h b/tests/bitmap.h
index ed3e0f1c0..457da7e4c 100644
--- a/tests/bitmap.h
+++ b/tests/bitmap.h
@@ -88,3 +88,7 @@ int Image_Diff( IMAGE* base, IMAGE* test);
void Print_Row( FILE* fp, int index, char* name, int diff );
/* Print the table-headers in list-view webpage */
void Print_Head( FILE* fp );
+/* Returns the name of the font file without the extension */
+char* Get_Font_File_Name(const char* font_file_full_name);
+/* Returns the file extension of the font file */
+char* Get_Font_File_Type(const char* font_file_full_name);