1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 13:21:38 +03:00
Commit Graph

7427 Commits

Author SHA1 Message Date
Wez Furlong
914f18b19c
remove openssl pinning, cargo update
refs: https://github.com/sfackler/rust-openssl/issues/1645
2023-09-04 13:31:03 -07:00
Wez Furlong
99c9613966
docs and derived files for zoom-pane
refs: #4160
2023-08-28 22:04:14 -07:00
Quan Tong
f4db68637d check the zoom state before unzooming 2023-08-28 21:58:22 -07:00
Quan Tong
8f845f9b47 simplify 2023-08-28 21:58:22 -07:00
Quan Tong
cb2178e7d7 add zoom-pane subcommand 2023-08-28 21:58:22 -07:00
Wez Furlong
a103b6d97a
fix CloseCurrentPane leaving a stranded pane in a tab
Repro for this issue was:

```console
$ WEZTERM_LOG=mux=trace,info ./target/debug/wezterm -n --config 'exit_behavior="CloseOnCleanExit"'
```

Then:

* Split left/right
* CloseCurrentPane

refs: #4030
2023-08-28 07:28:23 -07:00
Wez Furlong
cb0e1599ac
cairo: fix build on freebsd 2023-08-28 06:51:45 -07:00
Wez Furlong
ed92b30370
cargo update 2023-08-28 06:40:02 -07:00
Wez Furlong
d35f067deb
hbwrap: fix compilation on aarch64
refs: https://github.com/wez/wezterm/issues/4213
2023-08-28 06:39:14 -07:00
Wez Furlong
c1b7ba2f35
fix warning in latest rust compiler 2023-08-28 06:39:14 -07:00
Wez Furlong
551af58637
font: refactor: extract ClusterResolver to file scope 2023-08-28 06:39:14 -07:00
Wez Furlong
ce7e5a2799
font: hbwrap: add harfbuzz caret API 2023-08-28 06:39:14 -07:00
near129
b53a385a39 include shell completion 2023-08-27 09:31:08 -07:00
Wez Furlong
2c95b98447
text cursor glyph renders at native cell size
Previously we'd use the scaled-by-line-height-and-cell-width dimensions
for the text cursor, leading to oddly dimensioned block cursors when
`line_height` or `cell_width` were configured.

This commit captures the native cell dimensions into the RenderMetrics
which makes it feasible for the glyph and sprite rendering logic to
reason about it.

The cursor rendering now renders at the native size and position by
using a transform to scale and translate into the correct spot.

