changeset 955:b84781690627

add font_max_size dillorc option
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Tue, 17 Feb 2009 10:22:06 +0100
parents 270e94174519
children dd46fa6ceb94
files ChangeLog dillorc src/prefs.c src/prefs.h src/styleengine.cc
diffstat 5 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Feb 16 09:18:31 2009 +0100
+++ b/ChangeLog	Tue Feb 17 10:22:06 2009 +0100
@@ -59,7 +59,7 @@
  - Improved CSS selector matching performance using hash tables.
  - Support selector specificity.
  - Add support for font-size and font-weight enum values.
- - Added "font_min_size" dillorc option.
+ - Added "font_max_size", "font_min_size" dillorc options.
    Patches: Johannes Hofmann
 +- Implemented a close-tab button for the GUI.
    Patch: João Ricardo Lourenço, Jorge Arellano Cid
--- a/dillorc	Mon Feb 16 09:18:31 2009 +0100
+++ b/dillorc	Tue Feb 17 10:22:06 2009 +0100
@@ -53,6 +53,9 @@
 # font_factor=1.5
 #font_factor=1.0
 
+# Maximum font size in pixels
+#font_max_size=100
+
 # Minimum font size in pixels
 #font_min_size=6
 
--- a/src/prefs.c	Mon Feb 16 09:18:31 2009 +0100
+++ b/src/prefs.c	Tue Feb 17 10:22:06 2009 +0100
@@ -163,6 +163,7 @@
    { "font_cursive", &prefs.font_cursive, PREFS_STRING },
    { "font_factor", &prefs.font_factor, PREFS_DOUBLE },
    { "font_fantasy", &prefs.font_fantasy, PREFS_STRING },
+   { "font_max_size", &prefs.font_max_size, PREFS_INT32 },
    { "font_min_size", &prefs.font_min_size, PREFS_INT32 },
    { "font_monospace", &prefs.font_monospace, PREFS_STRING },
    { "font_sans_serif", &prefs.font_sans_serif, PREFS_STRING },
@@ -268,6 +269,7 @@
    prefs.focus_new_tab = TRUE;
    prefs.font_cursive = dStrdup(D_FONT_CURSIVE);
    prefs.font_factor = 1.0;
+   prefs.font_max_size = 100;
    prefs.font_min_size = 6;
    prefs.font_fantasy = dStrdup(D_FONT_FANTASY);
    prefs.font_monospace = dStrdup(D_FONT_MONOSPACE);
--- a/src/prefs.h	Mon Feb 16 09:18:31 2009 +0100
+++ b/src/prefs.h	Tue Feb 17 10:22:06 2009 +0100
@@ -44,6 +44,7 @@
    bool_t w3c_plus_heuristics;
    bool_t focus_new_tab;
    double font_factor;
+   int32_t font_max_size;
    int32_t font_min_size;
    bool_t show_back;
    bool_t show_forw;
--- a/src/styleengine.cc	Mon Feb 16 09:18:31 2009 +0100
+++ b/src/styleengine.cc	Tue Feb 17 10:22:06 2009 +0100
@@ -34,6 +34,8 @@
    font_attrs.size = (int) (14 * prefs.font_factor + 0.5);
    if (font_attrs.size < prefs.font_min_size)
       font_attrs.size = prefs.font_min_size;
+   if (font_attrs.size > prefs.font_max_size)
+      font_attrs.size = prefs.font_max_size;
    font_attrs.weight = 400;
    font_attrs.style = FONT_STYLE_NORMAL;
 
@@ -231,6 +233,8 @@
 
             if (fontAttrs.size < prefs.font_min_size)
                fontAttrs.size = prefs.font_min_size;
+            if (fontAttrs.size > prefs.font_max_size)
+               fontAttrs.size = prefs.font_max_size;
 
             break;
          case CSS_PROPERTY_FONT_STYLE: