|
|
|
@ -32,7 +32,7 @@ namespace Avalonia.Skia |
|
|
|
|
|
|
|
weight -= weight % 100; // make sure we start at a full weight
|
|
|
|
|
|
|
|
for (var i = (int)key.Style; i < 2; i++) |
|
|
|
for (var i = 0; i < 2; i++) |
|
|
|
{ |
|
|
|
// only try 2 font weights in each direction
|
|
|
|
for (var j = 0; j < 200; j += 100) |
|
|
|
@ -57,8 +57,8 @@ namespace Avalonia.Skia |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//Nothing was found so we use the first typeface we can get.
|
|
|
|
return typefaces.Values.FirstOrDefault(); |
|
|
|
//Nothing was found so we try to get a regular typeface.
|
|
|
|
return typefaces.TryGetValue(new Typeface(key.FontFamily), out typeface) ? typeface : null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|