[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] gsoc-anurag-2023 5721ad0e3 2/2: Finally, it works
From: |
Werner Lemberg |
Subject: |
[freetype2] gsoc-anurag-2023 5721ad0e3 2/2: Finally, it works |
Date: |
Fri, 29 Sep 2023 15:17:46 -0400 (EDT) |
branch: gsoc-anurag-2023
commit 5721ad0e383bf3ef525afa6d16732c71119b0a01
Author: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
Commit: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
Finally, it works
---
src/base/ftobjs.c | 9 +++++++++
src/dense/ftdenserend.c | 14 +++++++++++++-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 747d0cb1f..a50395557 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -72,6 +72,13 @@
#define MD5_Update FT_MD5_Update
#define MD5_Final FT_MD5_Final
+#define PIXEL_BITS 8
+
+#define ONE_PIXEL ( 1 << PIXEL_BITS )
+#define TRUNC( x ) (int)( ( x ) >> PIXEL_BITS )
+
+#define UPSCALE( x ) ( ( x ) * ( ONE_PIXEL >> 6 ) )
+#define DOWNSCALE( x ) ( ( x ) >> ( PIXEL_BITS - 6 ) )
#undef HAVE_OPENSSL
#include "md5.c"
@@ -2784,6 +2791,8 @@ int conic_to2(FT_GlyphSlot* slot, FT_Vector *control,
FT_Vector *from, FT_Vector
case FT_CURVE_TAG_CONIC: /* consume conic arcs */
// v_control.x = SCALED( point->x );
// v_control.y = SCALED( point->y );
+ v_control.x = point->x ;
+ v_control.y = point->y ;
Do_Conic:
if ( point < limit )
diff --git a/src/dense/ftdenserend.c b/src/dense/ftdenserend.c
index 2b3cafd91..c9fbb0f22 100644
--- a/src/dense/ftdenserend.c
+++ b/src/dense/ftdenserend.c
@@ -162,8 +162,20 @@
}
/* translate outline to render it into the bitmap */
- if ( x_shift || y_shift )
+ if ( x_shift || y_shift ){
FT_Outline_Translate( outline, x_shift, y_shift );
+ FT_PreLine pl = slot->prelines;
+ while (pl!=NULL)
+ {
+ pl->x1 += x_shift;
+ pl->y1 += y_shift;
+ pl->x2 += x_shift;
+ pl->y2 += y_shift;
+
+ pl = pl->next;
+ }
+
+ }
/* set up parameters */
params.target = bitmap;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] gsoc-anurag-2023 5721ad0e3 2/2: Finally, it works,
Werner Lemberg <=