diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/pixel-specification.html | |
new repository
Diffstat (limited to 'devdocs/elisp/pixel-specification.html')
| -rw-r--r-- | devdocs/elisp/pixel-specification.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/devdocs/elisp/pixel-specification.html b/devdocs/elisp/pixel-specification.html new file mode 100644 index 00000000..6227cbb6 --- /dev/null +++ b/devdocs/elisp/pixel-specification.html @@ -0,0 +1,19 @@ + <h4 class="subsection">Pixel Specification for Spaces</h4> <p>The value of the <code>:width</code>, <code>:align-to</code>, <code>:height</code>, and <code>:ascent</code> properties can be a special kind of expression that is evaluated during redisplay. The result of the evaluation is used as an absolute number of pixels. </p> <p>The following expressions are supported: </p> <div class="example"> <pre class="example"> <var>expr</var> ::= <var>num</var> | (<var>num</var>) | <var>unit</var> | <var>elem</var> | <var>pos</var> | <var>image</var> | <var>xwidget</var> | <var>form</var> + <var>num</var> ::= <var>integer</var> | <var>float</var> | <var>symbol</var> + <var>unit</var> ::= in | mm | cm | width | height +</pre> +<pre class="example"> <var>elem</var> ::= left-fringe | right-fringe | left-margin | right-margin + | scroll-bar | text + <var>pos</var> ::= left | center | right + <var>form</var> ::= (<var>num</var> . <var>expr</var>) | (<var>op</var> <var>expr</var> ...) + <var>op</var> ::= + | - +</pre> +</div> <p>The form <var>num</var> specifies a fraction of the default frame font height or width. The form <code>(<var>num</var>)</code> specifies an absolute number of pixels. If <var>num</var> is a symbol, <var>symbol</var>, its buffer-local variable binding is used; that binding can be either a number or a cons cell of the forms shown above (including yet another cons cell whose <code>car</code> is a symbol that has a buffer-local binding). </p> <p>The <code>in</code>, <code>mm</code>, and <code>cm</code> units specify the number of pixels per inch, millimeter, and centimeter, respectively. The <code>width</code> and <code>height</code> units correspond to the default width and height of the current face. An image specification of the form <code>(image . <var>props</var>)</code> (see <a href="image-descriptors">Image Descriptors</a>) corresponds to the width or height of the specified image. Similarly, an xwidget specification of the form <code>(xwidget . <var>props</var>)</code> stands for the width or height of the specified xwidget. See <a href="xwidgets">Xwidgets</a>. </p> <p>The elements <code>left-fringe</code>, <code>right-fringe</code>, <code>left-margin</code>, <code>right-margin</code>, <code>scroll-bar</code>, and <code>text</code> specify the width of the corresponding area of the window. When the window displays line numbers (see <a href="size-of-displayed-text">Size of Displayed Text</a>), the width of the <code>text</code> area is decreased by the screen space taken by the line-number display. </p> <p>The <code>left</code>, <code>center</code>, and <code>right</code> positions can be used with <code>:align-to</code> to specify a position relative to the left edge, center, or right edge of the text area. When the window displays line numbers, the <code>left</code> and the <code>center</code> positions are offset to account for the screen space taken by the line-number display. </p> <p>Any of the above window elements (except <code>text</code>) can also be used with <code>:align-to</code> to specify that the position is relative to the left edge of the given area. Once the base offset for a relative position has been set (by the first occurrence of one of these symbols), further occurrences of these symbols are interpreted as the width of the specified area. For example, to align to the center of the left-margin, use </p> <div class="example"> <pre class="example">:align-to (+ left-margin (0.5 . left-margin)) +</pre> +</div> <p>If no specific base offset is set for alignment, it is always relative to the left edge of the text area. For example, ‘<samp>:align-to 0</samp>’ in a header-line aligns with the first text column in the text area. When the window displays line numbers, the text is considered to start where the space used for line-number display ends. </p> <p>A value of the form <code>(<var>num</var> . <var>expr</var>)</code> stands for the product of the values of <var>num</var> and <var>expr</var>. For example, <code>(2 . in)</code> specifies a width of 2 inches, while <code>(0.5 . +<var>image</var>)</code> specifies half the width (or height) of the specified <var>image</var> (which should be given by its image spec). </p> <p>The form <code>(+ <var>expr</var> ...)</code> adds up the value of the expressions. The form <code>(- <var>expr</var> ...)</code> negates or subtracts the value of the expressions. </p><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Pixel-Specification.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Pixel-Specification.html</a> + </p> +</div> |
