Fixes a bunch of warnings like this:
```
warning: hiding a lifetime that's elided elsewhere is confusing
--> window/src/os/macos/window.rs:670:23
|
670 | fn display_handle(&self) -> Result<DisplayHandle, HandleError> {
| ^^^^^ ------------- the same lifetime is hidden here
| |
| the lifetime is elided here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
= note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
|
670 | fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError> {
| ++++
```
This lint was added in Rust 1.89: https://github.com/rust-lang/rust/issues/141787
* feat: option to configure font for ActivateCommandPalette, CharSelect, PaneSelect
Add configuration option for font for the below entities:
- ActivateCommandPalette
- CharSelect
- PaneSelect
For the above entities, if the font is not set in configuration, it
defaults to the font resolved in config.window_frame.font. This is in
order to maintain existing behavior of using the font resolved in
config.window_frame.font
* docs: documentation for added configuration options
Add documentation for below configuration options:
- command_palette_font
- char_select_font
- pane_select_font
* refactor: rename EntityFont to Entity
* docs: add example configuration in char_select_font
Apply changes mentioned in suggestion:
https://github.com/wezterm/wezterm/pull/6696#discussion_r1986085165
* docs: add example configuration in pane_select_font
Apply changes mentioned in suggestion:
https://github.com/wezterm/wezterm/pull/6696#discussion_r1986085165
* docs: add example configuration in command_palette_font
Apply changes mentioned in suggestion:
https://github.com/wezterm/wezterm/pull/6696#discussion_r1986085165
* refactor: calculate make_bold in make_entity_font_impl method
* refactor: resolve font_size based on Entity
Since we can fetch font_size based on entity, we resolve it in
'make_entity_font_impl'. This removes the need to pass the pref_size
parameter
Apply changes mentioned in suggestions:
https://github.com/wezterm/wezterm/pull/6696#discussion_r1986085350https://github.com/wezterm/wezterm/pull/6696#discussion_r1986085949
There have been a couple of attempts at this in the past, which
had some usability warts in what I recall as an earlier, less
useful set of features overall.
Whether that was collective misunderstanding at the time, or things
have gotten better since then, now is a good time to adopt the workspace
dep syntax, because wezterm has many crates to keep on top of, and
automation like dependabot can't see a lot of them.
This will help to manage the versions of deps in wezterm centrally.
Let's try this out in CI: the Cargo.lock changes here are minimal
(eliminated a second version of base64 from one crate, terminal_size
from another, and removed an explicit dep on serde_derive) so
hopefully this sails through on !linux.
closes: https://github.com/wezterm/wezterm/pull/6668
This is a PITA. The objc crate does some stuff that spews warnings
everywhere that the sel! and msg_send! macros are used.
That crate is not currently maintained
There is a fork of the crate which resolves the spew, but we also
use the cocoa crate which pulls in the original crate
The new fork is not compatible with cargo workspace patching.
There is an alternative objc2 crate with a nicer, more type-safe
API, but the API changes to migrate are pretty huge: I just lost
a couple of hours on this and still hadn't gotten past the migrating
the NSMenu stuff over.
So, the approach here is to simply ignore the warnings in the modules
that use the objc crate.
This will need to be fixed by someone someday, but that day is not
today.
refs: https://github.com/SSheldon/rust-objc/issues/125
The warning is that some of the variants are never read.
In the case of ftwrap, they are referenced via ffi.
For the other locations, we want them for debug purposes.
In https://github.com/wez/wezterm/issues/4877 it became clear that
the newer approach for finding fallback fonts is only better than
the old approach in some cases, so this commit adds a fallback
to the old approach if the new one didn't yield any usable results
for a given codepoint.
refs: #4099
Root cause is that font-config will try to find a single font that
satisfies a query like `fc-list ':charset=2686 3065'`, but if that
is impossible, there are no results.
The resolution is to split the query up and look for each individual
codepoint.
refs: #4310
Match out bold, semicondensed etc. from the full name.
Allow matching a font based on the full path to the font as
an alternative, because pcf fonts tend to have terrible
metadata and many pixel variants.
refs: https://github.com/wez/wezterm/issues/4256
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.
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
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.
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.
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.
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.