Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport to 7.0.0 #112

Merged
merged 63 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
2fd3119
[paint-extents] Start out
LaurenzV Jun 18, 2024
45b174a
Rename `GlyphExtents`
LaurenzV Jun 18, 2024
5c45cbc
[paint-extents] Flesh out some more
LaurenzV Jun 18, 2024
07f580b
[paint-extents] Flesh out more
LaurenzV Jun 18, 2024
d6dcbab
[paint-extents] More
LaurenzV Jun 18, 2024
ff7dedb
[paint-extend] More
LaurenzV Jun 19, 2024
3d11b02
[paint-extents] Finish off
LaurenzV Jun 19, 2024
42997cc
Get outline extents manually
LaurenzV Jun 19, 2024
76a8448
Skip empty outlines
LaurenzV Jun 19, 2024
38abbfc
[paint-extents] Better handle empty glyphs
LaurenzV Jun 19, 2024
20aee83
[colr] Return true extents
LaurenzV Jun 19, 2024
2528930
[paint-extents] Clean up
LaurenzV Jun 19, 2024
c976b14
[paint-extents] Streamline extents_t
LaurenzV Jun 19, 2024
1fb0e9c
[paint-extents] Streamline extents_t more
LaurenzV Jun 19, 2024
66aa92c
Fix two bugs
LaurenzV Jun 19, 2024
dbd77e6
Add a comment
LaurenzV Jun 19, 2024
893b108
Align the way composite modes are handled with harfbuzz
LaurenzV Jun 19, 2024
57573b0
[paint-extents] Refactor code
LaurenzV Jun 19, 2024
f6cde01
[paint-extents] Minor refactor
LaurenzV Jun 19, 2024
abfa07e
[paint-extents] Comments
LaurenzV Jun 19, 2024
9acf4c5
[paint-extents] Rename variable
LaurenzV Jun 19, 2024
4c3e8ff
Reformat
LaurenzV Jun 19, 2024
4f787cb
Regenerate MacOS tests by default
LaurenzV Jun 22, 2024
b556f7b
Add aat_apply_context struct
LaurenzV Jun 22, 2024
ca7d06f
Rename kern method
LaurenzV Jun 22, 2024
4a5c3d0
Revert "Revert "[aat] Support feature ranges""
LaurenzV Jun 22, 2024
88af35f
[aat] Always generate a feature range
LaurenzV Jun 23, 2024
731bea5
Add wrapper struct for range_flags
LaurenzV Jun 23, 2024
e94db57
[aat] Support ranges in NonContextual subtable as well
LaurenzV Jun 23, 2024
21f411a
[aat] Run subtable across ranges if flags match
LaurenzV Jun 23, 2024
01e8bf2
Fix bug in chain flag handling
LaurenzV Jun 23, 2024
2200962
[aat] Always unsafe-to-concat in state machine
LaurenzV Jun 23, 2024
0230ed4
[aat] Add test for feature range
LaurenzV Jun 23, 2024
6c27db0
Fix no-std build
LaurenzV Jun 23, 2024
68a4d8f
Fix wrong index number
LaurenzV Jun 23, 2024
c19009f
Fix test
LaurenzV Jun 23, 2024
04aa35d
[aat] Optimize feature application
LaurenzV Jun 23, 2024
67d1305
[aat] Comment
LaurenzV Jun 23, 2024
5f31ac9
[aat] Reduce unsafe_to_concat calls
LaurenzV Jun 23, 2024
02bdf77
[aat] Initialize values
LaurenzV Jun 23, 2024
26253db
[aat] Adjust last range
LaurenzV Jun 23, 2024
8212c27
[test] Remove non-free font and its test
LaurenzV Jun 23, 2024
02bd28a
[COLRv1] Don't return extents if glyph has no paint
LaurenzV Jun 23, 2024
fe2c32f
[COLRv1] Handle void extents
LaurenzV Jun 23, 2024
d801e26
Format and update
LaurenzV Jun 23, 2024
93da57d
[layout] Limit how far we skip when looking back
LaurenzV Jun 23, 2024
b1cf36c
Align may_skip with harfbuzz
LaurenzV Jun 23, 2024
45fac1a
Align may_match with harfbuzz
LaurenzV Jun 23, 2024
971c605
Format
LaurenzV Jun 23, 2024
3c40468
[gsubgpos] Refactor skippy_iter.match()
LaurenzV Jun 23, 2024
247ae8a
Revert "[layout] Limit how far we skip when looking back"
LaurenzV Jun 23, 2024
5fec008
Rename functions
LaurenzV Jun 24, 2024
8527e46
Remove ExtentBuilder
LaurenzV Jun 24, 2024
500bfe9
Wrap expression in parenthesis
LaurenzV Jun 24, 2024
69165f3
[GPOS] Avoid O(n^2) behavior in mark-attachment
LaurenzV Jun 24, 2024
03dbc1c
[buffer] Optimize _infos_find_min_cluster for monotone clusters
LaurenzV Jun 24, 2024
0d50d88
Reformat
LaurenzV Jun 24, 2024
74ea8a2
Align _info_set_glyph_flags with harfbuzz
LaurenzV Jun 24, 2024
717fc1f
[buffer] Optimize _infos_set_glyph_flags to avoid O(n^2) behavior
LaurenzV Jun 24, 2024
72da8c7
[buffer] Speed up merge_clusters_impl
LaurenzV Jun 24, 2024
c5bd096
[GPOS] Fix assert fail introduced recently
LaurenzV Jun 24, 2024
d0701af
Rename `match` again
LaurenzV Jun 24, 2024
b1cecba
Remove dead code
LaurenzV Jun 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/gen-shaping-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# There is no sane way to test them.
IGNORE_TESTS = [
# Disable this if you are on a Mac and want to update the macos tests.
'macos.tests',
# 'macos.tests',
'coretext.tests',
'directwrite.tests',
'uniscribe.tests',
Expand Down
3 changes: 3 additions & 0 deletions scripts/macos.tests
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,6 @@

# 12.3
/System/Library/Fonts/Apple Color Emoji.ttc@8fa6ac4564651899da0b37d310d980db4de967d6;--font-funcs ot;1FAF1,1F3FF,200D,1FAF2,1F3FC;[u1FAF1.5.L=0+800|u1FAF2.2.R=0@-800,0+0]

# https://github.com/harfbuzz/harfbuzz/issues/4020
/System/Library/Fonts/LucidaGrande.ttc;--features=-liga[3:5];U+0066,U+0066,U+0020,U+0066,U+0066,U+0066,U+0020,U+0066,U+0066;[ff=0+1443|space=2+648|f=3+753|f=4+753|f=5+753|space=6+648|ff=7+1443]
17 changes: 15 additions & 2 deletions src/hb/aat_layout.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#![allow(dead_code)]

use super::buffer::{hb_buffer_t, hb_glyph_info_t};
use super::hb_font_t;
use super::hb_tag_t;
use super::ot_shape_plan::hb_ot_shape_plan_t;
use super::{aat_layout_kerx_table, aat_layout_morx_table, aat_layout_trak_table};
use super::{aat_map, hb_font_t};
use crate::hb::aat_layout_common::hb_aat_apply_context_t;

pub type hb_aat_layout_feature_type_t = u8;
pub const HB_AAT_LAYOUT_FEATURE_TYPE_INVALID: u8 = 0xFF;
Expand Down Expand Up @@ -495,7 +496,19 @@ pub fn hb_aat_layout_substitute(
face: &hb_font_t,
buffer: &mut hb_buffer_t,
) {
aat_layout_morx_table::apply(plan, face, buffer);
let mut builder = aat_map::hb_aat_map_builder_t::default();

for feature in &plan.user_features {
builder.add_feature(face, feature);
}

let mut aat_map = aat_map::hb_aat_map_t::default();
if plan.apply_morx {
builder.compile(face, &mut aat_map);
}

let mut c = hb_aat_apply_context_t::new(plan, face, buffer);
aat_layout_morx_table::apply(&mut c, &mut aat_map);
}

pub fn hb_aat_layout_zero_width_deleted_glyphs(buffer: &mut hb_buffer_t) {
Expand Down
29 changes: 29 additions & 0 deletions src/hb/aat_layout_common.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use crate::hb::aat_map::range_flags_t;
use crate::hb::buffer::hb_buffer_t;
use crate::hb::face::hb_font_t;
use crate::hb::hb_mask_t;
use crate::hb::ot_shape_plan::hb_ot_shape_plan_t;

pub struct hb_aat_apply_context_t<'a> {
pub plan: &'a hb_ot_shape_plan_t,
pub face: &'a hb_font_t<'a>,
pub buffer: &'a mut hb_buffer_t,
pub range_flags: Option<&'a mut [range_flags_t]>,
pub subtable_flags: hb_mask_t,
}

impl<'a> hb_aat_apply_context_t<'a> {
pub fn new(
plan: &'a hb_ot_shape_plan_t,
face: &'a hb_font_t<'a>,
buffer: &'a mut hb_buffer_t,
) -> Self {
Self {
plan,
face,
buffer,
range_flags: None,
subtable_flags: 0,
}
}
}
2 changes: 2 additions & 0 deletions src/hb/aat_layout_kerx_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ pub(crate) fn apply(
face: &hb_font_t,
buffer: &mut hb_buffer_t,
) -> Option<()> {
buffer.unsafe_to_concat(None, None);

let mut seen_cross_stream = false;
for subtable in face.tables().kerx?.subtables {
if subtable.variable {
Expand Down
Loading