mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 06:36:24 +00:00
Text sizing protocol: Fix alignment/cropping issues when rendering text with a fractional scale
Also add some clarifications to the docs for exactly how alignment operates with fractional scaling. Fixes #9471 Fixes #9537
This commit is contained in:
parent
2eb79c0a3a
commit
c03e280128
3 changed files with 51 additions and 20 deletions
|
|
@ -243,6 +243,9 @@ Detailed list of changes
|
|||
- Wayland: Add support for :code:`titlebar-only` in :opt:`hide_window_decorations`
|
||||
to hide the titlebar while keeping shadows for window resizing. (:pull:`9486`)
|
||||
|
||||
- Text sizing protocol: Fix alignment/cropping issues when rendering text with
|
||||
a fractional scale (:iss:`9471`)
|
||||
|
||||
|
||||
0.45.0 [2025-12-24]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -77,9 +77,9 @@ There are only a handful of metadata keys, defined in the table below:
|
|||
|
||||
"d", "Integer from 0 to 15", "0", "The denominator for the fractional scale. Must be ``> n`` when non-zero."
|
||||
|
||||
"v", "Integer from 0 to 2", "0", "The vertical alignment to use for fractionally scaled text. ``0`` - top, ``1`` - bottom, ``2`` - centered"
|
||||
"v", "Integer from 0 to 2", "0", "The vertical alignment to use for fractionally scaled text (n < d). ``0`` - top, ``1`` - bottom, ``2`` - centered"
|
||||
|
||||
"h", "Integer from 0 to 2", "0", "The horizontal alignment to use for fractionally scaled text. ``0`` - left, ``1`` - right, ``2`` - centered"
|
||||
"h", "Integer from 0 to 2", "0", "The horizontal alignment to use for fractionally scaled text (n < d). ``0`` - left, ``1`` - right, ``2`` - centered"
|
||||
|
||||
|
||||
How it works
|
||||
|
|
@ -160,8 +160,11 @@ The fractional scale **does not** affect the number of cells the text occupies,
|
|||
instead, it just adjusts the rendered font size within those cells.
|
||||
The fraction is specified using an integer numerator and denominator (``n`` and
|
||||
``d``). In addition, by using the ``v`` key one can vertically align the
|
||||
fractionally scaled text at top, bottom or middle. Similarly, the ``h`` key
|
||||
does horizontal alignment — left, right or centered.
|
||||
fractionally scaled render area at top, bottom or middle. Similarly, the ``h`` key
|
||||
does horizontal alignment — left, right or centered. Note that alignment
|
||||
here is not actual text alignment, it refers to how the fractionally scaled
|
||||
render area fits inside the full render area of size ``s * w`` by ``s`` cells.
|
||||
Thus, alignment only applies when ``n < d``.
|
||||
|
||||
When using fractional scaling one often wants to fit more than a single
|
||||
character per cell. To accommodate that, there is the ``w`` key. This specifies
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue