First correct render

This commit is contained in:
Anurag Thakur 2023-09-29 01:46:56 +05:30
parent 382949cdea
commit 579d9385ef
2 changed files with 16 additions and 20 deletions

View File

@ -2626,6 +2626,11 @@
tags--;
}
if (((*slot)->glyph_index == 37))
{
printf("moveit\n");
}
FT_TRACE5(( " move to (%.2f, %.2f)\n",
(double)v_start.x / 64, (double)v_start.y / 64 ));
// error = func_interface->move_to( &v_start, user );
@ -2645,6 +2650,7 @@
ptr = (*slot)->prelines = pl;
}else{
ptr->next = pl;
ptr = ptr->next;
}
@ -2671,14 +2677,14 @@
if((*slot)->glyph_index == 37)
printf( " line to (%.2f, %.2f)\n",
(double)vec.x / 64, (double)vec.y / 64 );
FT_PreLine pl = malloc(sizeof(FT_PreLineRec));
pl->x1 = ptr->x2;
pl->y1 = ptr->y2;
pl->x2 = vec.x;
pl->y2 = vec.y;
pl->next = NULL;
pl->ismove = 0;
ptr->next = pl;
FT_PreLine pl3 = malloc(sizeof(FT_PreLineRec));
pl3->x1 = ptr->x2;
pl3->y1 = ptr->y2;
pl3->x2 = vec.x;
pl3->y2 = vec.y;
pl3->next = NULL;
pl3->ismove = 0;
ptr->next = pl3;
ptr = ptr->next;
continue;
}
@ -2699,7 +2705,7 @@
pl2->x2 = v_start.x;
pl2->y2 = v_start.y;
pl2->next = NULL;
pl->ismove = 0;
pl2->ismove = 0;
ptr->next = pl2;
ptr = ptr->next;

View File

@ -85,16 +85,6 @@ dense_line_to( const FT_Vector* to, dense_worker* worker )
return 0;
}
static int
dense_line_to2( const FT_Vector* from, const FT_Vector* to, dense_worker* worker )
{
dense_move_to( from, worker );
dense_render_line( worker, UPSCALE( to->x ), UPSCALE( to->y ) );
dense_move_to( to, worker );
return 0;
}
void
dense_render_line( dense_worker* worker, FT_Pos tox, FT_Pos toy )
{
@ -447,7 +437,7 @@ dense_render_glyph( dense_worker* worker, const FT_Bitmap* target, FT_PreLine pl
if(pl->ismove){
dense_move_to(&point2, worker);
}else{
dense_line_to2(&point1, &point2, worker);
dense_line_to(&point2, worker);
}
pl= pl->next;
}