Commit Graph
83 Commits
Author SHA1 Message Date
Wez Furlong 6a58a5ce94 deps: harfbuzz -> 8.3.0 2023-11-22 17:41:38 -07:00
Wez Furlong f1be33939b deps: update harfbuzz to 8.2.1 2023-09-20 17:59:05 -07:00
Wez Furlong cb0e1599ac cairo: fix build on freebsd 2023-08-28 06:51:45 -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 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 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 58a2a30623 Add vendored cairo-sys-rs crate
I'm experimenting with using cairo's 2D graphics for glyph related
drawing operations, and perhaps more stuff in the UI in the future.

The challenge is that no one has yet encapsulated its build in a
cargo-friendly way.

This commit is that attempt.

The strategy is this:

* `deps/cairo` is ostensibly the same thing as https://github.com/gtk-rs/gtk-rs-core/tree/master/cairo/sys
  which is the cairo-sys-rs crate
* Its build.rs has been replaced with a version that builds from the C
  sources that are found in-tree; it will never look for the system
  cairo library
* A pair of scripts to import pixman (a required dep of cairo) and
  cairo itself in a repeatable way are include, for if/when we need
  to update the vendored sources
  Cairo is a mature library and doesn't release very often.
* The workspace sets a patch for crates.io so that cairo-rs has
  its cairo-sys-rs dep redirected to the local build.

I'm not planning to upstream this stuff to gtk-rs-core as full cairo
depends on a lot more things than are dealt with here, so it would be a
PITA to handle that generally.

This vendoring strips out things that are not used, so the cairo
library that remains:

* Is not internally thread safe; no TLS or mutex support is enabled
  in either of them. That's fine because the high level cairo-rs
  wrapper is not Send+Sync, which means that rust will only allow
  it to be used single threaded anyway.
* Only has the basic recording and image surfaces
* No platform support for win32/xlib/xcb and so on
2023-08-20 14:59:29 -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 a7c6ea8c1e deps: harfbuzz -> 8.1.1
Second attempt to get on 8.1, tests seem good!

refs: https://github.com/harfbuzz/harfbuzz/issues/4358
2023-08-02 19:06:52 -07:00
Wez Furlong ca9cf23019 Revert "deps: harfbuzz -> 8.1.0"
This reverts commit e7bf2b4088.

The tests fail when built and run in release mode. There's
something fishy that needs investigation; will do so later.
2023-07-31 23:10:25 -07:00
Wez Furlong e7bf2b4088 deps: harfbuzz -> 8.1.0 2023-07-31 22:32:21 -07:00
Wez Furlong 28dcea0ab6 deps: harfbuzz -> 8.0.1 2023-07-12 06:37:34 -07:00
Wez Furlong 1bfaf8522a deps: harfbuzz -> 8.0.0 2023-07-09 07:38:36 -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 794a102b6a deps: harfbuzz -> 7.3.0 2023-05-29 16:37:24 -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 4038b80048 deps: update harfbuzz to 7.1.0 2023-04-19 22:11:21 -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 fe55ace7d9 deps: harfbuzz -> 6.0.0 2022-12-19 17:33:00 -07:00
Wez Furlong cc4a155a4a update harfbuzz to 5.3.1
it includes a fix for shaping grapheme clusters for Katakana voiced
sound marks.

refs: https://github.com/wez/wezterm/issues/2572
2022-10-19 20:00:13 -07:00
Wez Furlong dc9fb118ec deps: harfbuzz -> 5.2.0 2022-09-21 21:13:01 -07:00
Wez Furlong 53c6de956f harfbuzz: revise build and bindings
More recent versions of harfbuzz conveniently generate harfbuzz.cc
which has the full list of source files, so point our build to
that instead of chasing the evolving list of files: much easier!

Fixup some of the predefined symbols, and include opentype functions
in bindings.h so that we can pick those up in the bindgen output.
2022-09-03 08:20:53 -07:00
Wez Furlong 7dda063c27 update harfbuzz to 5.1.0 2022-07-31 10:53:25 -07:00
Wez Furlong e7c7ea20f6 deps: harfbuzz -> 5.0.1 2022-07-26 09:09:46 -07:00
Wez Furlong 8fb1c091ae update harfbuzz to 4.4.1 2022-07-04 15:26:42 -07:00
kumattau dc947ed0f8 Fix that harfbuzz skips the usage of some freetype functions unexpectedly 2022-06-11 07:37:58 -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 8f880551a0 deps: harfbuzz -> 4.3.0 2022-05-24 18:43:10 -07:00
Wez Furlong 9bf732bcae update harfbuzz to 4.2.1 2022-04-24 16:40:53 -07:00
Wez Furlong e76525b695 deps: harfbuzz -> 4.2.0 2022-04-03 18:37:25 -07:00
Wez Furlong 8eb497fa19 deps: harfbuzz -> 4.1.0 2022-03-26 10:51:35 -07:00
Wez Furlong d64f0c2189 deps: harfbuzz -> 4.0.1 2022-03-12 07:06:54 -07:00
Wez Furlong a79fc87586 deps: harfbuzz -> 3.4.0 2022-02-12 16:00:58 -07:00
Wez Furlong 1b63b4b7c9 deps: harfbuzz -> 3.3.2 2022-02-06 06:44:59 -07:00
Wez Furlong 7d8819b8d6 freetype: regenerate ffi bindings 2022-01-31 20:39:05 -07:00
Wez Furlong 40eef5b5dd harfbuzz: regenerate ffi bindings 2022-01-31 20:35:12 -07:00
Wez Furlong 05354fe8e5 deps: update harfbuzz to 3.3.1 2022-01-31 20:32:20 -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 88688e32c7 update harfbuzz to 3.2.0 2021-12-11 20:36:53 -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 b16f584866 deps: harfbuzz -> 3.0.0 2021-09-18 09:04:23 -07:00
Wez Furlong c870c73dbe deps: update harfbuzz to 2.9.1 2021-09-09 09:01:42 -07:00