aboutsummaryrefslogtreecommitdiff
path: root/src/text.rs
Commit message (Collapse)AuthorAge
* Add support for macOSJoe Wilm2016-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alacritty now runs on macOS using CoreText for font rendering. The font rendering subsystems were moved into a separate crate called `font`. The font crate provides a unified (albeit limited) API which wraps CoreText on macOS and FreeType/FontConfig on other platforms. The unified API differed slightly from what the original Rasterizer for freetype implemented, and it was updated accordingly. The cell separation properties (sep_x and sep_y) are now premultiplied into the cell width and height. They were previously passed through as uniforms to the shaders; removing them prevents a lot of redundant work. `libc` has some differences between Linux and macOS. `__errno_location` is not available on macOS, and the `errno` crate was brought in to provide a cross-platform API for dealing with errno. Differences in `openpty` were handled by implementing a macOS specific version. It would be worth investigating a way to unify the implementations at some point. A type mismatch with TIOCSCTTY was resolved with a cast. Differences in libc::passwd struct fields were resolved by using std::mem::uninitialized instead of zeroing the struct ourselves. This has the benefit of being much cleaner. The thread setup had to be changed to support both macOS and Linux. macOS requires that events from the window be handled on the main thread. Failure to do so will prevent the glutin window from even showing up! For this reason, the renderer and parser were moved to their own thread, and the input is received on the main thread. This is essentially reverse the setup prior to this commit. Renderer initialization (and thus font cache initialization) had to be moved to the rendering thread as well since there's no way to make_context(null) with glx on Linux. Trying to just call make_context a second time on the rendering thread had resulted in a panic!.
* Optimize renderingJoe Wilm2016-06-04
| | | | | | | | This moves some logic that was previously being done per-character into the vertex shader. At this time, we've traded CPU computation for additional gl::Uniform2f calls. This is only a marginal improvement. However, this patch positions the renderer well for instanced drawing, and that will be a huge performance win.
* Remove old debug "test"Joe Wilm2016-05-28
| | | | | It wasn't actually a test, it was a crappy ascii renderer to show freetype rendered glyphs.
* Add render time meterJoe Wilm2016-05-21
| | | | Optimization is impossible without measurement!
* Correct sub-pixel font rendering with OpenGLJoe Wilm2016-05-20
| | | | | | | | | Uses the GL_ARB_blend_func_extended to get single-pass, per-channel alpha blending. gl_generator is now used instead of gl to enable the extension. The background color is removed since that presumably needs to run in a separate pass.
* Use subpixel font renderingJoe Wilm2016-04-11
| | | | | | | OpenGL only supports shared alpha blending. Subpixel font rendering requires using the font RGB values as alpha masks for the corresponding RGB channels. To support this, blending is implemented in the fragment shader.
* Add a GridJoe Wilm2016-04-10
| | | | | | | | The grid holds the state of the terminal with row-major ordering. Eventually, the grid::Cell type will hold other attributes such as color, background color, decorations, and weight. An initialization list is added for common ASCII symbols.
* Rasterizer uses DPI from GlutinJoe Wilm2016-02-27
|
* Font no longer hardcoded in get_glyphJoe Wilm2016-02-27
|
* Add support for multiple font faces in rasterizerJoe Wilm2016-02-27
|
* Fix some compiler warningsJoe Wilm2016-02-25
|
* Render the letter JJoe Wilm2016-02-23
| | | | This letter brought to you by OpenGL and freetype.
* Implement very basic glyph rasterizationJoe Wilm2016-02-21
There are several assumptions made at this point and very little (no) error handling done.