summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArvinder Bhathal <arvinder.bhathal@gmail.com>2017-06-21 01:56:37 -0400
committerArvinder Bhathal <arvinder.bhathal@gmail.com>2017-06-21 01:56:37 -0400
commitb8753b44fcf37363bf8d8fa87c2b3a733b28cf69 (patch)
treefaf9825dfc62ed81451090a5c2cbe46578ebd6d8
parent291c90597f7500201f8ce6778011d939d61846f8 (diff)
downloadfreetype2-b8753b44fcf37363bf8d8fa87c2b3a733b28cf69.tar.gz
Add basic HTML table with zoomed glyphs w/o anti-aliasing
-rw-r--r--glyphtest/index.html48
-rw-r--r--glyphtest/main-2.c2
-rw-r--r--glyphtest/main.c2
-rw-r--r--glyphtest/readme.txt5
4 files changed, 55 insertions, 2 deletions
diff --git a/glyphtest/index.html b/glyphtest/index.html
new file mode 100644
index 000000000..94f776def
--- /dev/null
+++ b/glyphtest/index.html
@@ -0,0 +1,48 @@
+ <!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>glyphtest-test</title>
+ <style>
+ img {
+ display: none;
+ }
+
+ table {
+ margin: 0 auto;
+ }
+ </style>
+ </head>
+ <body onload="draw();">
+ <table>
+ <tr>
+ <td><img src="65"></td>
+ <td><img src="65-2"></td>
+ </tr>
+ <tr>
+ <td><img src="66"></td>
+ <td><img src="66-2"></td>
+ </tr>
+ </table>
+
+ <script>
+ function draw() {
+ for (var i = 0; i < document.images.length; i++) {
+
+ canvas = document.createElement('canvas');
+ canvas.setAttribute('width', 300);
+ canvas.setAttribute('height', 300);
+
+ document.images[i].parentNode.insertBefore(canvas,document.images[i]);
+
+ ctx = canvas.getContext('2d');
+
+ ctx.imageSmoothingEnabled = false;
+
+ ctx.drawImage(document.images[i], 0, 0, 60, 60);
+ }
+ }
+ </script>
+
+ </body>
+</html>
diff --git a/glyphtest/main-2.c b/glyphtest/main-2.c
index 0c8469273..eb042bf88 100644
--- a/glyphtest/main-2.c
+++ b/glyphtest/main-2.c
@@ -56,7 +56,7 @@ int main()
for (x = 0; x < bmp.width; x++)
{
byte = bmp.buffer[bmp.pitch * y + x];
- BMP_SetPixelRGB(qdbmp, x, y, byte, byte, byte);
+ BMP_SetPixelRGB(qdbmp, x, y, 255 - byte, 255 - byte, 255 - byte);
BMP_CHECK_ERROR(stdout, 1);
}
}
diff --git a/glyphtest/main.c b/glyphtest/main.c
index cc1b60d5e..45adda66f 100644
--- a/glyphtest/main.c
+++ b/glyphtest/main.c
@@ -56,7 +56,7 @@ int main()
for (x = 0; x < bmp.width; x++)
{
byte = bmp.buffer[bmp.pitch * y + x];
- BMP_SetPixelRGB(qdbmp, x, y, byte, byte, byte);
+ BMP_SetPixelRGB(qdbmp, x, y, 255 - byte, 255 - byte, 255 - byte);
BMP_CHECK_ERROR(stdout, 1);
}
}
diff --git a/glyphtest/readme.txt b/glyphtest/readme.txt
new file mode 100644
index 000000000..2e8fab843
--- /dev/null
+++ b/glyphtest/readme.txt
@@ -0,0 +1,5 @@
+Compile with baseline:
+gcc main.c qdbmp.c -I ./freetype-2.5.1/include -L ./freetype-2.5.1/objs -lfreetype -o baseline
+
+Compile with test:
+gcc main-2.c qdbmp.c -I ./freetype-2.8/include -L ./freetype-2.8/objs -lfreetype -o test