-
-
Notifications
You must be signed in to change notification settings - Fork 72
Allow invalid coverage tables. #476
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added
BIN
+165 KB
tests/SixLabors.Fonts.Tests/Fonts/SofiaSansCondensed-ExtraLight-Regular.ttf
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // Copyright (c) Six Labors. | ||
| // Licensed under the Six Labors Split License. | ||
|
|
||
| using System.Text; | ||
|
|
||
| namespace SixLabors.Fonts.Tests.Issues; | ||
|
|
||
| public class Issues_468 | ||
| { | ||
| [Fact] | ||
| public void TestIssue_468() | ||
JimBobSquarePants marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| StringBuilder stringBuilder = new(); | ||
| stringBuilder | ||
| .AppendLine("Latin: The quick brown fox jumps over the lazy dog.") | ||
| .AppendLine("Arabic (RTL & Shaping): نص حكيم له سر قاطع وذو شأن عظيم"); | ||
|
|
||
| string text = stringBuilder.ToString(); | ||
| FontCollection fontCollection = new(); | ||
|
|
||
| string consola = fontCollection.Add(TestFonts.Consola).Name; | ||
| string arabic = fontCollection.Add(TestFonts.NotoSansArabicRegular).Name; | ||
|
|
||
| FontFamily mainFontFamily = fontCollection.Get(consola); | ||
| Font mainFont = mainFontFamily.CreateFont(50, FontStyle.Regular); | ||
|
|
||
| TextOptions options = new(mainFont) | ||
| { | ||
| FallbackFontFamilies = | ||
| [ | ||
| fontCollection.Get(arabic), | ||
| ], | ||
| }; | ||
|
|
||
| // There are too many metrics to validate here so we just ensure no exceptions are thrown | ||
| // and the rendering looks correct by inspecting the snapshot. | ||
| TextLayoutTestUtilities.TestLayout( | ||
| text, | ||
| options, | ||
| includeGeometry: false); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // Copyright (c) Six Labors. | ||
| // Licensed under the Six Labors Split License. | ||
|
|
||
| using System.Text; | ||
|
|
||
| namespace SixLabors.Fonts.Tests.Issues; | ||
|
|
||
| public class Issues_470 | ||
| { | ||
| [Fact] | ||
| public void Test_Issue_470() | ||
JimBobSquarePants marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| StringBuilder stringBuilder = new(); | ||
| stringBuilder.AppendLine("Latin: The quick brown fox jumps over the lazy dog.") | ||
| .AppendLine("Cyrillic: Съешь же ещё этих мягких французских булок.") | ||
| .AppendLine("Greek: Ζαφείρι δέξου πάγκαλο, βαθῶν ψυχῆς τὸ σῆμα.") | ||
| .AppendLine("Chinese: 敏捷的棕色狐狸跳过了懒狗") | ||
| .AppendLine("Japanese: いろはにほへと ちりぬるを") | ||
| .AppendLine("Korean: 다람쥐 헌 쳇바퀴에 타고파") | ||
| .AppendLine("Arabic (RTL & Shaping): نص حكيم له سر قاطع وذو شأن عظيم") | ||
| .AppendLine("Hebrew (RTL): דג סקרן שט בים מאוכזב ולפתע מצא חברה") | ||
| .AppendLine("Thai (Complex): เป็นมนุษย์สุดประเสริฐเลิศคุณค่า") | ||
| .AppendLine("Devanagari (Conjuncts): ऋषियों को सताने वाले राक्षसों का अंत हो गया"); | ||
|
|
||
| string text = stringBuilder.ToString(); | ||
|
|
||
| FontCollection fontCollection = new(); | ||
| string arial = fontCollection.Add(TestFonts.Arial).Name; | ||
| string sofia = fontCollection.Add(TestFonts.SofiaSansCondensedLight).Name; | ||
|
|
||
| FontFamily mainFontFamily = fontCollection.Get(arial); | ||
| Font mainFont = mainFontFamily.CreateFont(30, FontStyle.Regular); | ||
|
|
||
| TextOptions options = new(mainFont) | ||
| { | ||
| FallbackFontFamilies = | ||
| [ | ||
| fontCollection.Get(sofia), | ||
| ], | ||
| }; | ||
|
|
||
| // There are too many metrics to validate here so we just ensure no exceptions are thrown | ||
| // and the rendering looks correct by inspecting the snapshot. | ||
| TextLayoutTestUtilities.TestLayout( | ||
| text, | ||
| options, | ||
| includeGeometry: false); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.