aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-06-10 20:01:54 +0000
committerStefan Monnier2008-06-10 20:01:54 +0000
commitd5dc61631e773495e96ed2bbd3bca16c981e9f7e (patch)
treefce5346c283db3d7c3204d0be9a31e417c3889fa
parent8c102d5bfee908d9f09506377bed7ab61ef0cda0 (diff)
downloademacs-d5dc61631e773495e96ed2bbd3bca16c981e9f7e.tar.gz
emacs-d5dc61631e773495e96ed2bbd3bca16c981e9f7e.zip
* xterm.c (x_underline_minimum_display_offset): New var.
(x_draw_glyph_string): Use it. (syms_of_xterm): Declare it. * cus-start.el (x-underline-minimum-display-offset): Give it a type.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/cus-start.el1
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xterm.c22
4 files changed, 32 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 238245be904..2472e3f6112 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change)
2
3 * cus-start.el (x-underline-minimum-display-offset): Give it a type.
4
12008-06-10 Chong Yidong <cyd@stupidchicken.com> 52008-06-10 Chong Yidong <cyd@stupidchicken.com>
2 6
3 * mouse.el (mouse-select-font): New function. 7 * mouse.el (mouse-select-font): New function.
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 582a3f98c6e..73150ce8f7c 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -348,6 +348,7 @@ since it could result in memory overflow and make Emacs crash."
348 ;; xterm.c 348 ;; xterm.c
349 (x-use-underline-position-properties display boolean "22.1") 349 (x-use-underline-position-properties display boolean "22.1")
350 (x-underline-at-descent-line display boolean "22.1") 350 (x-underline-at-descent-line display boolean "22.1")
351 (x-underline-minimum-display-offset display integer "23.1")
351 (x-stretch-cursor display boolean "21.1"))) 352 (x-stretch-cursor display boolean "21.1")))
352 this symbol group type standard version native-p 353 this symbol group type standard version native-p
353 ;; This function turns a value 354 ;; This function turns a value
diff --git a/src/ChangeLog b/src/ChangeLog
index cfe3885b1f1..2716320139b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change)
2
3 * xterm.c (x_underline_minimum_display_offset): New var.
4 (x_draw_glyph_string): Use it.
5 (syms_of_xterm): Declare it.
6
12008-06-10 Chong Yidong <cyd@stupidchicken.com> 72008-06-10 Chong Yidong <cyd@stupidchicken.com>
2 8
3 * font.c (font_parse_fcname): Accept GTK-style font names too. 9 * font.c (font_parse_fcname): Accept GTK-style font names too.
diff --git a/src/xterm.c b/src/xterm.c
index fa7ffe5139e..13c2d2e4a97 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -183,6 +183,12 @@ int x_use_underline_position_properties;
183 183
184int x_underline_at_descent_line; 184int x_underline_at_descent_line;
185 185
186/* Require underline to be at least this many screen pixels below baseline
187 This to avoid underline "merging" with the base of letters at small
188 font sizes, particularly when x_use_underline_position_properties is on. */
189
190int x_underline_minimum_display_offset;
191
186/* This is a chain of structures for all the X displays currently in 192/* This is a chain of structures for all the X displays currently in
187 use. */ 193 use. */
188 194
@@ -2744,6 +2750,8 @@ x_draw_glyph_string (s)
2744 else if (s->font) 2750 else if (s->font)
2745 position = (s->font->descent + 1) / 2; 2751 position = (s->font->descent + 1) / 2;
2746 } 2752 }
2753 if (x_underline_minimum_display_offset)
2754 position = max (position, eabs (x_underline_minimum_display_offset));
2747 } 2755 }
2748 /* Check the sanity of thickness and position. We should 2756 /* Check the sanity of thickness and position. We should
2749 avoid drawing underline out of the current line area. */ 2757 avoid drawing underline out of the current line area. */
@@ -10781,7 +10789,9 @@ syms_of_xterm ()
10781 doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties. 10789 doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
10782A value of nil means ignore them. If you encounter fonts with bogus 10790A value of nil means ignore them. If you encounter fonts with bogus
10783UNDERLINE_POSITION font properties, for example 7x13 on XFree prior 10791UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
10784to 4.1, set this to nil. */); 10792to 4.1, set this to nil. Variable `x-underline-minimum-display-offset' may
10793be used to override the font's UNDERLINE_POSITION for small font display
10794sizes. */);
10785 x_use_underline_position_properties = 1; 10795 x_use_underline_position_properties = 1;
10786 10796
10787 DEFVAR_BOOL ("x-underline-at-descent-line", 10797 DEFVAR_BOOL ("x-underline-at-descent-line",
@@ -10792,6 +10802,16 @@ variable `x-use-underline-position-properties', which is usually at the
10792baseline level. The default value is nil. */); 10802baseline level. The default value is nil. */);
10793 x_underline_at_descent_line = 0; 10803 x_underline_at_descent_line = 0;
10794 10804
10805 DEFVAR_INT ("x-underline-minimum-display-offset",
10806 &x_underline_minimum_display_offset,
10807 doc: /* *When > 0, underline is drawn at least that many screen pixels below baseline.
10808This can improve legibility of underlined text at small font sizes,
10809particularly when using variable `x-use-underline-position-properties'
10810with fonts that specify an UNDERLINE_POSITION relatively close to the
10811baseline. The default value is 0. */);
10812 x_underline_minimum_display_offset = 0;
10813
10814
10795 DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", 10815 DEFVAR_BOOL ("x-mouse-click-focus-ignore-position",
10796 &x_mouse_click_focus_ignore_position, 10816 &x_mouse_click_focus_ignore_position,
10797 doc: /* Non-nil means that a mouse click to focus a frame does not move point. 10817 doc: /* Non-nil means that a mouse click to focus a frame does not move point.