summaryrefslogtreecommitdiffstats
path: root/font/src
AgeCommit message (Collapse)Author
2020-02-27Revert caching of font pixelsizeKirill Chibisov
We can't reliably do that, because some fonts are bitmap, but marked as scalable by Fontconfig. Fixes #3387.
2020-02-26Add FreeType face cacheKirill Chibisov
2020-02-23Fix Fontconfig's font size queryKirill Chibisov
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-20Fix discarding of FreeType loading flagsKirill Chibisov
Fixes regression introduced in 6b327b6f8f0f308ff8f46cdf551ce0d0f3eda60b. Fixes #3355.
2020-02-03Fix non-scalable font resize issueKirill Chibisov
Fixes resize regression from 15cc07c069b09f109ed18fb94e02e9650be7fa33.
2020-01-31Fix handling of OpenType variable fontsKirill Chibisov
Fixes #3257.
2020-01-27Rework Fontconfig fallback to use cached list from font_sortKirill Chibisov
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-22Fix underline position for bitmap fontsKirill Chibisov
Fixes #3235.
2020-01-17Replace `.nth(0)` with `.next()`Cole Helbling
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-15Update font crate to 2018 editionDavid Hewitt
2020-01-03Replace deprecated Error methodssterlingjensen
2019-12-09Add support for colored emojis on Linux/BSDKirill Chibisov
Fixes #153.
2019-10-23Update dependenciesKirill Chibisov
2019-10-05Update to winit/glutin EventLoop 2.0Christian Duerr
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-09-21Remove outdated TODO/FIXME commentsChristian Duerr
2019-08-18Update depedenciesBastien Orivel
2019-07-30Bump minimum supported Rust version to 1.34.0Christian Duerr
2019-07-23Respect fontconfig's embeddedbitmap settingRoman Holovin
Fixes #2655.
2019-07-14Query DirectWrite for the rendering mode to useAlex
2019-07-06Use Menlo as fallback font on macOSLê Viết Hoàng Dũng
This commit makes alacritty use Menlo as a fallback font on macOS if the config specified font family isn't found.
2019-06-09Fix compiler warningsMatthias Krüger
2019-06-08Bump minimum supported Rust version to 1.32.0Christian Duerr
2019-04-23Add DirectWrite font rasterizerBen Pye
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-20Fix cursor colorsChristian Duerr
This fixes a recent regression in cfc20d4f34dca535654cc32df18e785296af4cc5 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-19Fix cursor dimensions with font offsetChristian Duerr
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-14Fix duplicate resize eventsChristian Duerr
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-09Set maximum Rust version to 1.31.0Christian Duerr
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-03Bump dependenciesChristian Duerr
2019-04-01Revert daemon removalChristian Duerr
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-03-30Add rustfmt style guidev0.3.0-rc1Christian Duerr
2019-02-04Remove library lockfiles from gitChristian Duerr
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-01-20Fix crash on Windows (#2021)Christian Duerr
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-07Normalize Log Message StringsNathan Lilienthal
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".
2018-12-31Fix line metricsChristian Duerr
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-22Add proper underline and strikeout supportChristian Duerr
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-10Upgrade to Rust 2018Joe Wilm
This resolves a lot of NLL issues, however full NLL will be necessary to handle a couple of remaining issues.
2018-12-07Use tool lints for clippy allow/deny lint attributesMatthias Krüger
2018-11-10Upgrade Glutin to v0.19.0Matt Keeler
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-04Fix clippy issuesChristian Duerr
This resolves all existing clippy issues and removes some old `allow` annotations which aren't neccesary anymore.
2018-10-20Add support for rendering cursors to rusttypeZac Pullar-Strecker
2018-10-16Add support for Windows (#1374)Zac Pullar-Strecker
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-09-30Bump fontconfig dependenciesJon Gjengset
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-19Update core-* dependenciesJeff Muizelaar
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-17Fix style issuesMatthias Krüger
2018-07-25Fix clippy lints and run font tests on travisMatthias Krüger
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-21Add support for LCD-V pixel modeyshui
2018-07-02Enable clippy in font/copypasta cratesMatthias Krüger
Enabled clippy in the sub-crates font and copypasta. All issues that were discovered by this change have also been fixed.
2018-07-01Fix clippy issuesChristian Duerr
2018-06-17Move to cargo clippyChristian Duerr
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-02-07fix fallbacks in macos (#1099)Joe Moon
fixes #1086