gfx: Implement letter-spacing per CSS 2.1 § 16.4.

The ligature disabling code has been manually verified, but I was unable
to reftest it. (The only way I could think of would be to create an
Ahem-like font with a ligature table, but that would be an awful lot of
work.)

Near as I can tell, the method used to apply the spacing (manually
inserting extra advance post-shaping) matches Gecko.
This commit is contained in:
Patrick Walton 2014-12-10 14:00:12 -08:00
parent 758d79fff4
commit 07bc97e3e2
11 changed files with 246 additions and 47 deletions

View file

@ -7,6 +7,7 @@
//!
//! Currently, only harfbuzz bindings are implemented.
use font::ShapingOptions;
use text::glyph::GlyphStore;
pub use text::shaping::harfbuzz::Shaper;
@ -14,6 +15,6 @@ pub use text::shaping::harfbuzz::Shaper;
pub mod harfbuzz;
pub trait ShaperMethods {
fn shape_text(&self, text: &str, glyphs: &mut GlyphStore);
fn shape_text(&self, text: &str, options: &ShapingOptions, glyphs: &mut GlyphStore);
}