19#ifdef WITH_VDI_FONT_DRIVER
37 size_t length,
int x,
size_t *char_offset,
int *actual_x );
39 size_t length,
int x,
size_t *char_offset,
int *actual_x );
42static bool init =
false;
47static inline void atari_to_vdi_str(
char *lstr,
int length)
51 for (i=z=0; i<length; ) {
52 if (((
char)lstr[i]==(
char)0xC2) && ((
char)lstr[i+1] == (
char)0xA0)) {
73 NSLOG(netsurf, INFO,
"%s: %s\n", (
char *)__FILE__, __FUNCTION__);
87 size_t length,
int *
width )
89 short cw, ch, cellw, cellh;
95 assert( lstr != NULL );
96 int slen = strlen(lstr);
99 atari_to_vdi_str(lstr, slen);
105 if( fstyle->
weight > 450 )
112 vst_point( self->
vdi_handle, pxsize, &cw, &ch, &cellw, &cellh);
120 *
width = slen * cellw;
126 size_t length,
int x,
size_t *char_offset,
int *actual_x )
128 short cw, ch, cellw, cellh;
133 int last_space_x = 0;
134 int last_space_idx = 0;
138 assert( lstr != NULL );
142 atari_to_vdi_str(lstr, slen);
148 if( fstyle->
weight > 450 )
155 vst_point( self->
vdi_handle, pxsize, &cw, &ch, &cellw, &cellh);
158 while (nxtchr < slen) {
159 if( lstr[nxtchr] ==
' ' ) {
160 last_space_x = *actual_x;
161 last_space_idx = nxtchr;
164 if (*actual_x > x && last_space_idx != 0) {
165 *actual_x = last_space_x;
166 *char_offset = last_space_idx;
173 if(nxtchr >= length){
177 *char_offset = nxtchr;
198 size_t length,
int x,
size_t *char_offset,
int *actual_x )
200 short cw, ch, cellw, cellh;
207 assert( lstr != NULL );
208 int slen = strlen(lstr);
210 atari_to_vdi_str(lstr, slen);
216 if( fstyle->
weight > 450 )
220 vst_height( self->
vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh);
223 for( i=0; i<slen; i++) {
236static inline void vst_rgbcolor(
short vdih, uint32_t cin )
238#ifdef WITH_8BPP_SUPPORT
247#ifdef WITH_8BPP_SUPPORT
250 vst_color(
vdih, RGB_TO_VDI(cin) );
252 vst_color(
vdih, BLACK );
261 short cw, ch, cellw, cellh;
267 assert( lstr != NULL );
269 int slen = strlen(lstr);
275 atari_to_vdi_str(lstr, slen);
281 if( fstyle->
weight > 450 )
293 vst_alignment(
vdih, 0, 0, &cw, &ch );
294 vst_point( self->
vdi_handle, pxsize, &cw, &ch, &cellw, &cellh);
301 v_ftext( self->
vdi_handle, x, y, (
char*)lstr );
304 v_gtext( self->
vdi_handle, x, y, (
char*)lstr );
struct s_vdi_sysinfo vdi_sysinfo
void rgb_to_vdi1000(unsigned char *in, RGB1000 *out)
Convert an RGB color to an VDI Color.
bool plot_get_dimensions(GRECT *dst)
Get current canvas size.
#define OFFSET_CUSTOM_COLOR
nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
#define NSLOG(catname, level, logmsg, args...)
NS_ATARI_SYSINFO atari_sysinfo
#define PLOT_STYLE_SCALE
Scaling factor for plot styles.
colour foreground
Colour of text.
plot_font_flags_t flags
Font flags.
plot_style_fixed size
Font size, in pt.
int weight
Font weight: value in range [100,900] as per CSS.
_fpmf_str_width str_width
_fpmf_str_split str_split
_fpmf_pixel_pos pixel_pos
short scr_bpp
bits per pixel
UTF-8 manipulation functions (interface).
static nserror text(const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length)
Text plotting.