aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2004-12-30 18:01:43 +0000
committerKim F. Storm2004-12-30 18:01:43 +0000
commit1225f637fbc401bc87d78338f3565d95f6cdd582 (patch)
tree962dadc1f9c6f5bff07db2f1312c97d91759eeef
parent922e9c189f753d8b4e263da01aa1659f6a37711c (diff)
downloademacs-1225f637fbc401bc87d78338f3565d95f6cdd582.tar.gz
emacs-1225f637fbc401bc87d78338f3565d95f6cdd582.zip
(Line Height): Total line-height is now specified
in line-height property of form (HEIGHT TOTAL). Swap (FACE . RATIO) in cons cells. (nil . RATIO) is relative to actual line height. Use line-height `t' instead of `0' to get minimum height.
-rw-r--r--lispref/display.texi36
-rw-r--r--src/ChangeLog10
2 files changed, 28 insertions, 18 deletions
diff --git a/lispref/display.texi b/lispref/display.texi
index 95cce29d0c1..01ba338621b 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -1532,12 +1532,21 @@ or by adding additional vertical space below one or all lines.
1532@kindex line-height @r{(text property)} 1532@kindex line-height @r{(text property)}
1533 A newline can have a @code{line-height} text or overlay property 1533 A newline can have a @code{line-height} text or overlay property
1534that controls the total height of the display line ending in that 1534that controls the total height of the display line ending in that
1535newline. If the property value is zero, the displayed height of the 1535newline.
1536
1537 If the property value is a list @code{(@var{height} @var{total})},
1538then @var{height} is used as the actual property value for the
1539@code{line-height}, and @var{total} specifies the total displayed
1540height of the line, so the line spacing added below the line equals
1541the @var{total} height minus the actual line height. In this case,
1542the other ways to specify the line spacing are ignored.
1543
1544 If the property value is @code{t}, the displayed height of the
1536line is exactly what its contents demand; no line-spacing is added. 1545line is exactly what its contents demand; no line-spacing is added.
1537This case is useful for tiling small images or image slices without 1546This case is useful for tiling small images or image slices without
1538adding blank areas between the images. 1547adding blank areas between the images.
1539 1548
1540 If the property value is not zero, it is a height spec. A height 1549 If the property value is not @code{t}, it is a height spec. A height
1541spec stands for a numeric height value; this heigh spec specifies the 1550spec stands for a numeric height value; this heigh spec specifies the
1542actual line height, @var{line-height}. There are several ways to 1551actual line height, @var{line-height}. There are several ways to
1543write a height spec; here's how each of them translates into a numeric 1552write a height spec; here's how each of them translates into a numeric
@@ -1549,14 +1558,17 @@ If the height spec is a positive integer, the height value is that integer.
1549@item @var{float} 1558@item @var{float}
1550If the height spec is a float, @var{float}, the numeric height value 1559If the height spec is a float, @var{float}, the numeric height value
1551is @var{float} times the frame's default line height. 1560is @var{float} times the frame's default line height.
1552@item (@var{ratio} . @var{face}) 1561@item (@var{face} . @var{ratio})
1553If the height spec is a cons of the format shown, the numeric height 1562If the height spec is a cons of the format shown, the numeric height
1554is @var{ratio} times the height of face @var{face}. @var{ratio} can 1563is @var{ratio} times the height of face @var{face}. @var{ratio} can
1555be any type of number. If @var{face} is @code{t}, it refers to the 1564be any type of number, or @code{nil} which means a ratio of 1.
1556current face. 1565If @var{face} is @code{t}, it refers to the current face.
1566@item (@code{nil} . @var{ratio})
1567If the height spec is a cons of the format shown, the numeric height
1568is @var{ratio} times the height of the contents of the line.
1557@end table 1569@end table
1558 1570
1559 Thus, any valid nonzero property value specifies a height in pixels, 1571 Thus, any valid non-@code{t} property value specifies a height in pixels,
1560@var{line-height}, one way or another. If the line contents' height 1572@var{line-height}, one way or another. If the line contents' height
1561is less than @var{line-height}, Emacs adds extra vertical space above 1573is less than @var{line-height}, Emacs adds extra vertical space above
1562the line to achieve the total height @var{line-height}. Otherwise, 1574the line to achieve the total height @var{line-height}. Otherwise,
@@ -1595,18 +1607,6 @@ into a Lisp value as described above. However, in this case the
1595numeric height value specifies the line spacing, rather than the line 1607numeric height value specifies the line spacing, rather than the line
1596height. 1608height.
1597 1609
1598 There is one exception, however: if the @var{line-spacing} value is
1599a cons @code{(total . @var{spacing})}, then @var{spacing} itself is
1600treated as a heigh spec, and specifies the total displayed height of
1601the line, so the line spacing equals the specified amount minus the
1602line height. This differs from using the @code{line-height} property
1603because it adds space at the bottom of the line instead of the top.
1604
1605 If you specify both @code{line-spacing} using @code{total} and
1606@code{line-height}, they are not redundant. First @code{line-height}
1607goes to work, adding space above the line contents. Then
1608@code{line-spacing} goes to work, adding space below the contents.
1609
1610@node Faces 1610@node Faces
1611@section Faces 1611@section Faces
1612@cindex faces 1612@cindex faces
diff --git a/src/ChangeLog b/src/ChangeLog
index eabe023a24e..7b6264a3295 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12004-12-30 Kim F. Storm <storm@cua.dk>
2
3 * xdisp.c (get_line_height_property): New function extracted from
4 original calc_line_height_property.
5 (calc_line_height_property): Rework. Handle t and (nil . ratio).
6 (x_produce_glyphs): Use them to handle line-height and
7 line-spacing according to new height spec.
8 (Qtotal): Remove.
9 (syms_of_xdisp): Remove defsubr and intern for Qtotal.
10
12004-12-30 Kenichi Handa <handa@m17n.org> 112004-12-30 Kenichi Handa <handa@m17n.org>
2 12
3 * fileio.c (Finsert_file_contents): Don't use 13 * fileio.c (Finsert_file_contents): Don't use