1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-30 09:01:49 +03:00
Commit Graph

83 Commits

Author SHA1 Message Date
Wez Furlong
61776aa5a3 fonts: general implementation for config.font_dirs
This commit makes use of the allsorts font parser to
parse out matching fonts found under the `font_dirs`
locations.

The matching is imperfect but sufficient for my ad-hoc
local tests.

Using allsorts for this parsing/matching means that we
can implement font_dirs on all platforms; previously it
was only available when using some plumbing from font-kit.

Refs: https://github.com/wez/wezterm/issues/74
2019-12-09 21:59:34 -08:00
Wez Furlong
aed75850c5 fonts: remove references to long-dead fontconfig feature name 2019-12-09 20:26:58 -08:00
Wez Furlong
2d024845a7 fonts: rename font loader to locator 2019-12-09 20:06:12 -08:00
Wez Furlong
f89b52e53e fonts: add a basic font parse using allsorts
Refs: https://github.com/wez/wezterm/issues/66
2019-12-09 18:08:02 -08:00
Wez Furlong
e01fed8120 fonts: remove some dead code 2019-12-09 13:56:34 -08:00
Wez Furlong
0a0a895a5b fonts: remove fontconfigandfreetype.rs 2019-12-09 13:43:48 -08:00
Wez Furlong
988e996a76 fonts: remove font_system selection type
This simplifies things a bit by removing some boiler plate.
We can now control locator, shaper and rasterizer independently.
2019-12-09 13:35:38 -08:00
Wez Furlong
108942960f fonts: migrate default_font over to new stuff 2019-12-09 13:24:09 -08:00
Wez Furlong
6fdb693f2c fonts: cut raster and shaper over to new stuff 2019-12-09 13:17:40 -08:00
Wez Furlong
c91345cbd6 fonts: FontConfiguration::resolve_font
Can now create a LoadedFont that ties together the new abstractions.
It's not yet sufficient to use in wezterm though.
2019-12-09 12:46:58 -08:00
Wez Furlong
cd07a31d84 fonts: start adding new stuff to FontConfiguration 2019-12-09 12:12:54 -08:00
Wez Furlong
b5a59a18fa fonts: extract the shaper concept 2019-12-09 00:06:47 -08:00
Wez Furlong
41d10811a6 fonts: break out the rasterizer concept 2019-12-08 23:27:10 -08:00
Wez Furlong
6f867ac3e2 fonts: start breaking out the loader/locator concept 2019-12-08 22:48:47 -08:00
Wez Furlong
ab86eb1c75 font-kit: enable its use on macos
FontKit is still broken, but FontKitAndFreeType works
2019-12-08 17:51:01 -08:00
Wez Furlong
8ae136e616 fonts: allow using font-kit as a source for fonts
This commit adds two new font system variants that are currently
implemented only on Windows:

* FontKit - uses fontkit both for font discovery and rasterizing
* FontKitAndFreeType - uses fontkit for font discovery but freetype
  for rasterizing

To a certain extent, FontKitAndFreeType obsoletes FontLoaderAndFreeType
and I'll be looking at removing it once I can test the build on macOS.

The FontKit impl has bad metrics and also crashes during shaping
on Windows, so it's not ready to be used by default.
2019-12-08 16:02:04 -08:00
Wez Furlong
e56dfa9875 config reloading now also applies to fonts
This change also causes any/all windows to pick up the reloaded config
2019-11-24 10:24:33 -08:00
Wez Furlong
d06c08e0f3 config: expose configuration generation number 2019-11-24 09:19:14 -08:00
Wez Furlong
8996f897b9 remove Mux::config in favor of config::configuration()
The idea is to centralize accessing the config to that
function so that we can implement config reloading.
2019-11-24 09:07:46 -08:00
Wez Furlong
819faa3f85 remove unused get_dpi_scale method 2019-11-03 22:01:35 -08:00
Wez Furlong
047a58a6e9 improve error messages when shaping 2019-11-02 16:43:09 -07:00
Wez Furlong
5ebad9e63a dyn everywhere 2019-06-08 21:28:11 -07:00
Wez Furlong
34d6d95b6f adopt log and env_logger for logging 2019-06-08 15:17:41 -07:00
Wez Furlong
f87901c484 tidy up some failure usage 2019-05-26 08:58:59 -07:00
Wez Furlong
45c1f5b4f3 cleanup travis config, re-enable cargo test --all
Streamline the travis deploy builds; when TRAVIS_TAG is set
we'll run `--release` builds.

