terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Implement cell size customizations

Open lhecker opened this issue 3 years ago • 5 comments

Does what it says in the title. After this commit you can customize the height and width of the terminal's cells. This commit supports parts of CSS' <length-percentage> data type: Font-size relative sizes as multiples (1.2), percentage (120%), or advance-width relative (1.2ch), as well as absolute sizes in CSS pixels (px) or points (pt).

This PR is neither bug free in DxEngine, nor in AtlasEngine. The former fails to implement glyph advance corrections (for instance #9381), as well as disallowing glyphs to overlap rows. The latter has the same overlap issue, but more severely as it tries to shrink glyphs to fit in.

Closes #3498 Closes #14068

Validation Steps Performed

  • Setting height to 1 creates 12pt tall rows ✅
  • Setting height to 1ch creates square cells ✅
  • Setting width to 1 creates square cells ✅
  • Setting width or height to Npx or Npt works ✅
  • Trailing zeroes are trimmed properly during serialization ✅
  • Patching the PR to allow >100 line heights and entering "100.123456" displays 6 fractional digits ✅

lhecker avatar Oct 19 '22 17:10 lhecker

Finally, after decade waiting for this 😂😘

Before you get too excited, I have to mention again that this PR doesn't work great by itself. Neither the old/stable nor new/preview text renderer work correctly with line heights less than approx. 1.2, which is what a significant portion of people in #3498 have asked for though. I'm working on that separately, but that will unfortunately take another couple months to complete on the side.

lhecker avatar Oct 20 '22 12:10 lhecker

@check-spelling-bot Report

:red_circle: Please review

See the :open_file_folder: files view or the :scroll:action log for details.

Unrecognized words (7)

BGRA finsh teminal versionf XKey YKey YOverride

Previously acknowledged words that are now absent aabbcc abbcc bgra DECCARA DECERA DECFRA DECRARA DECSACE DECSERA DECXCPR hicon IWIC otepad Qaabbcc Qxxxxxxxxxxxxxxx Tdd wic wincodec xwwyzz xxyyzz ZYXWVU ZYXWVUTd :arrow_right:
To accept :heavy_check_mark: these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the [email protected]:microsoft/terminal.git repository on the dev/lhecker/3498-line-heights branch (:information_source: how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.21/apply.pl' |
perl - 'https://github.com/microsoft/terminal/actions/runs/3568352034/attempts/1'
:pencil2: Contributor please read this

By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.

:warning: The command is written for posix shells. If it doesn't work for you, you can manually add (one word per line) / remove items to expect.txt and the excludes.txt files.

If the listed items are:

  • ... misspelled, then please correct them instead of using the command.
  • ... names, please add them to .github/actions/spelling/allow/names.txt.
  • ... APIs, you can add them to a file in .github/actions/spelling/allow/.
  • ... just things you're using, please add them to an appropriate file in .github/actions/spelling/expect/.
  • ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in .github/actions/spelling/patterns/.

See the README.md in each directory for more information.

:microscope: You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. :wink:

If the flagged items are :exploding_head: false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it, try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

github-actions[bot] avatar Nov 28 '22 20:11 github-actions[bot]

@check-spelling-bot Report

:red_circle: Please review

See the :open_file_folder: files view or the :scroll:action log for details.

Unrecognized words (3)

XKey YKey YOverride

Previously acknowledged words that are now absent Hirots :arrow_right:
To accept :heavy_check_mark: these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the [email protected]:microsoft/terminal.git repository on the dev/lhecker/3498-line-heights branch (:information_source: how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.21/apply.pl' |
perl - 'https://github.com/microsoft/terminal/actions/runs/3631191433/attempts/1'
:pencil2: Contributor please read this

By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.

:warning: The command is written for posix shells. If it doesn't work for you, you can manually add (one word per line) / remove items to expect.txt and the excludes.txt files.

If the listed items are:

  • ... misspelled, then please correct them instead of using the command.
  • ... names, please add them to .github/actions/spelling/allow/names.txt.
  • ... APIs, you can add them to a file in .github/actions/spelling/allow/.
  • ... just things you're using, please add them to an appropriate file in .github/actions/spelling/expect/.
  • ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in .github/actions/spelling/patterns/.

See the README.md in each directory for more information.

:microscope: You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. :wink:

If the flagged items are :exploding_head: false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it, try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

github-actions[bot] avatar Dec 06 '22 16:12 github-actions[bot]

I've moved the two fields into the font config object now. With the primary target being the line height customization, the resulting config might look something like this to the user:

{
    "profiles":
    {
        "defaults":
        {
            "font":
            {
                "face": "Consolas",
                "size": 13,
                "cellHeight": "1.4"
            }
        }
    }
}

lhecker avatar Dec 06 '22 23:12 lhecker

with line heights less than approx. 1.2, which is what a significant portion of people in #3498 have asked for though.

Just for the sake of clarity; while a lot of the vocal majority are wanting smaller line heights- there are folk like me out there who want the opposite. I want more distance between my lines. As such, I speak for us all when I say- thank you for doing this. It's the small QoL stuff like this that honestly adds up.

daymxn avatar Feb 21 '23 05:02 daymxn

I would love to have access to this feature. Is 1.18 on the horizon?

Diablo-D3 avatar Feb 28 '23 21:02 Diablo-D3

I would love to have access to this feature. Is 1.18 on the horizon?

Yep, probably not for a couple months though. We're working on some... bigger... features that might take longer to bake. We're still discussing the finer points of our plan here though.

zadjii-msft avatar Feb 28 '23 21:02 zadjii-msft