Commit Graph
115 Commits
Author SHA1 Message Date
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
Matthias Krüger a6764ba05f Use tool lints for clippy allow/deny lint attributes 2018-12-07 13:58:11 +00:00
Christian Duerr 00830b3da8 Update all dependencies
This applies all breaking and non-breaking dependency updates.
2018-11-14 23:44:53 +00:00
Matt Keeler 2434547fce Upgrade Glutin to v0.19.0
Some changes include:

• Use the with_hardware_acceleration function on the ContextBuilder to not require the discrete GPU
• Remove the LMenu and RMenu virtual key codes (winit 0.16.0 removed these because Windows now generates LAlt and RAlt instead
• Replace set_cursor_state with hide_cursor (winit 0.16.0 removed the set_cursor_state function)
• Replace GlWindow::hidpi_factor with GlWindow::get_hidpi_factor and change to expecting an f64
• Use the glutin/winit dpi size and position types where possible

Glutin's dpi change event has been implemented. All size events now
return logical sizes. As a result of that, the logical sizes are translated
in the `display::handle_rezize` method so DPI scaling works correctly.

When the DPI is changed, the glyph cache is updated to make use of the
correct font size again.

Moving a window to a different screen which is a different DPI caused a
racing condition where the logical size of the event was sent to the
`handle_resize` method in `src/display.rs`, however if there was a DPI
change event before `handle_resize` is able to process this message, it
would incorrectly use the new DPI to scale the resize event.

To solve this issue instead of sending the logical size to the
`handle_resize` method and then converting it to a physical size in
there, the `LogicalSize` of the resize event is transformed into a
`PhysicalSize` as soon as it's received. This fixes potential racing
conditions since all events are processed in order.

The padding has been changed so it's also scaled by DPR.

The `scale_with_dpi` config option has been removed. If it's not present
a warning will be emitted.

The `winit` dependency on Windows has been removed. All interactions
with winit in Alacritty are handled through glutin.
2018-11-10 16:08:48 +00:00
Christian Duerr 0b1754e73f Fix clippy issues
This resolves all existing clippy issues and removes some old `allow`
annotations which aren't neccesary anymore.
2018-11-04 00:11:51 +00:00
Zac Pullar-Strecker 34ada9295d Add support for rendering cursors to rusttype 2018-10-20 20:16:26 +00:00
Zac Pullar-Strecker 15e0deae2b Add support for Windows (#1374)
Initial support for Windows is implemented using the winpty translation
layer. Clipboard support for Windows is provided through the `clipboard`
crate, and font rasterization is provided by RustType.

The tty.rs file has been split into OS-specific files to separate
standard pty handling from the winpty implementation.

Several binary components are fetched via build script on windows
including libclang and winpty. These could be integrated more directly
in the future either by building those dependencies as part of the
Alacritty build process or by leveraging git lfs to store the artifacts.

Fixes #28.
2018-10-16 10:02:52 -07:00
Jon Gjengset f785f88a58 Bump fontconfig dependencies
The patch uses the Cargo.toml patch section to force a single downstream
choice of freetype-sys instead of relying on forks of other crates. It
also bumps the fontconfig/freetype dependencies in the process.
2018-09-30 20:44:14 +00:00
Jeff Muizelaar 26c4043aaf Update core-* dependencies
The core-* dependencies have been updated and every breaking
change has been resolved.

These are the main changes which required adaption:
- font_path() returns a PathBuf now
- get_descriptors() returns an Option<CFArray>
- get_advances_for_glyphs and get_glyphs_for_characters are now unsafe.

All packages which did not have breaking updates have also been updated.
2018-09-19 21:55:35 +00:00
Matthias Krüger 63a40df520 Fix style issues 2018-09-17 23:34:56 +00:00
Matthias Krüger ddb9a55817 Fix clippy lints and run font tests on travis
This fixes some existing clippy issues and runs the `font` tests through travis.

Testing of copypasta crate was omitted due to problens when running on headless travis-ci environment (x11 clipboard would fail).
2018-07-25 19:46:45 +00:00
yshui 0d5edb7a7a Add support for LCD-V pixel mode 2018-07-21 18:05:14 +00:00
Matthias Krüger 21eb50aa50 Enable clippy in font/copypasta crates
Enabled clippy in the sub-crates font and copypasta. All issues
that were discovered by this change have also been fixed.
2018-07-02 22:11:24 +00:00
Christian Duerr 12afbd007d Fix clippy issues 2018-07-01 16:31:46 +00:00
Christian Duerr 5ba34d4f97 Move to cargo clippy
Using clippy as a library has been deprecated, instead the `cargo
clippy` command should be used instead. To comply with this change
clippy has been removed from the `Cargo.toml` and is now installed with
cargo when building in CI.

This has also lead to a few new clippy issues to show up, this includes
everything in the `font` subdirectory. This has been fixed and `font`
should now be covered by clippy CI too.

This also upgrades all dependencies, as a result this fixes #1341 and
this fixes #1344.
2018-06-17 09:19:30 +00:00
Sam Rijs 8045737d58 Upgrade dependencies
Upgrading glutin to the latest version allows building alacritty even
with old XRandr versions.

This is relevant for Debian machines (and other ancient systems).
2018-02-28 19:52:42 +00:00
Joe Moon cc87390ede fix fallbacks in macos (#1099)
fixes #1086
2018-02-07 08:53:58 -08:00
Jeff Muizelaar 2466f81d5e Update core-text (#1061)
This cleans up a bunch of code.
2018-01-31 09:03:24 -08:00
golem131 b82622e994 Update dependencies
Updated the version of some dependencies.

This also changes to a new clippy version so clippy can work with the latest nightly compiler again. Some issues created by new lints have been fixed.
2018-01-26 20:20:42 +00:00
Rachel K 59b561b440 Better character cell width with FreeType (#1029)
This should fix #1020, #710, and #902
2018-01-21 13:29:57 -08:00
Christian Duerr 228400a6c2 Prevent font_size_modifier from sinking too low (#994)
This replaces the `font_size_modifier` stored on the `Term` struct with a `font_size` field.

With this change it is not necessary anymore to calculate the new font size from a delta but the current font size is always stored directly on the `Term` struct.

As a result of this it is now possible to increase the font size by more than 127 steps at runtime. It also limits the minimum font size to 1, so issues with the `font_size_modifier` dropping far below font size 1 are resolved with this change.

This fixes #955.
2018-01-05 03:22:58 +00:00
Christian Dürr 793b5cc3a9 Move custom cursor block on ft
Moved the custom cursor block on ft to the top, so no unnecessary
operations are executed when trying to draw a custom cursor glyph.
2017-12-24 09:46:54 -08:00
Christian Dürr 62d9174509 Use font_key provided with cursor glyphs
Previously it was assumed that the font_key for the normal font is
always 0, because this assumption was a bit of a stretch, now the
font_key provided with the glyph is used. This is always the bold,
italics or normal font associated with the cell.
2017-12-24 09:46:54 -08:00
Christian Duerr 645100cf5f Fix linux symbol size
With linux every box, line or underline should now have the
pixel-perfect size with any font at any size.

This uses the default font to get the size of the monospace box. It
assumes that the face 0 is always the primary font, if this is not the
case, this will probably break.
2017-12-24 09:46:54 -08:00
Christian Duerr 6eb634a2b8 Add box cursor to unfocused underline and beam
Because some people have requested this change, the beam and underline
cursors now also transform into an empty box when the terminal loses
focus. Like this there is one unique symbol to indicate that a terminal
is not currently focused.
2017-12-24 09:46:54 -08:00
Christian Duerr 44251d9dbb Refactor darwin code
The ascent calculation on darwin was more complicated than it needed to
be. By running a `.ceil()` instead of adding one, checking if it's 0,
substracting if it is, and then flooring it, a few instructions could be
shaved off.
2017-12-24 09:46:54 -08:00
Christian Duerr fe29b8c687 Add custom box cursor for unfocused window 2017-12-24 09:46:54 -08:00