From a58d97a41a6192038573da6862571dc72a560458 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 23 May 2018 11:48:35 +0100 Subject: Plotters: Add plot_style_fixed type, and use for font size. --- frontends/atari/plot/font_freetype.c | 2 +- frontends/atari/plot/font_vdi.c | 14 +++++++------- frontends/atari/toolbar.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'frontends/atari') diff --git a/frontends/atari/plot/font_freetype.c b/frontends/atari/plot/font_freetype.c index 1688e978b..f8109f6f2 100644 --- a/frontends/atari/plot/font_freetype.c +++ b/frontends/atari/plot/font_freetype.c @@ -250,7 +250,7 @@ static void ft_fill_scalar(const plot_font_style_t *fstyle, FTC_Scaler srec) srec->face_id = (FTC_FaceID)font_faces[selected_face]; - srec->width = srec->height = (fstyle->size * 64) / FONT_SIZE_SCALE; + srec->width = srec->height = (fstyle->size * 64) / PLOT_STYLE_SCALE; srec->pixel = 0; /* calculate x/y resolution, when browser_get_dpi() isn't available */ diff --git a/frontends/atari/plot/font_vdi.c b/frontends/atari/plot/font_vdi.c index 7cd82ddc9..556c08e82 100644 --- a/frontends/atari/plot/font_vdi.c +++ b/frontends/atari/plot/font_vdi.c @@ -106,9 +106,9 @@ static int str_width( FONT_PLOTTER self,const plot_font_style_t *fstyle, const c fx |= 1; vst_effects( self->vdi_handle, fx ); /* TODO: replace 90 with global dpi setting */ - //pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 ); + //pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 ); //vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh); - pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 ); + pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 ); vst_point( self->vdi_handle, pxsize, &cw, &ch, &cellw, &cellh); /* if(slen != utf8_bounded_length(str, length)){ @@ -148,10 +148,10 @@ static int str_split( FONT_PLOTTER self, const plot_font_style_t * fstyle, const if( fstyle->weight > 450 ) fx |= 1; vst_effects( self->vdi_handle, fx ); - //pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 ); + //pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 ); //vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh); - pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 ); + pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 ); vst_point( self->vdi_handle, pxsize, &cw, &ch, &cellw, &cellh); *actual_x = 0; //*char_offset = 0; @@ -216,7 +216,7 @@ static int pixel_pos( FONT_PLOTTER self, const plot_font_style_t * fstyle,const if( fstyle->weight > 450 ) fx |= 1; vst_effects(self->vdi_handle, fx); - pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 ); + pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 ); vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh); *actual_x = 0; *char_offset = 0; @@ -283,8 +283,8 @@ static int text( FONT_PLOTTER self, int x, int y, const char *text, size_t leng /* TODO: netsurf uses 90 as default dpi ( somewhere defined in libcss), use that value or pass it as arg, to reduce netsurf dependency */ - //pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 ); - pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 ); + //pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 ); + pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 ); plot_get_dimensions(&canvas); x += canvas.g_x; diff --git a/frontends/atari/toolbar.c b/frontends/atari/toolbar.c index fdfedcbee..b8f42267f 100644 --- a/frontends/atari/toolbar.c +++ b/frontends/atari/toolbar.c @@ -94,7 +94,7 @@ static float toolbar_url_scale = 1.0; static plot_font_style_t font_style_url = { .family = PLOT_FONT_FAMILY_SANS_SERIF, - .size = 14*FONT_SIZE_SCALE, + .size = 14*PLOT_STYLE_SCALE, .weight = 400, .flags = FONTF_NONE, .background = 0xffffff, @@ -302,7 +302,7 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner) /* create the url widget: */ font_style_url.size = - toolbar_styles[t->style].font_height_pt * FONT_SIZE_SCALE; + toolbar_styles[t->style].font_height_pt * PLOT_STYLE_SCALE; textarea_flags ta_flags = TEXTAREA_INTERNAL_CARET; textarea_setup ta_setup; -- cgit v1.2.3