[geary/wip/713746-document-font] Use font points rather than pixels when setting font size



commit 88cbccfdc75e76e7310383ad5869c8402e3af052
Author: Robert Schroll <rschroll gmail com>
Date:   Wed Jan 22 18:20:08 2014 -0800

    Use font points rather than pixels when setting font size
    
    point -> pixel size transformation was occurring in two places, Geary
    and WebKit, causing the wrong font size (too large) being used.

 .../conversation-viewer/conversation-web-view.vala |    8 ++++----
 theming/message-viewer.css                         |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-web-view.vala 
b/src/client/conversation-viewer/conversation-web-view.vala
index d5331e0..b77cb77 100644
--- a/src/client/conversation-viewer/conversation-web-view.vala
+++ b/src/client/conversation-viewer/conversation-web-view.vala
@@ -175,15 +175,15 @@ public class ConversationWebView : WebKit.WebView {
         set {
             Pango.FontDescription font_desc = Pango.FontDescription.from_string(value);
             double dpi = get_screen_dpi();
-            double size_in_pixels;
+            double size_in_pts;
             if (font_desc.get_size_is_absolute()) {
-                size_in_pixels = font_desc.get_size() / (double) Pango.SCALE;
+                size_in_pts = font_desc.get_size() * POINTS_PER_INCH / dpi / Pango.SCALE;
             } else {
-                size_in_pixels = font_desc.get_size() * (dpi / POINTS_PER_INCH) / Pango.SCALE;
+                size_in_pts = font_desc.get_size() / (double) Pango.SCALE;
             }
             WebKit.WebSettings config = settings;
             config.default_font_family = font_desc.get_family();
-            config.default_font_size = (int) size_in_pixels;
+            config.default_font_size = (int) size_in_pts;
             settings = config;
             _desktop_document_font = value;
         }
diff --git a/theming/message-viewer.css b/theming/message-viewer.css
index 223af81..b813de7 100644
--- a/theming/message-viewer.css
+++ b/theming/message-viewer.css
@@ -92,7 +92,7 @@ hr {
     border: 1px rgba(0,0,0,1) solid;
     background-color: white;/* recv-normal */
     color: black;
-    font-size: small;
+    font-size: medium;
     box-shadow: 0 3px 11px rgba(0,0,0,1);
     display: block;
     word-wrap: break-word;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]