[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] GSoC-2017-kushal 7b9c8e8 2/4: Adding functions to differenti
From: |
Kushal K S V S |
Subject: |
[freetype2] GSoC-2017-kushal 7b9c8e8 2/4: Adding functions to differentiate Font Type |
Date: |
Thu, 22 Mar 2018 07:09:46 -0400 (EDT) |
branch: GSoC-2017-kushal
commit 7b9c8e88bacedcb968e90cde0d9412cd379cdb98
Author: Kushal K S V S <address@hidden>
Commit: Kushal K S V S <address@hidden>
Adding functions to differentiate Font Type
---
.DS_Store | Bin 10244 -> 10244 bytes
tests/bitmap.c | 41 ++++++++++++++++++++++++++++++++++++++---
tests/bitmap.h | 4 ++++
3 files changed, 42 insertions(+), 3 deletions(-)
diff --git a/.DS_Store b/.DS_Store
index 4fcda83..4b65ed6 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/tests/bitmap.c b/tests/bitmap.c
index 9891752..77a50a4 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 ed3e0f1..457da7e 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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] GSoC-2017-kushal 7b9c8e8 2/4: Adding functions to differentiate Font Type,
Kushal K S V S <=