Skip to content

Commit

Permalink
Forgor about backwards ppl
Browse files Browse the repository at this point in the history
  • Loading branch information
DotWith authored and larsiusprime committed Dec 31, 2021
1 parent 2984d0b commit c78e5ca
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions firetongue/FireTongue.hx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class FireTongue
* @param size
* @return FontData
*/
public function getFont(str:String, size:Int):FontData
public function getFontData(str:String, ?size:Int = 1):FontData
{
var replace:FontData = {
name: "",
Expand Down Expand Up @@ -369,12 +369,23 @@ class FireTongue
}

/**
* DEPRECATED! Use `getFont(str, size).size` instead;
* DEPRECATED! Use `getFontData(str, size).name` instead;
* @param str
* @return FontData
*/
@:deprecated('getFont is deprecated. Use getFontData instead.')
public function getFont(str:String):String
{
return getFontData(str).name;
}

/**
* DEPRECATED! Use `getFontData(str, size).size` instead;
*/
@:deprecated('getFontSize is deprecated. Use getFont instead.')
@:deprecated('getFontSize is deprecated. Use getFontData instead.')
public function getFontSize(str:String, size:Int):Int
{
return getFont(str, size).size;
return getFontData(str, size).size;
}

/**
Expand Down

0 comments on commit c78e5ca

Please sign in to comment.