simonoliver / UnityFigmaBridge

Easily bring your Figma Documents, Components, Assets and Prototypes to Unity
MIT License
367 stars 37 forks source link

Use device installed fonts for any fonts not available on Google Fonts. #31

Open vidishar11 opened 12 months ago

vidishar11 commented 12 months ago

No matching font SF Pro Text UnityEngine.Debug:LogWarning (object) UnityFigmaBridge.Editor.Fonts.GoogleFontLibraryManager:GetFontUrl (string,int) (at ./Library/PackageCache/com.simonoliver.unityfigma@318d39d545/UnityFigmaBridge/Editor/Fonts/GoogleFontLibraryManager.cs:183) UnityFigmaBridge.Editor.Fonts.GoogleFontLibraryManager:CheckFontAvailableForDownload (string,int) (at ./Library/PackageCache/com.simonoliver.unityfigma@318d39d545/UnityFigmaBridge/Editor/Fonts/GoogleFontLibraryManager.cs:220) UnityFigmaBridge.Editor.Fonts.FontManager/d0:MoveNext () (at ./Library/PackageCache/com.simonoliver.unityfigma@318d39d545/UnityFigmaBridge/Editor/Fonts/FontManager.cs:90) System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start<UnityFigmaBridge.Editor.Fonts.FontManager/d0> (UnityFigmaBridge.Editor.Fonts.FontManager/d0&) UnityFigmaBridge.Editor.Fonts.FontManager:GenerateFontMapForDocument (UnityFigmaBridge.Editor.FigmaApi.FigmaFile,bool) UnityFigmaBridge.Editor.UnityFigmaBridgeImporter/d17:MoveNext () (at ./Library/PackageCache/com.simonoliver.unityfigma@318d39d545/UnityFigmaBridge/Editor/UnityFigmaBridgeImporter.cs:424) System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetResult () UnityFigmaBridge.Editor.FigmaApi.FigmaApiUtils/d__8:MoveNext () (at ./Library/PackageCache/com.simonoliver.unityfigma@318d39d545/UnityFigmaBridge/Editor/FigmaApi/FigmaApiUtils.cs:349) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run () UnityFigmaBridge.Editor.Utils.UnityWebRequestAwaiter:OnRequestCompleted (UnityEngine.AsyncOperation) (at ./Library/PackageCache/com.simonoliver.unityfigma@318d39d545/UnityFigmaBridge/Editor/Utils/UnityWebRequestAwaiter.cs:41) UnityEngine.AsyncOperation:InvokeCompletionEvent ()

To Reproduce Steps to reproduce the behavior:

  1. using figma image url : https://www.figma.com/file/Vg26v9Wm9bx6R0DUEEDEvZ/Add-Unit-page?type=design&node-id=1-213&mode=design&t=Gwk8uJRXgc6vBOe4-0

  2. Followed steps mentioned in video: https://www.youtube.com/watch?v=4LjvsMXwaI8 Version

    • Unity Version: [Unity 2022.2.9f1]
    • Platform [Windows 10]
simonoliver commented 12 months ago

Right now we only add fonts that are downloadable from Google Fonts - https://fonts.google.com/ . SF Pro is an apple font - https://developer.apple.com/fonts/ . You can create a TextMeshPro font in your project as described here, and provided the name is close, it will match it when importing the file - https://docs.unity3d.com/Packages/com.unity.textmeshpro@4.0/manual/FontAssetsCreator.html

It would be good to be able to use device fonts. I'm going to change this issue to use device fonts where available.

vidishar11 commented 11 months ago

Hi Simon, There is a another team which provides these figma images and this time they provided the Figma image in Roboto which is one of the fonts mentioned in Google Fonts - https://fonts.google.com/ and I am again getting the same log message that SF pro has been used. Is it possible the problem is because of something else and is still throwing same message regards to SF pro ? Is it possible? or is the font used is SF pro only ?

simonoliver commented 11 months ago

It's likely that there is still a text object somewhere in the doc that uses the SF Pro font (the importer will only reference the current version, not previous versions). You could try using a plugin like https://www.figma.com/community/plugin/1002875535237160651/FontScanner to find all objects using each font. Screenshot 2023-07-26 104716

vidishar11 commented 11 months ago

Thanks simon.

vidishar11 commented 11 months ago

Hi simon is this Unity Figma Bridge compatible with editor version : 2022.2.9f1 ?

simonoliver commented 11 months ago

It should be - are you seeing any issues?

On Thu, 27 Jul 2023 at 19:01, vidishar11 @.***> wrote:

Hi simon is this Unity Figma Bridge compatible with editor version : 2022.2.9f1 ?

— Reply to this email directly, view it on GitHub https://github.com/simonoliver/UnityFigmaBridge/issues/31#issuecomment-1654011870, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICVO4FLMTF2V4KGCOZZHTXSKNIJANCNFSM6AAAAAA2TEBYTM . You are receiving this because you were assigned.Message ID: @.***>

--


Simon Oliver Game Director / Founder, HandCircus @.***

vidishar11 commented 11 months ago

Again the same log message where figma team member shared the image and claimed it is made in one of the fonts in https://fonts.google.com/ but I am again getting same error log : "No matching font SF Pro Text UnityEngine.Debug:LogWarning (object)" thats why asking if it could be issue due to a specific editor version ?

Thanks Simon.

simonoliver commented 11 months ago

Yep, this warning just means you still have that font in your Figma file somewhere - you can find it using the plugin I shared earlier

On Thu, 27 Jul 2023 at 20:50, vidishar11 @.***> wrote:

Again the same log message where figma team member shared the image and claimed it is made in one of the fonts in https://fonts.google.com/ but I am again getting same error log : "No matching font SF Pro Text UnityEngine.Debug:LogWarning (object)" thats why asking if it could be issue due to a specific editor version ? Thanks!

— Reply to this email directly, view it on GitHub https://github.com/simonoliver/UnityFigmaBridge/issues/31#issuecomment-1654241489, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICVOZS2LUP3FHDSLGXGWDXSKZ6VANCNFSM6AAAAAA2TEBYTM . You are receiving this because you were assigned.Message ID: @.***>

--


Simon Oliver Game Director / Founder, HandCircus @.***

vidishar11 commented 11 months ago

Thanks Simon.