在Azure App服务中无法正确创建字体 [英] Font not created properly in Azure App service
问题描述
我试图使用ASP.NET Web应用程序作为Azure App服务为"Blackadder ITC"创建System.Drawing.Font.它在Azure环境中创建"Microsoft Sans Serif",但在本地计算机上可以正常工作.
I tried to create a System.Drawing.Font for "Blackadder ITC" using ASP.NET Web application as Azure App service. It creates "Microsoft Sans Serif" in Azure environment, but working fine in local machine.
请参考以下我在Web应用程序中尝试过的代码段:
Please refer the below code snippet, which I tried in my web application:
System.Drawing.Font font = new System.Drawing.Font("Blackadder ITC", 10);
throw new Exception(font.Name);
在Azure App服务中使用字体是否有限制?
Is there any limitations for using fonts in Azure App service?
您能否建议如何在Azure App服务中使用上述字体("Blackadder ITC")?
Can you please suggest how to use the above mentioned font ("Blackadder ITC") in Azure App service?
推荐答案
由于沙箱的限制,常规应用程序服务不支持自定义字体:
Custom fonts are not supported on general App Service due to Sandbox limitations:
https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#unsupported-frameworks
https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#unsupported-frameworks
您可以在不支持字体的App Service上使用Windows容器:
You may use Windows Containers on App Service which do support fonts:
https://docs.microsoft.com/zh-CN/azure/app-service/app-service-web-tutorial-windows-containers-custom-fonts
https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-windows-containers-custom-fonts
这篇关于在Azure App服务中无法正确创建字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!