some changes used to debug the new raster and the OS/2
graphics driver
This commit is contained in:
parent
6bc8b1f07d
commit
f6356ab713
|
@ -77,7 +77,7 @@
|
||||||
|
|
||||||
short visual; /* display glyphs while rendering */
|
short visual; /* display glyphs while rendering */
|
||||||
short gray_render; /* smooth fonts with gray levels */
|
short gray_render; /* smooth fonts with gray levels */
|
||||||
|
short force_low;
|
||||||
|
|
||||||
|
|
||||||
static void Clear_Buffer();
|
static void Clear_Buffer();
|
||||||
|
@ -152,9 +152,11 @@
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
glyph->outline.second_pass = 0;
|
glyph->outline.second_pass = 0;
|
||||||
glyph->outline.high_precision = 0;
|
|
||||||
glyph->outline.dropout_mode = 0;
|
glyph->outline.dropout_mode = 0;
|
||||||
|
|
||||||
|
if (force_low)
|
||||||
|
glyph->outline.high_precision = 0;
|
||||||
|
|
||||||
/* debugging */
|
/* debugging */
|
||||||
#if 0
|
#if 0
|
||||||
if ( idx == 0 && !visual )
|
if ( idx == 0 && !visual )
|
||||||
|
@ -174,8 +176,10 @@
|
||||||
&outlines[cur_glyph] );
|
&outlines[cur_glyph] );
|
||||||
|
|
||||||
/* copy the glyph outline into it */
|
/* copy the glyph outline into it */
|
||||||
glyph->outline.high_precision = 0;
|
|
||||||
glyph->outline.second_pass = 0;
|
glyph->outline.second_pass = 0;
|
||||||
|
if (force_low)
|
||||||
|
glyph->outline.high_precision = 0;
|
||||||
|
|
||||||
FT_Copy_Outline( &glyph->outline, &outlines[cur_glyph] );
|
FT_Copy_Outline( &glyph->outline, &outlines[cur_glyph] );
|
||||||
|
|
||||||
/* center outline around 0 */
|
/* center outline around 0 */
|
||||||
|
@ -208,8 +212,6 @@
|
||||||
FT_Error ConvertRaster( int index )
|
FT_Error ConvertRaster( int index )
|
||||||
{
|
{
|
||||||
outlines[index].second_pass = 0;
|
outlines[index].second_pass = 0;
|
||||||
outlines[index].high_precision = 0;
|
|
||||||
|
|
||||||
return FT_Get_Outline_Bitmap( library, &outlines[index], &Bit );
|
return FT_Get_Outline_Bitmap( library, &outlines[index], &Bit );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,6 +226,7 @@
|
||||||
fprintf( stderr, " -s : character pixel size (default is 600)\n" );
|
fprintf( stderr, " -s : character pixel size (default is 600)\n" );
|
||||||
fprintf( stderr, " -v : display results..\n" );
|
fprintf( stderr, " -v : display results..\n" );
|
||||||
fprintf( stderr, " -g : render anti-aliased glyphs\n" );
|
fprintf( stderr, " -g : render anti-aliased glyphs\n" );
|
||||||
|
fprintf( stderr, " -l : force low quality even at small sizes\n" );
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,6 +246,7 @@
|
||||||
|
|
||||||
gray_render = 0;
|
gray_render = 0;
|
||||||
visual = 0;
|
visual = 0;
|
||||||
|
force_low = 0;
|
||||||
|
|
||||||
while ( argc > 1 && argv[1][0] == '-' )
|
while ( argc > 1 && argv[1][0] == '-' )
|
||||||
{
|
{
|
||||||
|
@ -252,6 +256,10 @@
|
||||||
gray_render = 1;
|
gray_render = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'l':
|
||||||
|
force_low = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
visual = 1;
|
visual = 1;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "grfont.h"
|
#include "grfont.h"
|
||||||
|
@ -34,7 +35,6 @@
|
||||||
|
|
||||||
#define MAXPTSIZE 500 /* dtp */
|
#define MAXPTSIZE 500 /* dtp */
|
||||||
|
|
||||||
|
|
||||||
char Header[128];
|
char Header[128];
|
||||||
char* new_header = 0;
|
char* new_header = 0;
|
||||||
|
|
||||||
|
@ -64,6 +64,24 @@
|
||||||
|
|
||||||
int graph_init = 0;
|
int graph_init = 0;
|
||||||
|
|
||||||
|
#define DEBUGxxx
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
#define LOG(x) LogMessage##x
|
||||||
|
#else
|
||||||
|
#define LOG(x) /* rien */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
static void LogMessage( const char* fmt, ... )
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start( ap, fmt );
|
||||||
|
vfprintf( stderr, fmt, ap );
|
||||||
|
va_end( ap );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* PanicZ */
|
/* PanicZ */
|
||||||
static void PanicZ( const char* message )
|
static void PanicZ( const char* message )
|
||||||
|
@ -77,6 +95,8 @@
|
||||||
static void Clear_Display( void )
|
static void Clear_Display( void )
|
||||||
{
|
{
|
||||||
long size = (long)bit.pitch * bit.rows;
|
long size = (long)bit.pitch * bit.rows;
|
||||||
|
|
||||||
|
if (size < 0) size = -size;
|
||||||
memset( bit.buffer, 0, size );
|
memset( bit.buffer, 0, size );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +120,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define MAX_BUFFER 65000
|
#define MAX_BUFFER 300000
|
||||||
|
|
||||||
#define FLOOR(x) ((x) & -64)
|
#define FLOOR(x) ((x) & -64)
|
||||||
#define CEIL(x) (((x)+63) & -64)
|
#define CEIL(x) (((x)+63) & -64)
|
||||||
|
@ -118,6 +138,7 @@
|
||||||
grBitmap bit3;
|
grBitmap bit3;
|
||||||
int width, height, pitch, size;
|
int width, height, pitch, size;
|
||||||
int left, right, top, bottom;
|
int left, right, top, bottom;
|
||||||
|
int x_top, y_top;
|
||||||
|
|
||||||
left = FLOOR( glyph->metrics.horiBearingX );
|
left = FLOOR( glyph->metrics.horiBearingX );
|
||||||
right = CEIL( glyph->metrics.horiBearingX + glyph->metrics.width );
|
right = CEIL( glyph->metrics.horiBearingX + glyph->metrics.width );
|
||||||
|
@ -167,10 +188,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Then, blit the image to the target surface */
|
/* Then, blit the image to the target surface */
|
||||||
|
x_top = x_offset + TRUNC(left);
|
||||||
|
y_top = y_offset - TRUNC(top);
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (bit.pitch < 0)
|
||||||
|
y_top = bit.rows - y_top;
|
||||||
|
*/
|
||||||
grBlitGlyphToBitmap( &bit,
|
grBlitGlyphToBitmap( &bit,
|
||||||
&bit3,
|
&bit3,
|
||||||
x_offset + TRUNC(left),
|
x_top,
|
||||||
y_offset - TRUNC(top),
|
y_top,
|
||||||
(grColor)127L );
|
(grColor)127L );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +243,6 @@
|
||||||
|
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
|
|
||||||
start_x = 4;
|
start_x = 4;
|
||||||
start_y = 16 + ptsize ;
|
start_y = 16 + ptsize ;
|
||||||
|
|
||||||
|
@ -231,6 +258,19 @@
|
||||||
{
|
{
|
||||||
if ( !(error = LoadChar( i, hinted )) )
|
if ( !(error = LoadChar( i, hinted )) )
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (i <= first_glyph+6)
|
||||||
|
{
|
||||||
|
LOG(( "metrics[%02d] = [%x %x]\n",
|
||||||
|
i,
|
||||||
|
glyph->metrics.horiBearingX,
|
||||||
|
glyph->metrics.horiAdvance ));
|
||||||
|
|
||||||
|
if (i == first_glyph+6)
|
||||||
|
LOG(( "-------------------------\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
Render_Glyph( x, y );
|
Render_Glyph( x, y );
|
||||||
|
|
||||||
x += ( glyph->metrics.horiAdvance >> 6 ) + 1;
|
x += ( glyph->metrics.horiAdvance >> 6 ) + 1;
|
||||||
|
|
Loading…
Reference in New Issue