Don't error out in fontconfig/build.rs if fontconfig is not
installed.  This makes it possible to `cargo test --all` again
on the mac at the cost of potentially making it harder to troubleshoot
problems with not having fontconfig installed on linux.
However: the get-deps script is responsible for installing that.
2019-03-24 08:45:28 -07:00
Wez Furlong
10b3460c49 remove rusttype 2019-03-23 13:45:26 -07:00
Wez Furlong
ed2e407df1 enable harfbuzz on windows 2019-03-23 11:53:45 -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
Wez Furlong
5533eaeba2 disable coretext by default on macos
freetype renders better for now
2019-03-22 21:14:37 -07:00
Wez Furlong
7cdd1876d1 Enable serializing various Line and Cell related structs 2019-03-22 20:41:50 -07:00
Wez Furlong
7afd586ad0 allow looking up the font system from the gui thread
This helps remove the Rc<events> thing from a couple of places
2019-03-04 16:05:42 +00:00
Wez Furlong
2ece60b45c Rc<Config> -> Arc<Config> 2019-03-04 15:49:03 +00:00
Wez Furlong
d7b55382b4 big initial mux change
This is an unfortunately large diff that:

* Separates Tab ownership from TerminalWindow
* Introduces a Mux container for all of the tabs in the application,
  across all windows
* Moves ownership of processing pty responses to the mux; it sets
  up and has logic to process data for the ptys and apply to the
  tabs

I've moved the logic for processing new tab and new window hotkeys
to the TerminalWindow's themselves as we need some context to
associate the tab with the right window and to create a new window.

I think that will simplify and allow unifying more code.
2019-02-25 00:03:35 -08:00
Wez Furlong
dba88d2102 clippy 2019-02-24 12:01:08 -08:00
Wez Furlong
3026d0fa16 refactor scaling changed 2019-02-23 23:10:40 -08:00
Wez Furlong
aa9942e6d4 spawned windows no longer inherit scaling
On hidpi displays we'd end up with a window twice the size; whoops!
2019-02-23 17:11:23 -08:00
Wez Furlong
9bc54da406 use Rc<FontSystem> rather than Box
This will help with an upcoming change
2019-02-23 17:05:46 -08:00
Wez Furlong
332b0faeaa CoreText renderer is now the default on macOS
I've added dingbats to the fallback list on macos as that is needed
for some symbols we use in tools at work.

With that, and some tweaks for allowing for missing letter glyphs
when loading a symbol font as a fallback, we can make that the
default for macOS

Closes https://github.com/wez/wezterm/issues/5
2019-02-22 15:51:36 -08:00
Wez Furlong
89da009dce Adjust for high dpi displays with the glutin backend
This results in a less blurry display.
As a bonus, this lays down some plumbing for changing the font
size on the fly.

Refs: https://github.com/wez/wezterm/issues/2
2019-02-22 15:22:27 -08:00
Wez Furlong
7e2e48dadc add default metrics accessor to FontConfiguration struct 2019-02-22 15:21:07 -08:00
Wez Furlong
97096ffc5d implement coretext font rendering
This uses harfbuzz for shaping and thus can render both emoji and
ligatures

Refs: https://github.com/wez/wezterm/issues/5
2019-02-22 15:21:04 -08:00
Wez Furlong
9fa376d2a3 Add command line override for font system 2019-02-20 09:01:36 -08:00
Wez Furlong
6ffe4a3044 prefer freetype over rusttype 2019-02-18 23:31:22 -08:00
Wez Furlong
03f6f1272b fixup macos compilation 2019-02-18 22:22:43 -08:00
Wez Furlong
3dfaf7111f allow runtime selection of font loader/renderer
This cleans up the rats nest of conditional build bits
and allows easier testing and comparison of the systems.
2019-02-18 22:02:31 -08:00
Wez Furlong
79fb3e206b use fontload + freetype on windows 2019-02-18 21:09:54 -08:00
Wez Furlong
1039e013c1 extract fontloader loader from fontloader_and_rusttype 2019-02-18 13:28:25 -08:00
Wez Furlong
9de24a75ed split rusttype font from fontloader 2019-02-18 13:13:36 -08:00
Wez Furlong
ad55946f07 extract freetype font impl to its own module 2019-02-18 12:52:31 -08:00
Wez Furlong
ad41cecd6e make harfbuzz dep optional 2019-02-17 12:55:02 -08:00