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

[fea-rs] Fix typo bug in BaseScriptList #1006

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 fea-rs/src/token_tree/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ impl BaseScriptList {
fn is_horiz(&self) -> bool {
match self.iter().next().map(|t| t.kind()) {
Some(Kind::HorizAxisBaseScriptListKw) => true,
Some(Kind::VertAxisBaseTagListKw) => false,
Some(Kind::VertAxisBaseScriptListKw) => false,
other => panic!("unexpected token in BaseScriptList {:?}", other),
}
}
Expand Down
9 changes: 9 additions & 0 deletions fea-rs/test-data/compile-tests/mini-latin/good/base_table.fea
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# from wavefront: https://github.com/dy/wavefont/blob/b05a72e03358ddc/sources/Wavefont-wdflt%2Crmax%2Camax.ufo/features.fea#L3
table BASE {
HorizAxis.BaseTagList ideo;
HorizAxis.BaseScriptList DFLT ideo 0;

VertAxis.BaseTagList ideo;
VertAxis.BaseScriptList DFLT ideo 1;
} BASE;

52 changes: 52 additions & 0 deletions fea-rs/test-data/compile-tests/mini-latin/good/base_table.ttx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<ttFont>

<BASE>
<Version value="0x00010000"/>
<HorizAxis>
<BaseTagList>
<!-- BaseTagCount=1 -->
<BaselineTag index="0" value="ideo"/>
</BaseTagList>
<BaseScriptList>
<!-- BaseScriptCount=1 -->
<BaseScriptRecord index="0">
<BaseScriptTag value="DFLT"/>
<BaseScript>
<BaseValues>
<DefaultIndex value="0"/>
<!-- BaseCoordCount=1 -->
<BaseCoord index="0" Format="1">
<Coordinate value="0"/>
</BaseCoord>
</BaseValues>
<!-- BaseLangSysCount=0 -->
</BaseScript>
</BaseScriptRecord>
</BaseScriptList>
</HorizAxis>
<VertAxis>
<BaseTagList>
<!-- BaseTagCount=1 -->
<BaselineTag index="0" value="ideo"/>
</BaseTagList>
<BaseScriptList>
<!-- BaseScriptCount=1 -->
<BaseScriptRecord index="0">
<BaseScriptTag value="DFLT"/>
<BaseScript>
<BaseValues>
<DefaultIndex value="0"/>
<!-- BaseCoordCount=1 -->
<BaseCoord index="0" Format="1">
<Coordinate value="1"/>
</BaseCoord>
</BaseValues>
<!-- BaseLangSysCount=0 -->
</BaseScript>
</BaseScriptRecord>
</BaseScriptList>
</VertAxis>
</BASE>

</ttFont>
Loading