diff options
| author | Kim F. Storm | 2004-12-30 18:01:43 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-12-30 18:01:43 +0000 |
| commit | 1225f637fbc401bc87d78338f3565d95f6cdd582 (patch) | |
| tree | 962dadc1f9c6f5bff07db2f1312c97d91759eeef | |
| parent | 922e9c189f753d8b4e263da01aa1659f6a37711c (diff) | |
| download | emacs-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.texi | 36 | ||||
| -rw-r--r-- | src/ChangeLog | 10 |
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 |
| 1534 | that controls the total height of the display line ending in that | 1534 | that controls the total height of the display line ending in that |
| 1535 | newline. If the property value is zero, the displayed height of the | 1535 | newline. |
| 1536 | |||
| 1537 | If the property value is a list @code{(@var{height} @var{total})}, | ||
| 1538 | then @var{height} is used as the actual property value for the | ||
| 1539 | @code{line-height}, and @var{total} specifies the total displayed | ||
| 1540 | height of the line, so the line spacing added below the line equals | ||
| 1541 | the @var{total} height minus the actual line height. In this case, | ||
| 1542 | the other ways to specify the line spacing are ignored. | ||
| 1543 | |||
| 1544 | If the property value is @code{t}, the displayed height of the | ||
| 1536 | line is exactly what its contents demand; no line-spacing is added. | 1545 | line is exactly what its contents demand; no line-spacing is added. |
| 1537 | This case is useful for tiling small images or image slices without | 1546 | This case is useful for tiling small images or image slices without |
| 1538 | adding blank areas between the images. | 1547 | adding 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 |
| 1541 | spec stands for a numeric height value; this heigh spec specifies the | 1550 | spec stands for a numeric height value; this heigh spec specifies the |
| 1542 | actual line height, @var{line-height}. There are several ways to | 1551 | actual line height, @var{line-height}. There are several ways to |
| 1543 | write a height spec; here's how each of them translates into a numeric | 1552 | write 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} |
| 1550 | If the height spec is a float, @var{float}, the numeric height value | 1559 | If the height spec is a float, @var{float}, the numeric height value |
| 1551 | is @var{float} times the frame's default line height. | 1560 | is @var{float} times the frame's default line height. |
| 1552 | @item (@var{ratio} . @var{face}) | 1561 | @item (@var{face} . @var{ratio}) |
| 1553 | If the height spec is a cons of the format shown, the numeric height | 1562 | If the height spec is a cons of the format shown, the numeric height |
| 1554 | is @var{ratio} times the height of face @var{face}. @var{ratio} can | 1563 | is @var{ratio} times the height of face @var{face}. @var{ratio} can |
| 1555 | be any type of number. If @var{face} is @code{t}, it refers to the | 1564 | be any type of number, or @code{nil} which means a ratio of 1. |
| 1556 | current face. | 1565 | If @var{face} is @code{t}, it refers to the current face. |
| 1566 | @item (@code{nil} . @var{ratio}) | ||
| 1567 | If the height spec is a cons of the format shown, the numeric height | ||
| 1568 | is @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 |
| 1561 | is less than @var{line-height}, Emacs adds extra vertical space above | 1573 | is less than @var{line-height}, Emacs adds extra vertical space above |
| 1562 | the line to achieve the total height @var{line-height}. Otherwise, | 1574 | the 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 | |||
| 1595 | numeric height value specifies the line spacing, rather than the line | 1607 | numeric height value specifies the line spacing, rather than the line |
| 1596 | height. | 1608 | height. |
| 1597 | 1609 | ||
| 1598 | There is one exception, however: if the @var{line-spacing} value is | ||
| 1599 | a cons @code{(total . @var{spacing})}, then @var{spacing} itself is | ||
| 1600 | treated as a heigh spec, and specifies the total displayed height of | ||
| 1601 | the line, so the line spacing equals the specified amount minus the | ||
| 1602 | line height. This differs from using the @code{line-height} property | ||
| 1603 | because 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} | ||
| 1607 | goes 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 @@ | |||
| 1 | 2004-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 | |||
| 1 | 2004-12-30 Kenichi Handa <handa@m17n.org> | 11 | 2004-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 |