50 Commits
Author SHA1 Message Date
xtqqczze 092dcf70d8 style: Add newline after inner attribute for readability (#8130)
Add a newline after inner attributes to make it clear that the
attribute applies to the enclosing item rather than the following item.
2026-09-05 15:31:29 +02:00
Benoit de Chezelles 6f8b1d41b2 ci: Unify shebangs to be portable on systems without /bin/bash (→NixOS) 2026-08-03 05:46:20 +02:00
Wez Furlong edcdefda3b workspace-ify the deps
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
2025-02-12 09:43:36 -07:00
Wez Furlong c79f8d59c4 macos: MACOSX_DEPLOYMENT_TARGET 10.9 -> 10.12
rustc emits:

```
warning: deployment target in MACOSX_DEPLOYMENT_TARGET was set to 10.9, but the minimum supported by `rustc` is 10.12
```

and so we follow that min requirement
2025-02-09 09:51:38 -07:00
Wez Furlong 0eaf755d25 deps: freetype -> 2.13.3 2025-01-03 09:48:50 -07:00
Wez Furlong be54403e4d deps: libpng -> 1.6.44 2025-01-02 08:08:29 -07:00
Wez Furlong 8d3cd83fcd deps: update to zlib 1.3.1
refs: https://github.com/wez/wezterm/pull/6540
2025-01-02 07:59:53 -07:00
Tom e9473edd3e Disable libpng VSX_OPT flag for PowerPC 64
Fix a linker error in wezterm-gui due to a missing libpng feature on modern PowerPC 64-bit platforms.
2024-11-28 10:55:24 -07:00
Wez Furlong 14d426fea8 add cargo deny config, update lru 2024-05-13 08:29:36 -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 513c410eb9 freetype: update bindings to include Paint API 2023-08-17 08:38:02 -07:00
Wez Furlong edbf4ac1e4 add experiemental svg font support
The vertical alignment is wonky, and some glyphs have the wrong
aspect and are missig colors. eg: the watermelon glyph in Noto Color
Emoji (U+1f349).

Turn this off by default, and skip loading fonts that have svg by
default.
2023-08-15 10:33:45 -07:00
Wez Furlong c6f4ff3626 deps: update regenerate.sh scripts for newer bindgen cli
No functional change, just updating for changes in more
recent versions of bindgen.
2023-05-29 21:22:59 -07:00
Wez Furlong fc7f203bac fix freetype build, take 2 2023-04-19 23:28:50 -07:00
Wez Furlong 9409cd9db0 fixup freetype build in release mode 2023-04-19 22:54:37 -07:00
Wez Furlong 15f00ebf0c deps: freetype -> 2.13.0 2023-04-19 22:29:09 -07:00
Wez Furlong 94359d2972 build: fix some log spew on macos
```
warning: voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
warning:                      ^
warning: zlib/zutil.c:315:20: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
```
2023-04-08 17:03:03 -07:00
Wez Furlong af815a2e1b fonts: add freetype_pcf_long_family_names option
Freetype has a compile-time feature that, when enabled, rewrites the
font names of PCF fonts to include the foundry and wide status of the
font in order to disambiguate the various versions of fonts all named
"Fixed".

That option is enabled by default in some linux distributions but not
all; it's not enabled in Fedora, for example.

When that feature is enabled it causes problems for the Terminus font as
the PCF version of the fonts are no longer resolvable via the simple
"Terminus" name but via "xos4 Terminus" instead.

wezterm builds its own version of freetype (for consistency and cross
platform support reasons), and is unaware of the choice used by the
distro.

The result of that is that fontconfig may see PCF fonts as having
different font names than how wezterm sees them.

A concrete problem is on such a system, when requesting "xos4 Terminus",
fontconfig will present a match with that name, but when wezterm opens
the font and sees that it has name "Terminus" (because of the difference
in this feature in the freetype libraries in use), wezterm will reject
that match.

This commit enables that option in the freetype library and adds a
wezterm config level option (freetype_pcf_long_family_names) that can be
used to control the underlying pcf font driver configuration.

The upshot of this is that this commit doesn't change any default
behavior, but allows users of those systems to set
`freetype_pcf_long_family_names = true` to turn that behavior on.

My personal opinion on this is that users probably shouldn't use this if
they can avoid it (and PCF fonts in general), and instead install the
OTB version of the Terminus font, which doesn't have this legacy baggage
associated with it!

refs: https://github.com/wez/wezterm/issues/2100
2022-06-09 20:09:47 -07:00
Wez Furlong 7d8819b8d6 freetype: regenerate ffi bindings 2022-01-31 20:39:05 -07:00
Wez Furlong e4ed2c93e2 encoding my preferred import grouping in the rustfmt config
This uses an unstable option in rustfmt, you `cargo +nightly fmt`
needs to be used to format the code correctly.
2022-01-17 13:50:51 -07:00
Wez Furlong baf879f4f8 upgrade freetype to 2.11.1
refs: #1419
2021-12-20 08:22:34 -07:00
Wez Furlong b8bc9dc01b freetype: expose some more constants 2021-10-10 10:18:47 -07:00
Wez Furlong 2a4cbf0d59 freetype: expose sfnt name functions 2021-10-10 10:14:41 -07:00
Wez Furlong 401719fb01 fonts: improve cap-height and use_cap_height_to_scale_fallback_fonts
We now compute the cap-height from the rasterized glyph data.

Moved the scaling action of use_cap_height_to_scale_fallback_fonts from
glyphcache into the font resolver: when enabled, and we have data
about the baseline font and the font being resolved, then the resolving
font will be scaled such that the cap-height of both fonts has the same
pixel size.

The effect of this is that `I` glyphs from both fonts should appear to
have the same height.

Added a row of `I`'s in differing styles at the bottom of styles.txt
to make this easier to visualize.

refs: #1189
2021-10-02 18:23:51 -07:00
Wez Furlong 2c251acd25 free2type: update for Windows access violation
A stupid MSVC compiler behavior meant that an array wasn't
properly initialized.

This commit resolves it.

https://gitlab.freedesktop.org/freetype/freetype/-/issues/1075
2021-09-26 14:48:48 -07:00
Wez Furlong f648d8a6a5 deps: Upgrade to freetype 2.11 2021-09-25 00:43:23 -07:00
Wez Furlong c37ee01222 fonts: synthesize bold when missing
refs: #815
2021-05-22 16:20:35 -07:00
Wez Furlong 80aa86fa0c fonts: parse weight and italic into ParsedFont 2021-04-07 20:00:41 -07:00
Wez Furlong e200605b8f fonts: add support for "variable" fonts
With this configuration:

```lua
local wezterm = require 'wezterm'

return {
  font_dirs = {"/Users/wez/Downloads/Inconsolata"},
  font = wezterm.font("Inconsolata"),
  font_locator = "ConfigDirsOnly"
}
```

wezterm is now able to see the 74 variations that are available
in the single inconsolata ttf.

Running `WEZTERM_LOG=wezterm_font=trace wezterm` will log the
variations.

refs: https://github.com/wez/wezterm/issues/655
2021-04-07 17:45:38 -07:00
Wez Furlong 2902a76c5c lint: fix some clippy stuff 2021-03-25 10:05:34 -07:00
Wez Furlong 32cb44c225 bump freetype dep to VER-2-10-4 2021-01-25 21:35:47 -08:00
Wez Furlong 4fd574cc7f freetype: enable FT_Error_String
By default, freetype doesn't include error strings and FT_Error_String
will always return NULL.  Turn on the compile time option that makes
this function useful!
2020-11-25 16:19:56 -08:00
Wez Furlong 9892b16d40 wezterm-font: tidy up some font hinting/aa options
This commit more cleanly separates the load from the render flags,
and fixes up the render call; at some point this got messed up such
that we'd never end up with freetype returning subpixel format data
(LCD) and instead we'd only ever get grayscale data.

With that fixed, it's apparent that the colorization of the glyph
data was wonky in the shader so this commit also cleans this up.

refs: #320
refs: #121
2020-11-14 17:27:31 -08:00
Jeremy Fitzhardinge 7bfe83da6b libpng: build NEON support for ARM and Aarch64 targets 2020-11-11 20:31:18 -08:00
Wez Furlong bd179fa56c try to target older macos releases
refs: https://github.com/wez/wezterm/issues/128
2020-01-27 00:12:47 -08:00
Wez Furlong 1bf0402844 fixup submodules 2019-11-24 13:41:32 -08:00
Wez Furlong bc7363465e suppress C build warnings for font related deps 2019-11-05 21:04:37 -08:00
Wez Furlong 09e70357b3 don't link test executable entrypoint into libpng 2019-11-04 09:40:27 -08:00
Wez Furlong ceba08cb59 fixup build on windows 2019-11-04 09:40:27 -08:00
Wez Furlong a199ced513 build libz, libpng, freetype, harfbuzz without cmake
use the cc crate to compile them directly
2019-11-04 09:40:27 -08:00
Wez Furlong 61b27c8089 teach build.rs to init submodules if needed
Forgetting to update the submodules is a commonly reported build
issue with an obscure error message:

```
CMake Error: The source directory "/home/USER/wezterm/target/debug/build/freetype-430fe24cb64c561c/out/zlib-src/zlib" does not appear to contain CMakeLists.txt.
```

this teaches the build.rs machinery to run the submodule update
if it looks like it is needed.
2019-10-29 08:42:38 -07:00
Wez Furlong df20277d85 clippy 2019-07-06 08:18:59 -07:00
Wez Furlong 45d378565b probably fixup build for windows 2019-05-29 12:42:20 -07:00
Wez Furlong 98e93ff3a5 Fix a build issue on fedora 30: lib vs lib64 2019-05-29 11:12:32 -07:00
Wez Furlong 660e52d309 bindgen: skip layout tests
They're specific to the host that ran bindgen, which causes the
windows build to fail if bindgen ran on linux for example.
2019-03-24 11:08:14 -07:00
Wez Furlong 40844962f3 workaround dirty zlib build 2019-03-23 13:18:55 -07:00
Wez Furlong ed2e407df1 enable harfbuzz on windows 2019-03-23 11:53:45 -07:00
Wez Furlong df927a84fc add zlib dep for windows builds 2019-03-23 11:30:34 -07:00
Wez Furlong 72bcd42e48 regenerate bindings on linux 2019-03-23 10:51:09 -07:00
Wez Furlong 27cb18f8ae Build our own freetype, harfbuzz
This is primarily for macos where the default freetype
installation is unable to render color emoji, but should also
help make things more consistent across the various platforms.

It's a little bit awkward on linux because the font-loader crate
pulls in the now-conflicting servo-font* crates.  I've disabled
font-loader on linux systems; it's just calling fontconfig under
the covers anyway.
2019-03-23 09:28:40 -07:00