Arial.ttf is no longer a valid built in font

#210 · closed · 2 comments

View on GitHub ↗

JMBartelt

**Describe the bug** Getting this error repeatedly in Unity Editor 2022.3.1, "ArgumentException: Arial.ttf is no longer a valid built in font. Please use LegacyRuntime.ttf" **Stack Trace** ``` ArgumentException: Arial.ttf is no longer a valid built in font. Please use LegacyRuntime.ttf UnityEngine.Resources.GetBuiltinResource[T] (System.String path) (at <c2d036c16ca64e0eb93703a3b13e733a>:0) Microsoft.Maps.Unity.MapCopyrightLayer.UpdateDefaultCopyrights (System.Object sender, System.EventArgs args) (at ./Library/PackageCache/[email protected]/Runtime/Scripts/MapRenderer/Copyrights/MapCopyrightLayer.cs:107) Microsoft.Maps.Unity.MapRenderer.Update () (at ./Library/PackageCache/[email protected]/Runtime/Scripts/MapRenderer/MapRenderer.cs:295) ``` So it's suggesting line 107 of code in MapCopyrightLayer.cs needs to change the reference to Arial.ttf to LegacyRuntime.ttf `_font = Resources.GetBuiltinResource<Font>("Arial.ttf");` **Steps to reproduce** Add MapRenderer component to scene **EDIT: I found that having Map Copyright Layer Font property is set to null in the scene inspector causes this issue** **Environment:** - Unity version: 2022.3.1f1 - Maps SDK Package version: 0.11.2

Comments

kircher1

Hello, as a workaround for versions where Arial is not present, you should be able to set the "Font" via the inspector too ![image](https://github.com/microsoft/MapsSDK-Unity/assets/20366429/f0bf560b-fc35-446f-9840-e6ac9a9cf09b)

JMBartelt

Thanks, yes there is no issue as long as a font is set in the inspector. If it's null though, it's not immediately obvious that the null inspector property is causing the error. Also, just wanted to say that this SDK rules, great work and thanks for providing it!