Commit Graph

141 Commits

Author SHA1 Message Date
Kirill Chibisov a14c51797f
Fix build warnings on macOS/Windows 2020-05-27 14:46:52 +00:00
Casper Rogild Storm ab1f173ccd
Add subpixel anti-aliasing support on macOS 10.14+ 2020-05-17 21:14:13 +00:00
Christian Duerr 922f48e52c
Bump winit to 0.22.2
Fixes #2601.
Fixes #2475.
2020-05-16 23:31:00 +00:00
Kirill Chibisov 7ae701d57b
Add support for Fontconfig embolden and matrix options
Fixes #1754.
2020-05-14 04:25:11 +03:00
lbonn 77f2d6e853
Fix emojis being blended with background
Fixes #1864.
2020-05-12 16:23:35 +03:00
Christian Duerr 81ce93574f
Extend style guideline documentation 2020-05-05 22:50:23 +00:00
Christian Duerr 3bfb5958bc
Fix code formatting 2020-04-21 00:27:29 +00:00
David Hewitt 840cb1b93a
Add Windows font fallback 2020-04-16 18:46:17 +00:00
Christian Duerr 637c775a99
Update Linux/BSD font dependencies
This updates font dependencies to make use of the newly unified
freetype-sys crate, allowing us to get rid of Alacritty's patch section
in the Cargo.toml.
2020-03-25 16:52:03 +03:00
Kirill Chibisov 6ad0be5fb3
Use font style for fontconfig fallback 2020-03-17 01:50:12 +00:00
Christian Duerr 6d60a49956
Run clippy on oldest supported version
Since there were some problems with clippy suggesting changes that were
not yet available in the oldest supported Rust compiler of Alacritty,
the clippy stage has been moved from stable to 1.37.0.
2020-03-12 22:49:46 +00:00
Christian Duerr 64a3115648
Fix selection with invisible start and end
This resolves an issue with the selection clamping, where no selection
would be rendered at all when the start was above the viewport while the
end was below it.
2020-03-07 22:17:38 +00:00
Kirill Chibisov de5d770416
Fix caching of variable font faces 2020-03-06 23:15:43 +00:00
Kirill Chibisov 223f8dcfd0
Revert caching of font pixelsize
We can't reliably do that, because some fonts are bitmap,
but marked as scalable by Fontconfig.

Fixes #3387.
2020-02-27 23:44:35 +03:00
Kirill Chibisov 84f57ac836
Add FreeType face cache 2020-02-26 21:29:14 +00:00
Kirill Chibisov 73641d0367
Fix Fontconfig's font size query
Previously we were rounding pattern's `pixelsize` before `fc_sort`, however we were using not rounded one in `get_glyph`, so bitmap fonts could look a bit smaller when used in a mix with scalable fonts.
2020-02-23 02:09:23 +03:00
Kirill Chibisov 8abca44182
Fix discarding of FreeType loading flags
Fixes regression introduced in 6b327b6f8f.

Fixes #3355.
2020-02-20 00:24:50 +03:00
Kirill Chibisov 2672770683
Fix non-scalable font resize issue
Fixes resize regression from 15cc07c069.
2020-02-03 00:17:04 +03:00
Kirill Chibisov 15cc07c069
Fix handling of OpenType variable fonts
Fixes #3257.
2020-01-31 14:54:02 +00:00
Kirill Chibisov 6b327b6f8f
Rework Fontconfig fallback to use cached list from font_sort
Previous implementation was querying Fontconfig using `charset` in a pattern,
which was leading to unpredictable fallbacks in some cases, since Fontconfig
was picking the font with the most coverage for a given charset, regardless of
user configuration. Moreover all fallback was based on font_match which is
extremely slow for such performance sensitive task as a fallback, so alacritty
had a hard times on vtebench's unicode-random-write.

The new approach is to use some internal fallback list from font_sort
and iterate over it to get a proper fallback font, since it matches the
following example query from `fc-match`:

