Check for index in range before returning CPIS value.
This commit is contained in:
parent
595db08cc7
commit
0a14f6f3fc
@ -282,7 +282,10 @@ namespace CvtFont
|
|||||||
public static float GetCPIs(uint i)
|
public static float GetCPIs(uint i)
|
||||||
{
|
{
|
||||||
if (FontIsPropt(i)) return 12;
|
if (FontIsPropt(i)) return 12;
|
||||||
return CPIS[i & 63];
|
uint j = i & 63;
|
||||||
|
if (j > CPIS.Length - 1)
|
||||||
|
return CPIS[0];
|
||||||
|
return CPIS[j];
|
||||||
}
|
}
|
||||||
public static float GetPrintPitch(uint i)
|
public static float GetPrintPitch(uint i)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user