skiasharp/binding/HarfBuzzSharp/Script.cs
Matthew Leibowitz bc5020b9ee
Modernize the repository and prepare SkiaSharp 3.0 (#2505)
* Merge and modernize the binding projects
* Remove UWP and watchOS
* Add the native assets projects
* Rename bootstrapper.ps1 to build.ps1
* Add new device tests
* Rework the test skipping feature

---------

Co-authored-by: Jerome Laban <jerome.laban@nventive.com>
2023-07-30 23:49:57 +08:00

40 lines
933 B
C#

using System;
namespace HarfBuzzSharp
{
public partial struct Script : IEquatable<Script>
{
private readonly Tag tag;
private Script (Tag tag)
{
this.tag = tag;
}
public Direction HorizontalDirection =>
HarfBuzzApi.hb_script_get_horizontal_direction (tag);
public static Script Parse (string str) =>
HarfBuzzApi.hb_script_from_string (str, -1);
public static bool TryParse (string str, out Script script)
{
script = Parse (str);
return script != Unknown;
}
public override string ToString () => tag.ToString ();
public static implicit operator uint (Script script) => script.tag;
public static implicit operator Script (uint tag) => new Script (tag);
public override bool Equals (object obj) =>
obj is Script script && tag.Equals (script.tag);
public bool Equals (Script other) => tag.Equals (other.tag);
public override int GetHashCode () => tag.GetHashCode ();
}
}