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

Return a font's example text #12

Merged
merged 6 commits into from
Sep 7, 2020
Merged

Return a font's example text #12

merged 6 commits into from
Sep 7, 2020

Conversation

RoelN
Copy link
Contributor

@RoelN RoelN commented Sep 2, 2020

Based on #9, merge that first

@RoelN RoelN requested a review from pascalw September 2, 2020 13:40
@RoelN
Copy link
Contributor Author

RoelN commented Sep 2, 2020

@pascalw Is this worth adding a test for?

@pascalw
Copy link
Contributor

pascalw commented Sep 2, 2020

Yeah I would add a test for this. Should take a few minutes only and could prevent surprises down the road.

src/fondue/Fondue.js Outdated Show resolved Hide resolved
@RoelN
Copy link
Contributor Author

RoelN commented Sep 3, 2020

Need to add a test font with a custom text first, these are quite rare 😆

@pascalw
Copy link
Contributor

pascalw commented Sep 4, 2020

Ok well if it that's difficult I'm not opposed to not covering it.

@RoelN
Copy link
Contributor Author

RoelN commented Sep 4, 2020

@pascalw Added a name table entry to our test font anyway. Then found out Font.js does indeed return strings intermixed with x00 bytes. I'm now stripping them out on our side, until Pomax/lib-font#74 is addressed.

Will fix the conflict after #9 is merged.

@RoelN RoelN changed the base branch from master to fix/langtags September 4, 2020 08:41
@RoelN RoelN changed the base branch from fix/langtags to master September 4, 2020 08:41
@pascalw
Copy link
Contributor

pascalw commented Sep 4, 2020

Nice catch @RoelN !

@@ -6,8 +6,10 @@ const otfFont = async () => {
);
};

const ttfFont = async () => {
return await loadFondue("./test/fixtures/letterA/letterA.ttf");
const WhatCanThisFontDo = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hurts readability of the tests a bit IMO. All the fixture helpers refer to the kind of font, which is usually important for the tests. WhatCanThisFontDo doesn't say anything about the kind of font?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to put several testable things inside this font, ranging from metadata to glyph count, and in the future OT features, etc. So I'd like to emphasize it's a versatile test font. Perhaps simply WFTestFont? The readme contains details about exactly what this font does and how it can be used for testing?

I'll change it to that for now (agreed that WhatCanThisFontDo is more cute than informative) and we can improve it during future changes.

@RoelN RoelN merged commit 43f2802 into master Sep 7, 2020
@RoelN RoelN deleted the exampletext branch September 7, 2020 11:28
@RoelN RoelN restored the exampletext branch September 7, 2020 11:28
@RoelN RoelN deleted the exampletext branch September 7, 2020 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants