-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Tests #14
Tests #14
Conversation
I thought I had kept the code consistently formatted, but that appears to have not been the case. I'm going to go ahead and push a mass formatting commit to remove all the noise from the PR. It seems that a lot of the failures may be due to missing script information. I'll address that in a review in a moment. |
Yep, I've applied those. The remaining fails appear to be legitimate bugs, some bug on my part with runs, another bug on my part with opening the font, and the aforementioned issue where it doesn't seem to "merge" certain glyphs (referenced up above). I'm not sure if the last problem is just because I'm missing something in the test harness implementation. |
Some of these are tests of ancient unused cmap formats that I'm unlikely to support. There also appear to be tests that should probably pass but are missing glyph names for some reason. A couple are showing a y-offset that doesn't match. |
I (painfully) manually went through the failing tests, and there appear to be only 134 legitimate ones. Some may still be errors on my part, such as off by one errors (possibly rounding), but I included them just in case. Notably, |
Do you want to disable |
With the tests I've disabled, the ratio is now 361:148. 108 are the errors I noted as being legitimate. Pretty good! By the way, I included glyph name issues as legitimate errors as well, so the actual number of "legitimate" errors may be significantly lower, possibly ~30 less. |
If HarfBuzz isn't testing against it, then probably best to remove it for now. |
This looks great so far! Thanks so much for taking the time. |
Of note: #[test]
fn morx_24_0() {
assert_eq!(
shape("fonts/TestMORXTwentyfour.ttf", 0, &[], "ABCDE"),
"*"
)
} seems to cause an endless loop. I've disabled it for now. |
So the The The |
So I think for the rounding errors, what I think we could do is use a tuple struct over the vec used in |
Agreed with rounding errors. I'd rather leave them in for the moment to make sure they're not errors in the lookups. |
So for RTL runs, it looks like it has the proper glyph order but incorrect offsets. This is going to be tricky because HarfBuzz simply handles this differently. It does a full logical reverse of the glyph buffer and provides appropriate offsets (so marks precede bases). The swash shaper maintains logical order and provides per-cluster mark offsets with the intention that clusters will be reversed but not glyphs. There is a mapping between the two but I can't think of a trivial change to the |
Some fixes pushed to master should correct the failed font loading in the gvar tests. I believe adding |
Co-authored-by: Chad Brokaw <cbrokaw@gmail.com>
Co-authored-by: Chad Brokaw <cbrokaw@gmail.com>
* support up to 256 features per stage * only apply nested contextual lookup to specified index
* Return success from matching contextual subtables regardless of nested lookup results
* Push potentially intermediate ligatures back onto stack in ligature subtable * Handle END_OF_TEXT in insertion subtable * Correct advance count in insertion subtable
... I'm going to create a new PR, I have no idea what happened. |
cc @dfrg
I'm having some trouble with a few tests, so could you possibly take a look at what I need to do? I'll also take a look myself tomorrow. The results should be in the CI. I would guess around 200-300 of the fails are because of this:
[uni1A45|uni1A32@592,0|uni1A5B.ratha_nohost@1523,0|uni1A69@1523,0]
versus
[uni1A45|uni1A321A5B@592,0|uni1A69@1184,-734]
but I'm not sure how to do this.
(The code is very terrible right now, it'll be much better by merging time).
Generator:
```rs use std::{ fmt::{self, Display}, fs::File, io::{BufWriter, Write}, mem, path::PathBuf, };
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct ParseError;
impl fmt::Display for ParseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "missing closing quote")
}
}
impl std::error::Error for ParseError {}
enum State {
/// Within a delimiter.
Delimiter,
/// After backslash, but before starting word.
Backslash,
/// Within an unquoted word.
Unquoted,
/// After backslash in an unquoted word.
UnquotedBackslash,
/// Within a single quoted word.
SingleQuoted,
/// Within a double quoted word.
DoubleQuoted,
/// After backslash inside a double quoted word.
DoubleQuotedBackslash,
/// Inside a comment.
Comment,
InPath,
}
pub fn split(s: &str) -> Result<Vec, ParseError> {
use State::*;
}
#[derive(Default, Debug)]
struct TestCase {
name: String,
path: PathBuf,
font_size: usize,
features: Vec<(String, u16)>,
variations: Vec<(String, f32)>,
input: Vec,
output: Vec,
}
impl Display for TestCase {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
if self.output.contains(&"*".to_string()) {
write!(
f,
"create_test!({}, {:?}, {}, &{:?}, &{:?}, &{:?});",
self.name,
self.path.to_str().unwrap(),
self.font_size,
self.features,
self.variations,
self.input,
)
} else {
write!(
f,
"create_test!({}, {:?}, {}, &{:?}, &{:?}, &{:?}, &{:?});",
self.name,
self.path.to_str().unwrap(),
self.font_size,
self.features,
self.variations,
self.input,
self.output,
)
}
}
}
impl TestCase {
pub fn parse(arguments: Vec) -> Self {
let mut case = Self::default();
case.font_size = 75;
}
fn main() -> std::io::Result<()> {
let input = PathBuf::from("data");
let output = PathBuf::from("output");
let rendering_tests = input.join("text-rendering-tests");
let aot_tests = input.join("aots");
let inhouse_tests = input.join("in-house");
std::fs::create_dir_all(output.clone())?;
}