Skip to content
Permalink
Browse files

Update harfbuzz to 0.3

`hb_font_funcs_set_glyph_h_kerning_func` is gone but I couldn't find any
replacement. Kerning tests are passing and kerning seems fine on my
computer so I guess it's useless now ?
  • Loading branch information...
Eijebong committed Apr 27, 2019
1 parent af077f8 commit 6ced81cbf06730b3b4250915e0f2ccb1163b7009

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -23,7 +23,7 @@ euclid = "0.19"
fnv = "1.0"
fontsan = {git = "https://github.com/servo/fontsan"}
gfx_traits = {path = "../gfx_traits"}
harfbuzz-sys = "0.2"
harfbuzz-sys = "0.3"
ipc-channel = "0.11"
lazy_static = "1"
libc = "0.2"
@@ -41,7 +41,7 @@ smallvec = { version = "0.6", features = ["std", "union"] }
style = {path = "../style", features = ["servo"]}
time = "0.1.12"
unicode-bidi = {version = "0.3", features = ["with_serde"]}
unicode-script = {version = "0.2", features = ["harfbuzz"]}
unicode-script = {version = "0.3", features = ["harfbuzz"]}
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
xi-unicode = "0.1.0"
ucd = "0.1.1"
@@ -24,7 +24,6 @@ use harfbuzz_sys::hb_feature_t;
use harfbuzz_sys::hb_font_create;
use harfbuzz_sys::hb_font_funcs_create;
use harfbuzz_sys::hb_font_funcs_set_glyph_h_advance_func;
use harfbuzz_sys::hb_font_funcs_set_glyph_h_kerning_func;
use harfbuzz_sys::hb_font_funcs_set_nominal_glyph_func;
use harfbuzz_sys::hb_font_set_funcs;
use harfbuzz_sys::hb_font_set_ppem;
@@ -459,12 +458,6 @@ lazy_static! {
ptr::null_mut(),
None,
);
hb_font_funcs_set_glyph_h_kerning_func(
hb_funcs,
Some(glyph_h_kerning_func),
ptr::null_mut(),
None,
);

FontFuncs(hb_funcs)
};
@@ -519,22 +512,6 @@ fn glyph_space_advance(font: *const Font) -> (hb_codepoint_t, f64) {
(space_glyph, space_advance)
}

extern "C" fn glyph_h_kerning_func(
_: *mut hb_font_t,
font_data: *mut c_void,
first_glyph: hb_codepoint_t,
second_glyph: hb_codepoint_t,
_: *mut c_void,
) -> hb_position_t {
let font: *mut Font = font_data as *mut Font;
assert!(!font.is_null());

unsafe {
let advance = (*font).glyph_h_kerning(first_glyph as GlyphId, second_glyph as GlyphId);
Shaper::float_to_fixed(advance)
}
}

// Callback to get a font table out of a font.
extern "C" fn font_table_func(
_: *mut hb_face_t,
@@ -51,7 +51,7 @@ smallvec = { version = "0.6", features = ["std", "union"] }
style = {path = "../style", features = ["servo"]}
style_traits = {path = "../style_traits"}
unicode-bidi = {version = "0.3", features = ["with_serde"]}
unicode-script = {version = "0.2", features = ["harfbuzz"]}
unicode-script = {version = "0.3", features = ["harfbuzz"]}
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
xi-unicode = "0.1.0"

@@ -0,0 +1,4 @@
[word-break-break-all-005.html]
type: reftest
expected:
if os == "linux": FAIL

0 comments on commit 6ced81c

Please sign in to comment.
You can’t perform that action at this time.