summaryrefslogtreecommitdiff
path: root/atari/plot/font_vdi.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2011-01-22 16:43:51 +0000
committerOle Loots <ole@monochrom.net>2011-01-22 16:43:51 +0000
commitc0c423fbcab22476ec90be202d8ad887cd441148 (patch)
tree06a38dcf8728fe949b334538fbb2bf65601c8642 /atari/plot/font_vdi.c
parentb8f40265f461dd67883b15b5bc9a7cccd13ce25b (diff)
downloadnetsurf-c0c423fbcab22476ec90be202d8ad887cd441148.tar.gz
netsurf-c0c423fbcab22476ec90be202d8ad887cd441148.tar.bz2
Improved compatibility with classic TOS systems.
svn path=/trunk/netsurf/; revision=11450
Diffstat (limited to 'atari/plot/font_vdi.c')
-rw-r--r--atari/plot/font_vdi.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/atari/plot/font_vdi.c b/atari/plot/font_vdi.c
index 04a94734e..7d6a3f494 100644
--- a/atari/plot/font_vdi.c
+++ b/atari/plot/font_vdi.c
@@ -42,7 +42,11 @@ static int pixel_position( FONT_PLOTTER self, const plot_font_style_t *fstyle,co
static int text( FONT_PLOTTER self, int x, int y, const char *text, size_t length, const plot_font_style_t *fstyle );
static bool init = false;
-static int vdih;
+static int vdih;
+
+extern struct s_vdi_sysinfo vdi_sysinfo;
+extern unsigned short gdosversion;
+
int ctor_font_plotter_vdi( FONT_PLOTTER self )
{
self->dtor = dtor;
@@ -202,14 +206,22 @@ static int text( FONT_PLOTTER self, int x, int y, const char *text, size_t leng
pass it as arg, to reduce netsurf dependency */
pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
}
- vst_effects( self->vdi_handle, fx );
- vst_alignment(vdih, 0, 4, &cw, &ch );
- vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh);
- vswr_mode( self->vdi_handle, MD_TRANS );
- vst_color( self->vdi_handle, RGB_TO_VDI(fstyle->foreground) );
x += CURFB(self->plotter).x;
y += CURFB(self->plotter).y;
- v_ftext( self->vdi_handle, x, y, (char*)&textcpy );
+ vst_effects( self->vdi_handle, fx );
+ vst_alignment(vdih, 0, 4, &cw, &ch );
+ vst_height( self->vdi_handle, pxsize, &cw, &ch, &cellw, &cellh);
+ vswr_mode( self->vdi_handle, MD_TRANS );
+ if( vdi_sysinfo.scr_bpp >= 4 ){
+ vst_color( self->vdi_handle, RGB_TO_VDI(fstyle->foreground) );
+ } else {
+ vst_color( self->vdi_handle, BLACK );
+ }
+ if( gdosversion > 0x03000 ){
+ v_ftext( self->vdi_handle, x, y, (char*)&textcpy );
+ } else {
+ v_gtext( self->vdi_handle, x, y, (char*)&textcpy );
+ }
free( lstr );
return( 0 );
}