From 83914b9c3e87e3db536ee494ce0032cdb5e5d781 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Fri, 22 Apr 2011 16:06:46 +0000 Subject: Set font DPI from nscss_screen_dpi to ensure it is always in sync Reset font DPI when opening screens to allow us to correct for aspect ratio in the future svn path=/trunk/netsurf/; revision=12229 --- amiga/font.c | 16 +++++++++++++++- amiga/font.h | 8 +------- amiga/gui.c | 1 + 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/amiga/font.c b/amiga/font.c index 78237cdab..d40726440 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -40,6 +40,11 @@ #define NSA_UNICODE_FONT PLOT_FONT_FAMILY_COUNT +#define NSA_NORMAL 0 +#define NSA_ITALIC 1 +#define NSA_BOLD 2 +#define NSA_BOLDITALIC 3 + #define NSA_VALUE_BOLDX (1 << 12) #define NSA_VALUE_BOLDY (1 << 12) #define NSA_VALUE_SHEARSIN (1 << 14) @@ -50,6 +55,8 @@ static struct OutlineFont *ofb[PLOT_FONT_FAMILY_COUNT+1]; static struct OutlineFont *ofi[PLOT_FONT_FAMILY_COUNT+1]; static struct OutlineFont *ofbi[PLOT_FONT_FAMILY_COUNT+1]; +ULONG ami_devicedpi; + int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp, uint16 char1, uint16 char2, uint32 x, uint32 y, uint32 emwidth); struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle, BOOL fallback); @@ -367,7 +374,7 @@ struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle, BOOL ysize = fstyle->size * ((1 << 16) / FONT_SIZE_SCALE); if(ESetInfo(&ofont->olf_EEngine, - OT_DeviceDPI, (72<<16) | 72, + OT_DeviceDPI, ami_devicedpi, OT_PointHeight, ysize, OT_EmboldenX, emboldenx, OT_EmboldenY, emboldeny, @@ -605,3 +612,10 @@ void ami_close_fonts(void) if(ofbi[i]) CloseOutlineFont(ofbi[i],NULL); } } + +ULONG ami_font_setdevicedpi(int dpi) +{ + ami_devicedpi = (dpi<<16) | dpi; + + return ami_devicedpi; +} diff --git a/amiga/font.h b/amiga/font.h index e62be85a4..0881e87a8 100755 --- a/amiga/font.h +++ b/amiga/font.h @@ -22,14 +22,8 @@ #include "desktop/plotters.h" #include -#define NSA_NORMAL 0 -#define NSA_ITALIC 1 -#define NSA_BOLD 2 -#define NSA_BOLDITALIC 3 - -void ami_close_font(struct TextFont *tfont); ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const plot_font_style_t *fstyle,ULONG x,ULONG y); - +ULONG ami_font_setdevicedpi(int dpi); void ami_init_fonts(void); void ami_close_fonts(void); #endif diff --git a/amiga/gui.c b/amiga/gui.c index 5728ee76c..bf83a49e8 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -565,6 +565,7 @@ void ami_openscreen(void) } } dri = GetScreenDrawInfo(scrn); + ami_font_setdevicedpi(FIXTOINT(nscss_screen_dpi)); gui_system_colour_finalize(); gui_system_colour_init(); -- cgit v1.2.3