Skip to content

Commit

Permalink
Fixed StrfName's String property returning unicode strings of wrong l…
Browse files Browse the repository at this point in the history
…ength
  • Loading branch information
rlokc committed Nov 9, 2018
1 parent 0c1670e commit 61a4d01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/SharpFont/TrueType/SfntName.cs
Expand Up @@ -117,7 +117,7 @@ public string String
//TODO it may be possible to consolidate all of these properties
//if the strings follow some sane structure. Otherwise, leave
//them or add more overloads for common encodings like UTF-8.
return Marshal.PtrToStringUni(rec.@string, (int)rec.string_len);
return Marshal.PtrToStringUni(rec.@string, (int) Math.Ceiling(rec.string_len/2.0));
}
}

Expand Down

0 comments on commit 61a4d01

Please sign in to comment.