aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2008-06-10 20:22:10 +0000
committerStefan Monnier2008-06-10 20:22:10 +0000
commit2a3bd2e19336d9a83349575859cfb4842c2ec861 (patch)
tree99185c9d37c39d003f8b6395e03aa9c866be64f3 /src
parentd5dc61631e773495e96ed2bbd3bca16c981e9f7e (diff)
downloademacs-2a3bd2e19336d9a83349575859cfb4842c2ec861.tar.gz
emacs-2a3bd2e19336d9a83349575859cfb4842c2ec861.zip
* xdisp.c (underline_minimum_offset): Rename from xterm.c's
x_underline_minimum_display_offset. (syms_of_xdisp): Declare it here rather than in xterm.c. * dispextern.h (underline_minimum_offset): Declare it. * w32term.c (x_draw_glyph_string): Use it. * xterm.c (x_underline_minimum_display_offset): Move to xdisp.c. (syms_of_xterm): Don't declare it any more. (x_draw_glyph_string): Adjust to the new name. * cus-start.el (underline-minimum-offset) Rename from x-underline-minimum-display-offset.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/dispextern.h1
-rw-r--r--src/macterm.c2
-rw-r--r--src/w32term.c1
-rw-r--r--src/xdisp.c15
-rw-r--r--src/xterm.c23
6 files changed, 32 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2716320139b..942db16bea3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12008-06-10 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * xdisp.c (underline_minimum_offset): Rename from xterm.c's
4 x_underline_minimum_display_offset.
5 (syms_of_xdisp): Declare it here rather than in xterm.c.
6 * dispextern.h (underline_minimum_offset): Declare it.
7 * w32term.c (x_draw_glyph_string): Use it.
8 * xterm.c (x_underline_minimum_display_offset): Move to xdisp.c.
9 (syms_of_xterm): Don't declare it any more.
10 (x_draw_glyph_string): Adjust to the new name.
11
12008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change) 122008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change)
2 13
3 * xterm.c (x_underline_minimum_display_offset): New var. 14 * xterm.c (x_underline_minimum_display_offset): New var.
diff --git a/src/dispextern.h b/src/dispextern.h
index 969f1c55021..883fa431724 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2705,6 +2705,7 @@ extern struct frame *last_mouse_frame;
2705extern int last_tool_bar_item; 2705extern int last_tool_bar_item;
2706extern Lisp_Object Vmouse_autoselect_window; 2706extern Lisp_Object Vmouse_autoselect_window;
2707extern int unibyte_display_via_language_environment; 2707extern int unibyte_display_via_language_environment;
2708extern EMACS_INT underline_minimum_offset;
2708 2709
2709extern void reseat_at_previous_visible_line_start P_ ((struct it *)); 2710extern void reseat_at_previous_visible_line_start P_ ((struct it *));
2710 2711
diff --git a/src/macterm.c b/src/macterm.c
index 2871bfa1179..b20857317d9 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -4083,7 +4083,7 @@ x_draw_glyph_string (s)
4083 if (s->face->font) 4083 if (s->face->font)
4084 y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; 4084 y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
4085 } 4085 }
4086 4086 /* FIXME: Obey underline_minimum_offset. */
4087 if (s->face->underline_defaulted_p) 4087 if (s->face->underline_defaulted_p)
4088 mac_fill_rectangle (s->f, s->gc, s->x, y, 4088 mac_fill_rectangle (s->f, s->gc, s->x, y,
4089 s->background_width, h); 4089 s->background_width, h);
diff --git a/src/w32term.c b/src/w32term.c
index 63d8a1518fe..7880b8abc10 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -2910,6 +2910,7 @@ x_draw_glyph_string (s)
2910 else if (s->font) 2910 else if (s->font)
2911 position = (s->font->descent + 1) / 2; 2911 position = (s->font->descent + 1) / 2;
2912 } 2912 }
2913 position = max (position, underline_minimum_offset);
2913 } 2914 }
2914 /* Check the sanity of thickness and position. We should 2915 /* Check the sanity of thickness and position. We should
2915 avoid drawing underline out of the current line area. */ 2916 avoid drawing underline out of the current line area. */
diff --git a/src/xdisp.c b/src/xdisp.c
index b248cba8e9d..99d55f3b143 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -715,6 +715,12 @@ struct buffer *displayed_buffer;
715 715
716EMACS_INT overline_margin; 716EMACS_INT overline_margin;
717 717
718/* Require underline to be at least this many screen pixels below baseline
719 This to avoid underline "merging" with the base of letters at small
720 font sizes, particularly when x_use_underline_position_properties is on. */
721
722EMACS_INT underline_minimum_offset;
723
718/* Value returned from text property handlers (see below). */ 724/* Value returned from text property handlers (see below). */
719 725
720enum prop_handled 726enum prop_handled
@@ -24801,6 +24807,15 @@ The enable predicate for a menu binding should check this variable. */);
24801The default value is 2: the height of the overline (1 pixel) plus 1 pixel 24807The default value is 2: the height of the overline (1 pixel) plus 1 pixel
24802margin to the caracter height. */); 24808margin to the caracter height. */);
24803 overline_margin = 2; 24809 overline_margin = 2;
24810
24811 DEFVAR_INT ("underline-minimum-offset",
24812 &underline_minimum_offset,
24813 doc: /* Minimum distance between baseline and underline.
24814This can improve legibility of underlined text at small font sizes,
24815particularly when using variable `x-use-underline-position-properties'
24816with fonts that specify an UNDERLINE_POSITION relatively close to the
24817baseline. The default value is 0. */);
24818 underline_minimum_offset = 0;
24804} 24819}
24805 24820
24806 24821
diff --git a/src/xterm.c b/src/xterm.c
index 13c2d2e4a97..d2222b4a9b9 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -183,12 +183,6 @@ 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
192/* This is a chain of structures for all the X displays currently in 186/* This is a chain of structures for all the X displays currently in
193 use. */ 187 use. */
194 188
@@ -2750,8 +2744,7 @@ x_draw_glyph_string (s)
2750 else if (s->font) 2744 else if (s->font)
2751 position = (s->font->descent + 1) / 2; 2745 position = (s->font->descent + 1) / 2;
2752 } 2746 }
2753 if (x_underline_minimum_display_offset) 2747 position = max (position, underline_minimum_offset);
2754 position = max (position, eabs (x_underline_minimum_display_offset));
2755 } 2748 }
2756 /* Check the sanity of thickness and position. We should 2749 /* Check the sanity of thickness and position. We should
2757 avoid drawing underline out of the current line area. */ 2750 avoid drawing underline out of the current line area. */
@@ -10789,8 +10782,8 @@ syms_of_xterm ()
10789 doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties. 10782 doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
10790A value of nil means ignore them. If you encounter fonts with bogus 10783A value of nil means ignore them. If you encounter fonts with bogus
10791UNDERLINE_POSITION font properties, for example 7x13 on XFree prior 10784UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
10792to 4.1, set this to nil. Variable `x-underline-minimum-display-offset' may 10785to 4.1, set this to nil. You can also use `underline-minimum-offset'
10793be used to override the font's UNDERLINE_POSITION for small font display 10786to override the font's UNDERLINE_POSITION for small font display
10794sizes. */); 10787sizes. */);
10795 x_use_underline_position_properties = 1; 10788 x_use_underline_position_properties = 1;
10796 10789
@@ -10802,16 +10795,6 @@ variable `x-use-underline-position-properties', which is usually at the
10802baseline level. The default value is nil. */); 10795baseline level. The default value is nil. */);
10803 x_underline_at_descent_line = 0; 10796 x_underline_at_descent_line = 0;
10804 10797
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
10815 DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", 10798 DEFVAR_BOOL ("x-mouse-click-focus-ignore-position",
10816 &x_mouse_click_focus_ignore_position, 10799 &x_mouse_click_focus_ignore_position,
10817 doc: /* Non-nil means that a mouse click to focus a frame does not move point. 10800 doc: /* Non-nil means that a mouse click to focus a frame does not move point.