-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #340 from SixLabors/js/fix-composite-glyphs
Fix DFKai-SB and KaiU font rendering
- Loading branch information
Showing
23 changed files
with
493 additions
and
645 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
58 changes: 58 additions & 0 deletions
58
src/SixLabors.Fonts/Tables/TrueType/Glyphs/ControlPoint.cs
This file contains 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,58 @@ | ||
// Copyright (c) Six Labors. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
using System; | ||
using System.Numerics; | ||
|
||
namespace SixLabors.Fonts.Tables.TrueType.Glyphs | ||
{ | ||
/// <summary> | ||
/// Represents a true type glyph control point. | ||
/// </summary> | ||
internal struct ControlPoint : IEquatable<ControlPoint> | ||
{ | ||
/// <summary> | ||
/// Gets or sets the position of the point. | ||
/// </summary> | ||
public Vector2 Point; | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the point is on a curve. | ||
/// </summary> | ||
public bool OnCurve; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ControlPoint"/> struct. | ||
/// </summary> | ||
/// <param name="point">The position.</param> | ||
/// <param name="onCurve">Whether the point is on a curve.</param> | ||
public ControlPoint(Vector2 point, bool onCurve) | ||
{ | ||
this.Point = point; | ||
this.OnCurve = onCurve; | ||
} | ||
|
||
public static bool operator ==(ControlPoint left, ControlPoint right) | ||
=> left.Equals(right); | ||
|
||
public static bool operator !=(ControlPoint left, ControlPoint right) | ||
=> !(left == right); | ||
|
||
/// <inheritdoc/> | ||
public override bool Equals(object? obj) | ||
=> obj is ControlPoint point && this.Equals(point); | ||
|
||
/// <inheritdoc/> | ||
public bool Equals(ControlPoint other) | ||
=> this.Point.Equals(other.Point) | ||
&& this.OnCurve == other.OnCurve; | ||
|
||
/// <inheritdoc/> | ||
public override int GetHashCode() | ||
=> HashCode.Combine(this.Point, this.OnCurve); | ||
|
||
/// <inheritdoc/> | ||
public override string ToString() | ||
=> FormattableString.Invariant($"Point: {this.Point}, OnCurve: {this.OnCurve}"); | ||
} | ||
} |
This file contains 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
45 changes: 0 additions & 45 deletions
45
src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphOutline.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.