`fc-match -s "monospace:pixelsize=X:style=Y"

That being said it's more intuitive for users to setup their system Fontconfig
fallback, and also most applications are doing similar things. Moreover the new
implementation uses internal caches over Fontconfig API when possible and
performs font matches only once during load of requested font with font_sort,
which leads to dramatically improved performance on already mentioned
vtebench's unicode-random-write.

Fixes #3176.
Fixes #3134.
Fixes #2657.
Fixes #1560.
Fixes #965.
Fixes #511.
2020-01-27 03:54:33 +03:00
Kirill Chibisov e61c28e451
Fix underline position for bitmap fonts
Fixes #3235.
2020-01-22 23:47:59 +03:00
Cole Helbling 091296828a Replace `.nth(0)` with `.next()`
Clippy[1] says that `.next()` is more readable than `.nth(0)`.

[1]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
2020-01-17 03:59:27 +03:00
David Hewitt f54aabfe92 Update font crate to 2018 edition 2020-01-15 23:14:07 +01:00
Christian Duerr c2c8d6bf37
Move Alacritty to organization
This fixes various outdated links pointing to the old jwilm/alacritty
repository.

Since `copypasta` now has its own github repository at
https://github.com/alacritty/copypasta, the sources have been removed
from Alacritty.
2020-01-11 02:23:13 +01:00
sterlingjensen 05df4f4dba Replace deprecated Error methods 2020-01-03 00:17:22 +00:00
Kirill Chibisov 79b19176ee Add support for colored emojis on Linux/BSD
Fixes #153.
2019-12-09 23:12:44 +01:00
Kirill Chibisov d76bb0c697 Update dependencies 2019-10-23 21:17:09 +02:00
Christian Duerr 729eef0c93
Update to winit/glutin EventLoop 2.0
This takes the latest glutin master to port Alacritty to the EventLoop
2.0 rework.

This changes a big part of the event loop handling by pushing the event
loop in a separate thread from the renderer and running both in
parallel.

Fixes #2796.
Fixes #2694.
Fixes #2643.
Fixes #2625.
Fixes #2618.
Fixes #2601.
Fixes #2564.
Fixes #2456.
Fixes #2438.
Fixes #2334.
Fixes #2254.
Fixes #2217.
Fixes #1789.
Fixes #1750.
Fixes #1125.
2019-10-05 02:29:26 +02:00
Christian Duerr 856cddc873
Remove outdated TODO/FIXME comments 2019-09-21 19:54:32 +02:00
Bastien Orivel a8692983f5 Update depedencies 2019-08-18 02:46:29 +00:00
Christian Duerr 86b9cdbabe
Bump minimum supported Rust version to 1.34.0 2019-07-30 22:13:51 +00:00
Roman Holovin f49350fd5b Respect fontconfig's embeddedbitmap setting
Fixes #2655.
2019-07-23 21:21:11 +00:00
Alex 1c05b3bb0c Query DirectWrite for the rendering mode to use 2019-07-14 10:53:04 +00:00
Lê Viết Hoàng Dũng e398eb8406 Use Menlo as fallback font on macOS
This commit makes alacritty use Menlo as a fallback font on macOS if the config specified font family isn't found.
2019-07-06 09:00:16 +00:00
Matthias Krüger f59aa19892 Fix compiler warnings 2019-06-09 17:52:48 +00:00
Christian Duerr 4cd55acd78
Bump minimum supported Rust version to 1.32.0 2019-06-08 16:01:14 +00:00
Ben Pye b0efa9d105 Add DirectWrite font rasterizer
This adds a DirectWrite font rasterizer for Windows and enables
subpixel rendering and hinting.

It also completely replaces rusttype for font rendering on Windows,
allowing Alacritty to use the native font stacks on all operating systems.

Fixes #1673.
Fixes #2316.
2019-04-23 17:41:21 +00:00
Christian Duerr 0d060d5d80
Fix cursor colors
This fixes a recent regression in
cfc20d4f34 which broke cursor colors when
specified in the `colors.cursor` field in the config.

It also removes a lot of unneeded code from the font crate related to
the cursor rendering.

This fixes #2338.
2019-04-20 22:47:05 +00:00
Christian Duerr cfc20d4f34
Fix cursor dimensions with font offset
Previously cursor dimensions were not calculated correctly when a font
offset was specified, since the font offset was completely ignored.

This has been fixed by moving all the cursor logic from the font into
the Alacritty crate, applying the config's offsets before rasterizing
the cursors.

This has also fixed an issue with some cursors not being rendered as
double-width correctly when over double-width glyphs.

This fixes #2209.
2019-04-19 18:00:24 +00:00
Christian Duerr 5174f9b274
Fix duplicate resize events
If a resize event is identical to the current size, it is no longer
propagated but the resize is discarded immediately.

To further prevent resizes when not necessary, the list of monitors is
enumerated and the DPR of the first display is assumed to be the target
DPR.

This allows spawning a window with dimensions when the config has
columns and lines specified and the window only needs to be resized if
the estimated DPR is not correct.

Fixes #1825.
Fixes #204.
2019-04-14 15:37:58 +00:00
Christian Duerr 56fea343ff
Set maximum Rust version to 1.31.0
By setting the minimum Rust version and enforcing it with CI, Alacritty
should hopefully make it possible for maintainers to package the
application even on distributions which are not rolling release.

The 1.31.0 target has been chosen here because it's the first version of
the Rust 2018 release. Bumping this version in the future should be
considered to be a breaking change and should only be done with caution
and in consideration of the supported Rust versions of the major
distributions available.

This fixes #2277.
2019-04-09 19:29:46 +00:00
Christian Duerr e98ea64c74
Bump dependencies 2019-04-03 22:57:54 +00:00
Christian Duerr 5523f64c6f
Revert daemon removal
This reverts the removal of the call to libc::daemon and instead adds an
annotation to ignore the deprecation warnings on macos.

This will not be an issue in the future since macOS is only discouraging
the use of `daemon`, but I'm not aware of any intention to actually
remove it.

This fixes #2211.
2019-04-01 22:27:27 +00:00
Christian Duerr cfd025b528
Add rustfmt style guide 2019-03-30 16:48:36 +00:00
Christian Duerr 851e77383e
Remove library lockfiles from git
Following Rust's standard, the lockfiles for Alacritty's
sub-libraries have been removed.

One instance of the deprecated `ATOMIC_USIZE_INIT` has
also been removed.

This fixes #2040.
2019-02-04 23:12:56 +00:00
Christian Duerr 31271c726e
Fix crash on Windows (#2021)
The rusttype backend did not properly support manually specifying font
styles, but instead chose to panic when they are specified.

The rusttype implementation now provides a proper implementation for
handling `bold`, `italic` and `regular` font styles.

This fixes #2020.
2019-01-20 17:39:15 +00:00
Nathan Lilienthal 04707cbba6 Normalize Log Message Strings
The general style for errors, warnings and info messages is to start
with a capitalized letter and end without a period. The main exception
is when dealing with nouns that are clearer with special case handling,
e.g. "macOS failed to work" or "ioctl is borked".
2019-01-07 00:06:57 +00:00
Christian Duerr 7275ecc282
Fix line metrics
Since bitmap fonts do not provide their own underline metrics, the
self-calculated metrics which have been used for rusttype are now also
used for bitmap fonts with freetype.

The rusttype and bitmap fallback metrics have incorrectly offset the
underline by the underline height. Since the position is already defined
as the center point, that is not necessary.

All rounding and clamping has also been removed from the font library,
so that the raw values are reported now. The clamping and rounding is
now done in the line renderer.
2018-12-31 17:01:06 +00:00
Christian Duerr 2f9b815ebd
Add proper underline and strikeout support
This makes use of the new rectangle rendering methods used to display
the colored visual bell to add proper underline and strikeout support to
Alacritty.
2018-12-22 17:16:54 +00:00
Joe Wilm 217ad9ec28 Upgrade to Rust 2018
This resolves a lot of NLL issues, however full NLL will be necessary to
handle a couple of remaining issues.
2018-12-10 17:53:56 +00:00