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

Fix for Webpack keeping fontFamily parameter for iOS #778

Merged
merged 9 commits into from
Jul 28, 2018
Merged

Fix for Webpack keeping fontFamily parameter for iOS #778

merged 9 commits into from
Jul 28, 2018

Conversation

yairopro
Copy link
Contributor

No description provided.

@yairopro
Copy link
Contributor Author

yairopro commented Jul 17, 2018

@oblador After #775 has been closed, this is another try to make fix for Webpack.
As you will see, I did the same thing on fontReference you did for Android, so it won't make break changes for iOS.

PS: don't take care of the empty commits after, sorry. Only the first one is important.

@oblador
Copy link
Owner

oblador commented Jul 24, 2018

Think this actually also broke iOS, did you try your changes? Anyway, I refactored it and think it should be fine now. Please test with your setup, and the example project.

@yairopro
Copy link
Contributor Author

You are right, I forgot the default assignment in the Platform.select.
I still didn't try. Do you want me to try and tell you ?

@oblador
Copy link
Owner

oblador commented Jul 24, 2018

Please do!

@oblador
Copy link
Owner

oblador commented Jul 27, 2018

@yairopro Could you fix the lint error and test that this PR works on iOS and Android? Would like to get it in the next release along with some other breaking changes.

@yairopro
Copy link
Contributor Author

yairopro commented Jul 27, 2018

I won't be able to check it before sunday, sorry.

Copy link
Owner

@oblador oblador left a comment

Choose a reason for hiding this comment

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

Run tested this on iOS

@oblador oblador merged commit f34d291 into oblador:master Jul 28, 2018
@zachariahtimothy
Copy link

Any chance we can get an example of what might need to change in webpack to support this change? The file name does not match the font name so browsers are not loading fonts in version 5.x. Thanks!

@zachariahtimothy
Copy link

Disregard my last message. Anyone coming here using Material UI Icons, for version 5.x you need to change the font family in your font-face style injector from "Material Icons" to "MaterialIcons". This is working for me

const iconFont = require('react-native-vector-icons/Fonts/MaterialIcons.ttf');
  console.log('iconFont', iconFont)
  const iconFontStyles = `@font-face {
    src: url(${iconFont});
    font-family: "MaterialIcons";
  }`;

  const style = document.createElement('style');
  style.type = 'text/css';
  if (style.styleSheet) {
    style.styleSheet.cssText = iconFontStyles;
  } else {
    style.appendChild(document.createTextNode(iconFontStyles));
  }

  document.head.appendChild(style);```

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

Successfully merging this pull request may close these issues.

None yet

3 participants