freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] GSoC-2017-kushal 40c3ab9 42/70: script to compile and run


From: Kushal K S V S
Subject: [freetype2] GSoC-2017-kushal 40c3ab9 42/70: script to compile and run
Date: Sun, 18 Mar 2018 11:21:16 -0400 (EDT)

branch: GSoC-2017-kushal
commit 40c3ab9041f5a3682cc367f70a176185a90659ab
Author: Kushal K S V S <address@hidden>
Commit: Kushal K S V S <address@hidden>

    script to compile and run
---
 include/freetype/config/ftoption.h |   2 +-
 tests/make_png/Makefile            |   5 +--
 tests/make_png/README              |  80 ++++++++++++++++++++++++-------------
 tests/make_png/bitmap.c            |  16 ++------
 tests/make_png/bitmap.h            |   3 +-
 tests/make_png/make_sprite.c       |   6 +--
 tests/make_png/runme.sh            |  30 ++++++++++++++
 tests/make_png/test.ttf            | Bin 0 -> 27296 bytes
 8 files changed, 91 insertions(+), 51 deletions(-)

diff --git a/include/freetype/config/ftoption.h 
b/include/freetype/config/ftoption.h
index a5cb7ff..95b1572 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -118,7 +118,7 @@ FT_BEGIN_HEADER
   /* rendering technology that produces excellent output without LCD       */
   /* filtering.                                                            */
   /*                                                                       */
-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
 
 
   /*************************************************************************/
diff --git a/tests/make_png/Makefile b/tests/make_png/Makefile
index 70187bf..b742dbf 100644
--- a/tests/make_png/Makefile
+++ b/tests/make_png/Makefile
@@ -4,12 +4,12 @@ SHELL = /bin/sh
 
 SRC_SPRITE = make_sprite.c bitmap.c murmur3.c
 
-SRC_LIB = ../../objs/libfreetype.a
+SRC_LIB = ./base/lib/libfreetype.a
 OBJS = $(src:.c=.o)
 
 CFLAGS = -Wall -g
 CC = gcc
-INCLUDE = -I ../../include/
+INCLUDE = -I ./base/include/freetype2/
 LIBS = -lpng -lharfbuzz -lbz2 -ldl
 
 DPI = 72
@@ -25,4 +25,3 @@ clean:
 
 
 
-
diff --git a/tests/make_png/README b/tests/make_png/README
index fd426ac..d880bbc 100644
--- a/tests/make_png/README
+++ b/tests/make_png/README
@@ -1,48 +1,72 @@
-NOTE: First make freetype library (in the ../../ directory)
-  make devel
-  make
  
 TODO:   Generate HTML page for detailed comparison
 
-/*******************************************************************/
+---------------------------------------------------------------------
 
-To generate sprite sheets in the /images folder and to generate the
-"index.html" (List-View) of the glyphs.
+INSTRUCTIONS 
 
-By clicking on the Headers of the respective columns,they can be
-arranged (in increasing/decreasing order) based on
-->  Glyph-Index
-->  Name
-->  Difference Metric (right now it is the number of pixels that are
-    different between the base and the test glyph)
+NOTE: One version of FreeType is referred as "base" version and the 
+      other as the "test" version.
 
-It displays the whole sprite sheet right now (will be used later)
-Hashes will be diplayed (To be implemented)
+  1. Get the two versions ready
+  -------------------------------------
+    Make two folders named "test" and "base" preferably in the home 
+    directory.
 
-First compile and install two versions of the FreeType libray 
-in different folders (with SUBPIXEL_RENDERING enabled in ftoption.h)
+    Next, download an older version of FreeType (For example : 2.6.5)
+    ( This being the "test" version of the two)
+    Go to 'include/freetype/ftoption.h' and uncomment this line 
 
+        #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+  
+  2. Install the two versions 
+  -------------------------------------     
+   Go to the "test" version's folder and change the default 
+   installation directory to the "test" folder created.
 
-1)  make sprite
-    (set resoluton in DPI by passing argument
+       ./configure --prefix=<path>
+
+    Compile and install the library
+
+       make 
+       make install
+
+    Repeat step 2. for the "base" version as well.
+
+ 3. Compile the code
+  -------------------------------------     
+    Return to this folder and make the binary
+
+       make
+
+    (set resolution in DPI by passing argument
     example: make DPI=100, if not specified,default is 72)
 
-2)  Usage ./sprite <a> <b> <font_file> <pt_size> <render_mode>
+ 3. Run the executable
+  ------------------------------------- 
+
+       ./sprite <a> <b> <font_file> <pt_size> <render_mode>
+
+    <a> is the libfreetype.so from the base vesion. 
+    <b> is the libfreetype.so from the test vesion.
 
