Skip to content

Commit

Permalink
Merge pull request #10 from cyotek/ScottSWu-fix_getkerning
Browse files Browse the repository at this point in the history
Scottswu fix getkerning
  • Loading branch information
cyotek authored Jul 12, 2017
2 parents 8ac4c40 + b5a7318 commit bd973a5
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 23 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log
==========

1.3.3
-----

### Fixed
* `BitmapFont.GetKerning` always returned zero

1.3.2

### Changed
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
### Version 1.3.3
@ScottSWu

### Version 1.3.1
@rds1983
5 changes: 3 additions & 2 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ CALL ..\..\..\build\set35vars.bat

REM Build and sign the file
%msbuildexe% Cyotek.Drawing.BitmapFont.sln /p:Configuration=Release /verbosity:minimal /nologo /t:Clean,Build
CALL signcmd src\Cyotek.Drawing.BitmapFont\bin\Release\Cyotek.Drawing.BitmapFont.dll
CALL dualsigncmd src\Cyotek.Drawing.BitmapFont\bin\Release\Cyotek.Drawing.BitmapFont.dll

REM Create the package
PUSHD %CD%
IF NOT EXIST releases MKDIR releases
CD releases
NUGET pack ..\src\Cyotek.Drawing.BitmapFont\Cyotek.Drawing.BitmapFont.csproj -Prop Configuration=Release
%NUGETexe% pack ..\src\Cyotek.Drawing.BitmapFont\Cyotek.Drawing.BitmapFont.csproj -Prop Configuration=Release
%zipexe% a -bd -tZip Cyotek.Drawing.BitmapFont.x.x.x.x.zip ..\src\Cyotek.Drawing.BitmapFont\bin\Release\Cyotek.Drawing.BitmapFont.dll
POPD

ENDLOCAL
18 changes: 0 additions & 18 deletions makerelease.cmd

This file was deleted.

45 changes: 44 additions & 1 deletion src/Cyotek.Drawing.BitmapFont/Kerning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
* Licensed under the MIT License. See license.txt for the full text.
*/

using System;

namespace Cyotek.Drawing.BitmapFont
{
/// <summary>
/// Represents the font kerning between two characters.
/// </summary>
public struct Kerning
public struct Kerning : IEquatable<Kerning>
{
#region Constructors

Expand Down Expand Up @@ -73,6 +75,47 @@ public override string ToString()
{
return string.Format("{0} to {1} = {2}", this.FirstCharacter, this.SecondCharacter, this.Amount);
}

/// <summary>
/// Check if the object represents kerning between the same two characters.
/// </summary>
/// <param name="obj"></param>
/// <returns>
/// Whether or not the object represents kerning between the same two characters.
/// </returns>
public override bool Equals(object obj)
{
if (obj == null) return false;
if (obj.GetType() != typeof(Kerning)) return false;

return this.Equals((Kerning)obj);
}

/// <summary>
/// Check if the other kerning is between the same two characters.
/// </summary>
/// <param name="other"></param>
/// <returns>
/// Whether or not the other kerning is between the same two characters.
/// </returns>
public bool Equals(Kerning other)
{
return FirstCharacter == other.FirstCharacter && SecondCharacter == other.SecondCharacter;
}

/// <summary>
/// Return the hash code of the kerning between the two characters.
/// </summary>
/// <returns>
/// A unique hash code of the kerning between the two characters.
/// </returns>
public override int GetHashCode()
{
unchecked
{
return (FirstCharacter << 16) | SecondCharacter;
}
}

#endregion
}
Expand Down
4 changes: 2 additions & 2 deletions src/Cyotek.Drawing.BitmapFont/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
[assembly: CLSCompliant(true)]
[assembly: Guid("d0f2bfc9-ee27-4fbc-9d0c-c61423b51594")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.3.2.0")]
[assembly: AssemblyInformationalVersion("1.3.2")]
[assembly: AssemblyFileVersion("1.3.3.0")]
[assembly: AssemblyInformationalVersion("1.3.3")]

0 comments on commit bd973a5

Please sign in to comment.