Be more flexible with the aspect ratios we correct to.

svn path=/trunk/netsurf/; revision=13036
This commit is contained in:
Chris Young 2011-10-11 17:58:14 +00:00
parent 606d7cc64e
commit 69f83ed262
3 changed files with 14 additions and 9 deletions

View File

@ -69,7 +69,9 @@ For most users, installing and selecting @{"Code2000" rxs "address netsurf 'open
@{b}Font sizes@{ub}
The default and minimum font sizes can also be set. NB: The resolution setting on the "Rendering" tab in NetSurf's preferences affects how big text appears on screen (the conversion between point and pixel sizes) amongst other things. To find the correct value, divide the number of pixels on the screen vertically by the physical height of the screen in inches (horizontal resolution is calculated automatically if NetSurf is running on a custom screen, square pixels are assumed on all other screens).
The default and minimum font sizes can also be set.
NB: The resolution setting on the "Rendering" tab in NetSurf's preferences affects how big text appears on screen (the conversion between point and pixel sizes) amongst other things. To find the correct value, divide the number of pixels on the screen vertically by the physical height of the screen in inches (horizontal resolution is calculated automatically if NetSurf is running on a custom screen, square pixels are assumed on all other screens).
If the monitor is widescreen, monitor_aspect_x and monitor_aspect_y values in Resources/Options will also need modifying.
@endnode
@node Themes

View File

@ -662,7 +662,7 @@ void ami_font_setdevicedpi(int id)
nscss_screen_dpi = INTTOFIX(option_amiga_ydpi);
if(id)
if(id && (option_monitor_aspect_x != 0) && (option_monitor_aspect_y != 0))
{
if(dih = FindDisplayInfo(id))
{
@ -672,12 +672,12 @@ void ami_font_setdevicedpi(int id)
int xres = dinfo.Resolution.x;
int yres = dinfo.Resolution.y;
if(option_widescreen)
if((option_monitor_aspect_x != 4) || (option_monitor_aspect_y != 3))
{
/* AmigaOS sees 4:3 modes as square in the DisplayInfo database,
* so we correct 16:10 modes to square for widescreen displays. */
xres = (xres * 16) / 4;
yres = (yres * 10) / 3;
* so we correct other modes to "4:3 equiv" here. */
xres = (xres * option_monitor_aspect_x) / 4;
yres = (yres * option_monitor_aspect_y) / 3;
}
xdpi = (yres * ydpi) / xres;

View File

@ -64,7 +64,8 @@ extern int option_cookies_window_ysize;
extern int option_cairo_renderer;
extern bool option_direct_render;
extern int option_amiga_ydpi;
extern bool option_widescreen;
extern int option_monitor_aspect_x;
extern int option_monitor_aspect_y;
extern bool option_accept_lang_locale;
#define EXTRA_OPTION_DEFINE \
@ -112,7 +113,8 @@ int option_cookies_window_ysize = 0; \
int option_cairo_renderer = 1; \
bool option_direct_render = false; \
int option_amiga_ydpi = 72; \
bool option_widescreen = false; \
int option_monitor_aspect_x = 4; \
int option_monitor_aspect_y = 3; \
bool option_accept_lang_locale = true; \
#define EXTRA_OPTION_TABLE \
@ -160,6 +162,7 @@ bool option_accept_lang_locale = true; \
{ "cairo_renderer", OPTION_INTEGER, &option_cairo_renderer}, \
{ "direct_render", OPTION_BOOL, &option_direct_render}, \
{ "amiga_ydpi", OPTION_INTEGER, &option_amiga_ydpi}, \
{ "widescreen", OPTION_BOOL, &option_widescreen}, \
{ "monitor_aspect_x", OPTION_INTEGER, &option_monitor_aspect_x}, \
{ "monitor_aspect_y", OPTION_INTEGER, &option_monitor_aspect_y}, \
{ "accept_lang_locale", OPTION_BOOL, &option_accept_lang_locale},
#endif