-    (<a> is the libfreetype.so from the base vesion )
-    (<b> is the libfreetype.so from the test vesion )
+    ( <a> and <b> are in <base/test version's installation folder>/lib/ )
+    ( The path to these should be absolute. )
 
-    The path to the "shared library" in usage should be absolute.
+       Open index.html for "list-view"
+---------------------------------------------------------------------
 
-    Sprite Sheets will be saved as sprite_$(glyph_index).png
+FEATURES
 
-    Render modes similar to generating PNG(s).
+    Generates sprite sheets in the ./images folder.
 
-NOTE: If the dimensions of the two glyphs to be compared are
-different, comparison is done after aligning the glyphs.
-This alignment will effect the 'Difference Metric' based on the 
-number of rows/columns added.
+    Generates "list-view" web-page i.e index.html
 
+    By clicking on the Headers of the respective columns,they can be
+    arranged (in increasing/decreasing order) based on
+      ->  Glyph-Index
+      ->  Name
+      ->  Difference Metric 
 
 
 
diff --git a/tests/make_png/bitmap.c b/tests/make_png/bitmap.c
index 6e1ff6d..4ee3e56 100644
--- a/tests/make_png/bitmap.c
+++ b/tests/make_png/bitmap.c
@@ -446,23 +446,15 @@ int Compare_Hash(HASH_128* hash_b, HASH_128* hash_t){
   return 0;
 }
 
-void Print_Row( FILE* fp, int index, char* name, int diff,
-                HASH_128* hash_b, HASH_128* hash_t){
+void Print_Row( FILE* fp, int index, char* name, int diff )
+{
   fprintf(fp,
     "<tr>\n\
       <td>%04d</td>\n\
       <td>%s</td>\n\
       <td>%04d</td>\n\
-      <td id=\"hash\">%08x%08x%08x%08x<br>%08x%08x%08x%08x</td>\n\
-      <td><img id=\"sprite\" src=\"images/sprite_%04d.png\"></td>\n\
-    </tr>\n", index, name, diff,hash_b->hash[0],
-                                hash_b->hash[1],
-                                hash_b->hash[2],
-                                hash_b->hash[3],
-                                hash_t->hash[0],
-                                hash_t->hash[1],
-                                hash_t->hash[2],
-                                hash_t->hash[3], index);
+      <td id=\"image_row\"><img id=\"sprite\" 
src=\"images/sprite_%04d.png\"></td>\n\
+    </tr>\n", index, name, diff, index);
 }
 
 int First_Column(IMAGE* input){
diff --git a/tests/make_png/bitmap.h b/tests/make_png/bitmap.h
index 51e05cd..c7fb26b 100644
--- a/tests/make_png/bitmap.h
+++ b/tests/make_png/bitmap.h
@@ -80,8 +80,7 @@ int Add_effect(IMAGE* base, IMAGE* test, IMAGE* out, int 
Effect_ID);
 /* Stitch 2 PNG files */
 void Stitch(IMAGE* left, IMAGE* right, IMAGE* result);
 /* Print the row in list-view webpage */
-void Print_Row( FILE* fp, int index, char* name, int diff,
-                HASH_128* hash_b, HASH_128* hash_t);
+void Print_Row( FILE* fp, int index, char* name, int diff );
 /* Finding the first non-empty (non-white) column */
 int First_Column(IMAGE* input);
 /* Finding the first non-empty (non-white) row */
diff --git a/tests/make_png/make_sprite.c b/tests/make_png/make_sprite.c
index ceb95b5..603aa2b 100644
--- a/tests/make_png/make_sprite.c
+++ b/tests/make_png/make_sprite.c
@@ -339,9 +339,6 @@ int main(int argc, char const *argv[])
         <a href=\"#\">Difference</a>\n\
       </th>\n\
       <th>\n\
-        128-bit Hash-values\n\
-      </th>\n\
-      <th>\n\
         Images\n\
       </th>\n\
       </tr>\n\
@@ -468,8 +465,7 @@ int main(int argc, char const *argv[])
                             50 );
       }
 
-      Print_Row(fp,i,glyph_name,pixel_diff, base_murmur,
-                                            test_murmur );
+      Print_Row(fp,i,glyph_name,pixel_diff );
     }
   }
 
diff --git a/tests/make_png/runme.sh b/tests/make_png/runme.sh
new file mode 100644
index 0000000..9761ad7
--- /dev/null
+++ b/tests/make_png/runme.sh
@@ -0,0 +1,30 @@
+TEST_DIR=$1
+BASE_DIR=$PWD
+
+cd $TEST_DIR/include/freetype/config/
+sed -i 's/\/\* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING \*\//#define 
FT_CONFIG_OPTION_SUBPIXEL_RENDERING /g' ftoption.h
+
+cd $TEST_DIR
+./autogen.sh
+./configure --prefix=$BASE_DIR/test/
+make 
+make install 
+
+cd $BASE_DIR/../..
+./autogen.sh
+./configure --prefix=$BASE_DIR/base/
+make 
+make install
+
+cd $BASE_DIR
+make
+
+BASE_LIB=./base/lib/libfreetype.so
+TEST_LIB=./test/lib/libfreetype.so
+
+FONT_FILE=$2
+PT_SIZE=$3
+RENDER_MODE=$4
+
+./sprite $BASE_LIB $TEST_LIB $FONT_FILE $PT_SIZE $RENDER_MODE
+
diff --git a/tests/make_png/test.ttf b/tests/make_png/test.ttf
new file mode 100644
index 0000000..d03485f
Binary files /dev/null and b/tests/make_png/test.ttf differ



reply via email to

[Prev in Thread] Current Thread [Next in Thread]