Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading external fonts #771

Open
ianthetechie opened this issue Dec 15, 2020 · 3 comments
Open

Error loading external fonts #771

ianthetechie opened this issue Dec 15, 2020 · 3 comments
Milestone

Comments

@ianthetechie
Copy link

TANGRAM VERSION:

Tangram v0.21.1

ENVIRONMENT:

macOS Big Sur running Firefox 83.

TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:

Add an external font to my scene file like so:

fonts:
  Open Sans Regular: external

RESULT:

Tangram v0.21.1 [error]: Scene.load() failed to load "scene.yaml": can't assign to property "url" on "external": not an object TypeError: can't assign to property "url" on "external": not an object

EXPECTED RESULT:

Per https://tangrams.readthedocs.io/en/master/Syntax-Reference/fonts/#external, it looks like external fonts are supported via this syntax. However, it looks like the current JS (

normalizeFonts(config, bundle) {
) now assumes that there will be an object with a URL property.

@bcamper
Copy link
Member

bcamper commented Dec 19, 2020

Yikes, you're right, external fonts do appear to have been broken for some quite awhile 😬 It's an easy fix. I almost wonder if this functionality should just be deprecated, but it does have a logical use, for example in cases where you have brand-specific font you're already loading in your app and don't want to duplicate resources.

@bcamper bcamper added this to the v0.21.2 milestone Dec 19, 2020
@bcamper
Copy link
Member

bcamper commented Dec 19, 2020

Fixed in master but usually keep issues open until shipped in a production release.

@bcamper bcamper reopened this Dec 19, 2020
@ianthetechie
Copy link
Author

No worries. I'm not convinced I need the feature either, but I was trying some stuff out and noticed that it was busted ;) Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants