Skip to content

Conversation

@fsih
Copy link
Contributor

@fsih fsih commented Oct 15, 2018

Resolves

What Github issue does this resolve (please include link)?

Proposed Changes

Preload fonts

Reason for Changes

Prevent imported text from being cut off

Test Coverage

Tested many browser/OS combos and IE by loading projects 249881325, 228228816, and loading the default project and then uploading those 2 projects.

Browser Coverage

Check the OS/browser combinations tested (At least 2)

Mac

  • Chrome
  • Firefox
  • Safari

Windows

  • Chrome
  • Firefox
  • Edge

Chromebook

  • Chrome

iPad

  • Safari

Android Tablet

  • Chrome

@fsih fsih requested a review from rschamp October 15, 2018 15:17
@fsih fsih added this to the October 2018 milestone Oct 15, 2018
@fsih
Copy link
Contributor Author

fsih commented Oct 15, 2018

gui.jsx was refactored in the meantime and I would appreciate help figuring out how to merge with the refactor

Copy link
Contributor

@rschamp rschamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fsih Is there any way to enumerate the fonts we need and include them in the head of the document instead? Then they'd just be a prerequisite to loading the GUI entirely.

If there's not a way to do that, please work with @benjiwheeler to resolve the conflicts — it's likely that will change this implementation somewhat because the way projects are loaded has changed.

@fsih
Copy link
Contributor Author

fsih commented Oct 16, 2018

I tested removing the scratch-font-styles block from gui and pasting it into playground/index.ejs, and it didn't fix the font cut-off issue. I think Chrome is trying to be smart and not load the font until it's referenced.

// ability to compose reducers.
const WrappedGui = compose(
ErrorBoundaryHOC('Top Level App'),
FontLoaderHOC,

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

process.nextTick(() => expect(mockedOnLoadedProject).toHaveBeenLastCalledWith(LoadingState.LOADING_VM_WITH_ID));
});
test('if there is no projectData, nothing is rendered', () => {
test('if there is projectData, the child is rendered', () => {

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

Copy link
Contributor

@rschamp rschamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a tough one, DD, nice work tracking it down!

@thisandagain thisandagain merged commit 41fc932 into scratchfoundation:develop Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Imported text can be cut off

4 participants