Open MohanaselvamJ opened 3 years ago
Any update would be really helpful?
Are you installing fontconfig one the AWS side?
Maybe you meant to use the NoDependencies version of the package? https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux.NoDependencies/2.80.3-preview.40
I have removed SkiaSharp.NativeAssets.Linux from my project
Then installed Sharp.NativeAssets.Linux.NoDependencies v2.80.2
Now working fine.
Thanks.
Hi @mattleibow,
After installing a SkiaSharp.NativeAssets.Linux.NoDependencies v2.80.2 package in .NET Core 2.1 targeted AWS lambda function, SkiaSharp library performs text measuring properly by using default SkTypeface "DejaVu Sans". When we try to perform a same measuring in .NET Core 3.1 targeted AWS lambda function, it always returns a width of input text as 0.
Please find the below code snippet that we used to measure a text using SkiaSharp,
// Returns width as "40" in .NET Core 2.1 and returns width as "0" in .NET Core 3.1.
SKPaint paint = new SKPaint();
return paint.MeasureText("Simple");
From further investigation, we found default SkTypeface seems empty in a .NET Core 3.1 targeted AWS lambda function. Could you please let us know, how we can able to measure a text in .NET Core 3.1 targeted AWS lambda function using SkiaSharp ?
Please refer the below code snippet,
// Returns FamilyName as "DejaVu Sans" in .NET Core 2.1 and returns FamilyName as "" in .NET Core 3.1.
SKTypeface typeface = SKTypeface.Default;
return typeface.FamilyName;
Additional Information:
While trying to retrieve a available font families of .NET Core 2.1 targeted AWS lambda function using SKFontManager, it returns below font family names. But .NET Core 3.1 targeted AWS lambda function returns 0 font familes.
**.NET Core 2.1 font families:**
Please find the below code snippet that we used to retrieve a available font families,
SKFontManager fontManager = SKFontManager.Default;
string[] fonts = fontManager.GetFontFamilies();
Also, we like to know, when we should prefer SkiaSharp.NativeAssets.Linux.NoDependencies and SkiaSharp.NativeAssets.Linux packages. Is there any documentation available to refer ?
Thanks in advance.
@mattleibow - Could you please help us to resolve this ?
Description
Facing error while using SkiaSharp library in AWS Lambda funtion
Code
Expected Behavior
Should working fine
Actual Behavior
Got error. Please refer the below screenshot which taken from CloudWatchLogs of particular function in AWS Lambda
Basic Information
Reproduction Link
Create simple AWS Lambda function sample and use above code snippet. Then, invoke the function using simple ASP.NET Core application.
`
Seems like regression in latest