google / AEUX

Editable After Effects layers from Sketch artboards
Apache License 2.0
513 stars 56 forks source link

Font names fail to match from Figma to AE #61

Closed qinyiyao closed 3 years ago

qinyiyao commented 3 years ago

Many font names will fail to match in AE and fall back to Myriad Pro. This is due to the simple font name transformation rules used in the plugin.

To start, many fonts do not have PostScript names that perfectly match the their display names. “Arial Regular” on macOS has a PostScript name of ArialMT. (At least mine.) Note that: first, the MT could be the foundry name (Monotype) for disambiguation; second, the “Regular” style name is sometimes omitted since it’s the default weight. Same applies to “IBM Plex Sans Regular” IBMPlexSans or “Source Sans Pro Italic” SourceSansPro-It.

In addition, there may or may not be issues with other types of characters (:–—&()+", etc.) or non-latin-based characters.

The ideal solution would be to actually pass the source PostScript name from Figma to AE.

I made a tiny fix #60 to deal with font names with multiple spaces in them, but that’s a different problem and it’s still a terrible solution for font name referencing.

To Reproduce

  1. In Figma, create a text layer and choose Arial.
  2. Send to AE.
  3. Font family will revert back to the default Myriad Pro.

Sketch plugin not tested.

You can also check the correct PostScript name in AE by opening up any expression field, and do the following:

Screen Shot 2021-04-20 at 4 31 26 AM Screen Shot 2021-04-20 at 4 40 03 AM

This will prompt you to select a font with 2 dropdowns. Confirming it will put a PostScript name in string inside the expression field.

adamplouff commented 3 years ago

Great catch on that. Approved the PR

qinyiyao commented 1 year ago

@qinyiyao Hey, I`m facing the same issue. I carefully read your text but I'm a designer, now a programmer, and I can't get it. Can you explain to Gramma step by step what I need to do?

Inspect the font name in macOS Font Book:

CleanShot 2023-04-08 at 19 19 04@2x

Family Name + - + Style Name with spaces removed Arial-Bold does not necessarily equal the actual PostScript Name Arial-BoldMT which is how AE uniquely identifies fonts.

kompanets commented 1 year ago

@qinyiyao Thank you a lot, your response really helped me! I have just renamed Postscript and now AE defines a font correctly! It seems, now, I have overwhelming work to do renaming most of the fonts in my system