Skip to content

Commit

Permalink
0.1.0-pre8.1 and 0.1.0-pre8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Happypig375 committed Aug 26, 2018
1 parent 427b061 commit c367476
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 24 deletions.
4 changes: 2 additions & 2 deletions CSharpMath.Forms/CSharpMath.Forms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<GeneratePackageOnBuild Condition="'$(Configuration)' == 'Release'">true</GeneratePackageOnBuild>
<PackageVersion>0.1.0-pre8</PackageVersion>
<PackageVersion>0.1.0-pre8.2</PackageVersion>
<Authors>CSharpMath Contributors (verybadcat, Happypig375, charlesroddie, FoggyFinder)</Authors>
<PackageReleaseNotes>The 0.1.0 SkiaSharp Update brings the SkiaSharp and Xamarin.Forms front ends to CSharpMath.</PackageReleaseNotes>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/verybadcat/CSharpMath.git</RepositoryUrl>
<RepositoryBranch>master</RepositoryBranch>
<RepositoryCommit>ab4da5b730a4cbd5667a66f6af33ccd3ce136fae</RepositoryCommit>
<RepositoryCommit>427b0615080dd2a85da3ae676088f7b48a38a8c7</RepositoryCommit>
<PackageProjectUrl>https://github.com/verybadcat/CSharpMath</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseUrl>https://github.com/verybadcat/CSharpMath/blob/master/LICENSE</PackageLicenseUrl>
Expand Down
4 changes: 2 additions & 2 deletions CSharpMath.Ios/CSharpMath.Ios.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<NuGetPackageImportStamp></NuGetPackageImportStamp>
<PackOnBuild>true</PackOnBuild>
<PackageId>CSharpMath.Ios</PackageId>
<PackageVersion>0.1.0-pre8</PackageVersion>
<PackageVersion>0.1.0-pre8.2</PackageVersion>
<Authors>CSharpMath Contributors (verybadcat, Happypig375, charlesroddie, FoggyFinder)</Authors>
<NeutralLanguage>en</NeutralLanguage>
<PackageLicenseUrl>https://github.com/verybadcat/CSharpMath/blob/master/LICENSE</PackageLicenseUrl>
Expand All @@ -28,7 +28,7 @@
<RepositoryUrl>https://github.com/verybadcat/CSharpMath.git</RepositoryUrl>
<GeneratePackageOnBuild Condition="'$(Configuration)' == 'Release'">true</GeneratePackageOnBuild>
<RepositoryBranch>master</RepositoryBranch>
<RepositoryCommit>ab4da5b730a4cbd5667a66f6af33ccd3ce136fae</RepositoryCommit>
<RepositoryCommit>427b0615080dd2a85da3ae676088f7b48a38a8c7</RepositoryCommit>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageIconUrl>https://raw.githubusercontent.com/verybadcat/CSharpMath/master/Icon.png</PackageIconUrl>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions CSharpMath.Rendering/CSharpMath.Rendering.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!--NuGet Properties-->
<PackOnBuild>true</PackOnBuild>
<PackageId>CSharpMath.Rendering</PackageId>
<PackageVersion>0.1.0-pre8</PackageVersion>
<PackageVersion>0.1.0-pre8.2</PackageVersion>
<Authors>CSharpMath Contributors (verybadcat, Happypig375, charlesroddie, FoggyFinder)</Authors>
<PackageLicenseUrl>https://github.com/verybadcat/CSharpMath/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/verybadcat/CSharpMath</PackageProjectUrl>
Expand All @@ -24,7 +24,7 @@
<GeneratePackageOnBuild Condition="'$(Configuration)' == 'Release'">true</GeneratePackageOnBuild>
<RepositoryUrl>https://github.com/verybadcat/CSharpMath.git</RepositoryUrl>
<RepositoryBranch>master</RepositoryBranch>
<RepositoryCommit>ab4da5b730a4cbd5667a66f6af33ccd3ce136fae</RepositoryCommit>
<RepositoryCommit>427b0615080dd2a85da3ae676088f7b48a38a8c7</RepositoryCommit>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageIconUrl>https://raw.githubusercontent.com/verybadcat/CSharpMath/master/Icon.png</PackageIconUrl>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion CSharpMath.Rendering/Text/TextBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Result CheckDollarCount() {
var (startAt, endAt, endingChar, wordKind) = ObtainRange(i);
bool SetNextRange() {
bool success = ++i < breakList.Count;
if(success) (startAt, endAt, endingChar, wordKind) = ObtainRange(++i);
if(success) (startAt, endAt, endingChar, wordKind) = ObtainRange(i);
return success;
}
Result<string> ReadArgument() {
Expand Down
17 changes: 11 additions & 6 deletions CSharpMath.Rendering/Text/TextLayoutter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace CSharpMath.Rendering {
using Display;
using Enumerations;
using Displays = Display.MathListDisplay<Fonts, Glyph>;
using static Typography.OpenFont.Extensions.TypefaceExtensions;

public static class TextLayoutter {
public static (Displays relative, Displays absolute) Layout(TextAtom input, Fonts inputFont, float canvasWidth) {
Expand Down Expand Up @@ -61,7 +62,7 @@ void AddDisplaysWithLineBreaks(TextAtom atom, Fonts fonts,
displayMathList.Add(display);
break;

void FinalizeInlineDisplay(float ascentMin = 0, bool forbidAtLineStart = false) {
void FinalizeInlineDisplay(float ascentMin, bool forbidAtLineStart = false) {
if (color != null) display.SetTextColorRecursive(color);
if (line.Width + display.Width > canvasWidth && !forbidAtLineStart)
BreakLine(displayList);
Expand All @@ -73,7 +74,7 @@ void FinalizeInlineDisplay(float ascentMin = 0, bool forbidAtLineStart = false)
//Calling Select(g => g.Typeface).Distinct() speeds up query up to 10 times,
//Calling Max(Func<,>) instead of Select(Func<,>).Max() speeds up query 2 times
float maxLineSpacing = glyphs.Select(g => g.Typeface).Distinct().Max(tf =>
Typography.OpenFont.Extensions.TypefaceExtensions.CalculateRecommendLineSpacing(tf) *
tf.CalculateRecommendLineSpacing() *
tf.CalculateScaleToPixelFromPointSize(fonts.PointSize)
);
display = new TextRunDisplay<Fonts, Glyph>(Display.Text.AttributedGlyphRuns.Create(content, glyphs, fonts, false), t.Range, TypesettingContext.Instance);
Expand All @@ -82,11 +83,15 @@ void FinalizeInlineDisplay(float ascentMin = 0, bool forbidAtLineStart = false)
case TextAtom.Math m:
if (m.DisplayStyle) throw new InvalidCodePathException("Display style maths should have been handled above this switch.");
display = Typesetter<Fonts, Glyph>.CreateLine(m.Content, fonts, TypesettingContext.Instance, Enumerations.LineStyle.Text);
FinalizeInlineDisplay();
FinalizeInlineDisplay(fonts.MathTypeface.CalculateRecommendLineSpacing() *
fonts.MathTypeface.CalculateScaleToPixelFromPointSize(fonts.PointSize));
break;
case TextAtom.ControlSpace cs:
display = new TextRunDisplay<Fonts, Glyph>(Display.Text.AttributedGlyphRuns.Create(" ", new[] { GlyphFinder.Instance.Lookup(fonts, ' ') }, fonts, false), cs.Range, TypesettingContext.Instance);
FinalizeInlineDisplay(forbidAtLineStart: true); //No spaces at start of line
var spaceGlyph = GlyphFinder.Instance.Lookup(fonts, ' ');
display = new TextRunDisplay<Fonts, Glyph>(Display.Text.AttributedGlyphRuns.Create(" ", new[] { spaceGlyph }, fonts, false), cs.Range, TypesettingContext.Instance);
FinalizeInlineDisplay(spaceGlyph.Typeface.CalculateRecommendLineSpacing() *
spaceGlyph.Typeface.CalculateScaleToPixelFromPointSize(fonts.PointSize),
forbidAtLineStart: true); //No spaces at start of line
break;
case null:
throw new InvalidOperationException("TextAtoms should never be null. You must have sneaked one in.");
Expand All @@ -97,7 +102,7 @@ void FinalizeInlineDisplay(float ascentMin = 0, bool forbidAtLineStart = false)
var relativePositionList = new List<IDisplay<Fonts, Glyph>>();
var absolutePositionList = new List<IDisplay<Fonts, Glyph>>();
AddDisplaysWithLineBreaks(input, inputFont, relativePositionList, absolutePositionList);
BreakLine(relativePositionList);
BreakLine(relativePositionList); //remember to finalize the last line
return (new Displays(relativePositionList),
new Displays(absolutePositionList));

Expand Down
4 changes: 2 additions & 2 deletions CSharpMath.SkiaSharp/CSharpMath.SkiaSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<TargetFramework>netstandard1.3</TargetFramework>
<LangVersion>latest</LangVersion>
<GeneratePackageOnBuild Condition="'$(Configuration)' == 'Release'">true</GeneratePackageOnBuild>
<PackageVersion>0.1.0-pre8</PackageVersion>
<PackageVersion>0.1.0-pre8.2</PackageVersion>
<Authors>CSharpMath Contributors (verybadcat, Happypig375, charlesroddie, FoggyFinder)</Authors>
<PackageReleaseNotes>The 0.1.0 SkiaSharp Update brings the SkiaSharp and Xamarin.Forms front ends to CSharpMath.</PackageReleaseNotes>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/verybadcat/CSharpMath.git</RepositoryUrl>
<RepositoryBranch>master</RepositoryBranch>
<RepositoryCommit>ab4da5b730a4cbd5667a66f6af33ccd3ce136fae</RepositoryCommit>
<RepositoryCommit>427b0615080dd2a85da3ae676088f7b48a38a8c7</RepositoryCommit>
<PackageProjectUrl>https://github.com/verybadcat/CSharpMath</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseUrl>https://github.com/verybadcat/CSharpMath/blob/master/LICENSE</PackageLicenseUrl>
Expand Down
2 changes: 1 addition & 1 deletion CSharpMath.Tests/PreTypesetting/MathAtomTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void TestCopySpace() {
var copy = new Space(space, false);
CheckClone(space, copy);
Assert.Equal(3, copy.Length);
Assert.True(copy.IsMu);
Assert.False(copy.IsMu);
}

[Fact]
Expand Down
4 changes: 2 additions & 2 deletions CSharpMath.Utils.NuGet/ReleaseData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<ReleaseData>
<_Global->
<GeneratePackageOnBuild Condition="'$(Configuration)' == 'Release'">true</GeneratePackageOnBuild>
<PackageVersion>0.1.0-pre8</PackageVersion>
<PackageVersion>0.1.0-pre8.2</PackageVersion>
<Authors>CSharpMath Contributors (verybadcat, Happypig375, charlesroddie, FoggyFinder)</Authors>
<PackageReleaseNotes>The 0.1.0 SkiaSharp Update brings the SkiaSharp and Xamarin.Forms front ends to CSharpMath.</PackageReleaseNotes>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/verybadcat/CSharpMath.git</RepositoryUrl>
<RepositoryBranch>master</RepositoryBranch>
<RepositoryCommit>ab4da5b730a4cbd5667a66f6af33ccd3ce136fae</RepositoryCommit>
<RepositoryCommit>427b0615080dd2a85da3ae676088f7b48a38a8c7</RepositoryCommit>
<PackageProjectUrl>https://github.com/verybadcat/CSharpMath</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseUrl>https://github.com/verybadcat/CSharpMath/blob/master/LICENSE</PackageLicenseUrl>
Expand Down
11 changes: 8 additions & 3 deletions CSharpMath.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpMath!Tests", "CSharpM
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CSharpMath.Apple", "CSharpMath.Apple\CSharpMath.Apple.shproj", "{1E62C0F0-B5C9-430E-ADDC-6F6EC6E0BDE1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "__Config", "__Config", "{4095C402-9D46-4F54-9A19-4FA063852135}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "__GlobalFiles", "__GlobalFiles", "{4095C402-9D46-4F54-9A19-4FA063852135}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
CONTRIBUTING.md = CONTRIBUTING.md
LICENSE = LICENSE
README.md = README.md
ReleaseProcedure.txt = ReleaseProcedure.txt
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpMath.Ios.Example", "CSharpMath.Ios.Example\CSharpMath.Ios.Example.csproj", "{664EAD44-C19D-462B-9127-FD1106B4F3C6}"
Expand Down Expand Up @@ -68,9 +73,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextBreakTests", "Typograph
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Dependencies", "_Dependencies", "{74FBDC58-E93A-4DCE-B83F-AA936EE57B31}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpMath.Analyzers", "CSharpMath.Analyzers\CSharpMath.Analyzers\CSharpMath.Analyzers.csproj", "{B76E873A-FAA0-4198-BEC4-66BD2BBC233F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpMath.Analyzers", "CSharpMath.Analyzers\CSharpMath.Analyzers\CSharpMath.Analyzers.csproj", "{B76E873A-FAA0-4198-BEC4-66BD2BBC233F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpMath.Analyzers.Test", "CSharpMath.Analyzers\CSharpMath.Analyzers.Test\CSharpMath.Analyzers.Test.csproj", "{C28BBB7F-CB75-44BF-9488-C4C37DFC0D98}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpMath.Analyzers.Test", "CSharpMath.Analyzers\CSharpMath.Analyzers.Test\CSharpMath.Analyzers.Test.csproj", "{C28BBB7F-CB75-44BF-9488-C4C37DFC0D98}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Expand Down
4 changes: 2 additions & 2 deletions CSharpMath/CSharpMath.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<LangVersion>latest</LangVersion>
Expand All @@ -14,7 +14,7 @@
<PackageTags>math;mathematics;mathematical;formula;equation;equations;expression;tex;latex;render;rendering;display</PackageTags>
<PackageVersion>0.1.0-pre8</PackageVersion>
<RepositoryBranch>master</RepositoryBranch>
<RepositoryCommit>ab4da5b730a4cbd5667a66f6af33ccd3ce136fae</RepositoryCommit>
<RepositoryCommit>427b0615080dd2a85da3ae676088f7b48a38a8c7</RepositoryCommit>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageIconUrl>https://raw.githubusercontent.com/verybadcat/CSharpMath/master/Icon.png</PackageIconUrl>
<PackageId>CSharpMath</PackageId>
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 William Jockusch
Copyright (c) 2017 William Jockusch, Hadrian Tang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
File renamed without changes.

0 comments on commit c367476

Please sign in to comment.