We could potentially use the same technique for eg: braille or
other non-drawing characters
(https://github.com/wez/wezterm/issues/1957) although that is more
complex than just this commit.

refs: https://github.com/wez/wezterm/issues/2882
2023-08-26 14:11:13 -07:00
Wez Furlong
360ad2a3a9
fix strikethrough position for line_height != 1.0 2023-08-26 13:01:41 -07:00
Wez Furlong
b904ed7677
breaking(ish): pane.get_current_working_dir now returns Url
Previously we'd return the Url string.  Now we provide a Url
object that provides access to the various elements of the Url.

This will cause slightly breakage for folks that were treating
it as a string in their status event handlers, for example.

The docs have been updated to show how to run with both this
new Url object and also continue to run on older versions of
wezterm.

They now also show how to manually percent decode the url
for older versions of wezterm.

refs: https://github.com/wez/wezterm/discussions/4157
refs: https://github.com/wez/wezterm/issues/4000
2023-08-25 06:59:09 -07:00
Robson Roberto Souza Peixoto
547825072c doc: add missing config variable on tab_bar_style documentation 2023-08-25 05:25:27 -07:00
Wez Furlong
53988c7fe6
PaneSelect: add SwapWithActiveKeepFocus
refs: #3014
2023-08-24 22:32:19 -07:00
Wez Furlong
a9c7d28b09
PaneSelect: MoveToNewTab, MoveToNewWindow and show_pane_ids
refs: #4147
2023-08-24 19:56:46 -07:00
Wez Furlong
c91e124f41
fonts: fix potential panic for bitmap space glyphs with 0 size 2023-08-22 23:34:08 -07:00
Wez Furlong
ea72e10ffe
cargo update 2023-08-22 23:32:21 -07:00
Wez Furlong
7c88c179e1
charselect: add emoji variations and new short codes section
Move the shortcode aliases out from the various emoji category
pages and into a new shortcode page.

Add variations, such as skin tones, to the different emoji
category pages.
2023-08-22 22:53:14 -07:00
Wez Furlong
c7cc3e4d81
charselect: parallelize fuzzy matching
This gets the matching time down below 110+ms to around 70ms
in release mode, which may not sound like a huge amount, but 100ms
is on the cusp of perceivable latency, so getting below that is
desirable.
2023-08-22 20:22:09 -07:00
Wez Furlong
e4ea6a6c4b
fonts: capture palette info when parsing fonts 2023-08-22 19:12:47 -07:00
Wez Furlong
4d33b3b535
shapecache fixup test for updated noto font 2023-08-22 09:53:59 -07:00
Wez Furlong
098b928001
Update Noto Color Emoji to 2.038
This particular file has had the SVG table removed, reducing its
filesize from 23M down to 4.6M.

Previously, the png/bitmap based version was 9.5M, so this update
saves a few MB.

See discussion at:
https://github.com/harfbuzz/harfbuzz/discussions/4382#discussioncomment-6792813
2023-08-22 07:53:32 -07:00
Wez Furlong
67f4450d8f
fonts: detect colr glyphs better
Freetype's support for colr is relatively rudimentary, which is fine,
but we want more control, so we probe a bit harder to figure out
whether a glyph has colr information before allowing freetype
to rasterize it, so that we have the opportunity to reroute
that rendering to our own logic.
2023-08-22 07:35:55 -07:00
Wez Furlong
7af61159a8
font: port over radial gradient fills 2023-08-22 06:43:58 -07:00
Wez Furlong
c41ae92404
deps/harfbuzz: ignore a warning in the harfbuzz library
We can't do anything about warnings in vendored libraries, so
suppress it.
2023-08-22 06:42:46 -07:00
Wez Furlong
85bb023295
font: refactor: extract common function 2023-08-21 09:40:24 -07:00
Wez Furlong
dd6f2a4d7f
fonts: stub out sweep gradient 2023-08-21 09:38:18 -07:00
Wez Furlong
40083f55b8
font: refactor: reuse ColorLine and gradient structs 2023-08-21 09:30:40 -07:00
Wez Furlong
01fd28fc02
refactor: extract colr from freetype -> colr.rs 2023-08-21 09:19:22 -07:00
Wez Furlong
0456719980
windows: fix build
Weirdly, the rust compiler is suddenly complaining about this,
when this file hasn't changed.

```
error[E0283]: type annotations needed
    --> window\src\os\windows\window.rs:2398:26
     |
2398 |         if vk <= u8::MAX.into() {
     |               --         ^^^^
     |               |
     |               type must be known at this point
     |
     = note: cannot satisfy `u32: PartialOrd<_>`
help: try using a fully qualified path to specify the expected types
     |
2398 |         if vk <= <u8 as Into<T>>::into(u8::MAX) {
     |                  ++++++++++++++++++++++       ~

error[E0283]: type annotations needed
    --> window\src\os\windows\window.rs:2415:32
     |
2415 |         if leader.1 <= u8::MAX.into() && key.1 <= u8::MAX.into() {
     |                     --         ^^^^
     |                     |
     |                     type must be known at this point
     |
     = note: cannot satisfy `u32: PartialOrd<_>`
help: try using a fully qualified path to specify the expected types
     |
2415 |         if leader.1 <= <u8 as Into<T>>::into(u8::MAX) && key.1 <= u8::MAX.into() {
     |                        ++++++++++++++++++++++       ~

```
2023-08-21 06:00:51 -07:00
Wez Furlong
89fbb87f0d
Add note about COLR v1 support
refs: https://github.com/wez/wezterm/issues/4148
2023-08-20 23:21:48 -07:00
Wez Furlong
c68e92d202
cargo update 2023-08-20 23:16:56 -07:00
Wez Furlong
64dd96917d
fonts: repurpose experimental_svg_fonts -> ignore_svg_fonts
Now we can optionally skip loading svg fonts, making our default
to continue to try to use them.

We don't actually support interpreting svg data, but we do now
support COLR v1 data which is found in some of those same fonts.

refs: https://github.com/wez/wezterm/issues/4148
2023-08-20 22:59:22 -07:00
Wez Furlong
e1044a6d5f
font: colr: add font_colr_rasterizer option
The harfbuzz driven rasterization of COLR glyphs is superior to
my attept at a freetype driven rasterizer, so let's default to
the harfbuzz version.

This change means that the default for most regular glyphs is
freetype, but we'll use harfbuzz for COLR glyphs.
2023-08-20 22:55:02 -07:00
Wez Furlong
017432d0cf
freetype: colr: fixup crazy scaling issue in char selector
Popping open the char selector could result in comedy-sized emoji
that dramatically overflow the bounds.

The reason for that is that glyphcache isn't smart enough to notice
when the glyph.height exceeds the cell_height and allows the glyph
bitmap to be rendered at the rasterized size.

The reason for that glyph being so huge is that freetype is producing
outlines that are too large.  The font metrics have the requested
x and y ppem values (eg: the nominal font size in pixels), but also
x and y scaling values that are not set to 1.  The result is that
the produced extents are too large by those x and y scaling values.

I'm not sure why that is, but it is simplest and most self-contained
to adjust for that scale factor when we rasterize via cairo, so that
is what we do here.
2023-08-20 19:55:56 -07:00
Wez Furlong
b6ba87ad3c
fonts: tidy up some warnings 2023-08-20 17:46:34 -07:00
Wez Furlong
19ccec6e86
cairo: suppress a bunch of warnings
We can't do anything about warnings in the vendored code, except
pretend they do not exist!
2023-08-20 17:38:25 -07:00
Wez Furlong
8f4f9653c5
font: adjust metrics for pre-scaled bitmap glyphs
When using the harfbuzz rasterizer with a bitmap glyph, the result
is a rasterized glyph that is pre-scaled to the cell dimensions.

We need to tell glyphcache that that has happened, otherwise it
will apply the same scale factor again.
2023-08-20 17:32:42 -07:00
Wez Furlong
84720a18f0
fonts: stick with ft based metrics for now
I think I've got the right values going in and out, so I think
it's ok to turn this on, but I'm worried about legacy non-opentype
formats that freetype supports but harfbuzz doesn't.

Let's stick with ft's metrics until I find time to validate
the behavior.
2023-08-20 16:52:33 -07:00
Wez Furlong
536c3fa4da
rasterizer/freetype: tune debug logging 2023-08-20 15:31:33 -07:00
Wez Furlong
7264030a28
fonts: adopt fixed crate for freetype fixed-point math
This found at least one bug and should prevent future bugs.
2023-08-20 15:19:30 -07:00
Wez Furlong
1ed4058741
fonts: add freetype COLR 1 raster impl
This isn't fully baked, but it looks mostly ok.
The ghost emoji has a weirdly positioned white patch; there's
something funky with its positioning that needs to be investigated.

There's some copypasta here; a bunch of the cairo related stuff
was copied and adapted from the harfbuzz impl.

I plan to refactor the latter in terms of the former to reduce
the amount of code overall.
2023-08-20 15:19:30 -07:00
Wez Furlong
44e9e09273
font: remove half-baked attempt at rendering svg fonts
It's just too complex. Will focus on COLR 1 instead.
2023-08-20 15:19:30 -07:00
Wez Furlong
6b7ba71f32
fonts: harfbuzz raster: add linear and radial gradients
fixup colors and excessive clipping.

This now looks decent. Still don't support sweep gradients;
those look complex and I'm not sure that I have a font to
test that against.
2023-08-20 15:19:30 -07:00
Wez Furlong
f1c82e8894
fonts: harfbuzz raster: use cairo
This meshes well with the sequence of instructions that we
get from harfbuzz.

This will need some vendoring to integrate with wezterm's build
on all platforms; that can come later.

Still need to hook up gradients.
2023-08-20 15:19:27 -07:00
Wez Furlong
4ddcad7ef6
fonts: harfbuzz raster: rejigger
We need to make a couple of passes over the paint instructions,
and making a nice interface around FontFuncs and DrawFuncs was
taking up a lot of boilerplate.

Adjust so that we accumulate parsed PaintOps and DrawOps instead.

This makes the code smaller and easier to grok.

Still has trouble rasterizing the new noto color emoji font though.
2023-08-20 15:18:10 -07:00