From 277a4f13736cd3eac53d1301dddc2e0eecba9dba Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 14 Oct 2006 00:53:28 +0000 Subject: [PATCH] Stopped setting assumed screen resolution in Mozilla/XULRunner 1.8 since the browser uses it wrongly. Documented this problem. --- README | 28 ++++++++++++++++++++++++++++ videolink.cpp | 17 +++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/README b/README index df6b8f7..c273e43 100644 --- a/README +++ b/README @@ -176,6 +176,34 @@ aspect ratio and sample rate. However, each chapter will run into the next. If this is a real problem, let me know, and I may be able to provide a better solution in a later version of VideoLink. +Bugs +---- + +Under Mozilla 1.7, VideoLink sets the assumed screen resolution to +40 dpi, which I reckon to be the average resolution of a standard +definition TV display. This should mean that text with a font size +expressed in millimetres or points will appear around the specified +size. Unfortunately this setting has a different effect under +Mozilla/XULRunner 1.8: + +Mozilla Assumed Requested Actual size +version resolution size (pixels) (inches) + (dpi) + + 1.7 default:96 20 px 20 0.5 + 1.7 default:96 36 pt 48 1.2 + 1.7 40 20 px 20 0.5 + 1.7 40 36 pt 20 0.5 + 1.8 default:96 20 px 20 0.5 + 1.8 default:96 36 pt 48 1.2 + 1.8 40 20 px 48 1.2 + 1.8 40 36 pt 48 1.2 + +From version 0.10, until I have a proper solution, VideoLink will not +set the assumed screen resolution under Mozilla 1.8. I must advise +against using font sizes in millimetres or points since they will vary +between browser versions. + Author and copyright -------------------- diff --git a/videolink.cpp b/videolink.cpp index 8ab5266..bda78ce 100644 --- a/videolink.cpp +++ b/videolink.cpp @@ -885,8 +885,21 @@ namespace // slightly different but unfortunately Mozilla doesn't // support non-square pixels (and neither do fontconfig or Xft // anyway). - check(pref_branch->SetIntPref("browser.display.screen_resolution", - 40)); + + // The browser.display.screen_resolution preference sets the + // the nominal resolution for dimensions expressed in pixels. + // (They may be scaled!) In Mozilla 1.7 it also sets the + // assumed resolution of the display - hence pixel sizes are + // respected on-screen - but this is no longer the case in + // 1.8. Therefore it was renamed to layout.css.dpi in 1.8.1. + // In 1.8 we need to set the assumed screen resolution + // separately, but don't know how yet. Setting one to 40 + // but not the other is *bad*, so currently we set neither. + +# if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR < 8 + check(pref_branch->SetIntPref("browser.display.screen_resolution", + 40)); +# endif } } // namespace -- 2.39.2