[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] arv-test b8753b4: Add basic HTML table with zoomed glyphs w/
From: |
Arvinder Bhathal |
Subject: |
[freetype2] arv-test b8753b4: Add basic HTML table with zoomed glyphs w/o anti-aliasing |
Date: |
Wed, 21 Jun 2017 01:57:02 -0400 (EDT) |
branch: arv-test
commit b8753b44fcf37363bf8d8fa87c2b3a733b28cf69
Author: Arvinder Bhathal <address@hidden>
Commit: Arvinder Bhathal <address@hidden>
Add basic HTML table with zoomed glyphs w/o anti-aliasing
---
glyphtest/index.html | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
glyphtest/main-2.c | 2 +-
glyphtest/main.c | 2 +-
glyphtest/readme.txt | 5 +++++
4 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/glyphtest/index.html b/glyphtest/index.html
new file mode 100644
index 0000000..94f776d
--- /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 0c84692..eb042bf 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 cc1b60d..45adda6 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 0000000..2e8fab8
--- /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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] arv-test b8753b4: Add basic HTML table with zoomed glyphs w/o anti-aliasing,
Arvinder Bhathal <=