question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using Material Design Icons as font

See original GitHub issue

I looked at the fontawesome icons example and used that as my starting point and it worked great until I noticed that the icons I need have five characters. The code I use looks like this:

text = '\uF02D1'

should be the “mdi-battery-charging-high” icon but the output to the screen (SSD1306) is the “mdi-amazon” (‘\uF02D’). Is this a bug or am I doing it wrong?

https://cdn.materialdesignicons.com/4.7.95/

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rm-hullcommented, Jan 13, 2020

Ok, turns out \u is the 16-bit unicode hex representation, so only reads the following 4 characters. To get 32-bit unicode values, use \U (upper-case) instead … so the following should work as expected:

text = '\U000F02D1'

I learned something new today…!

0reactions
nickehallgrencommented, Jan 13, 2020

So did I, I tried

text = '\u000F02D1'

earlier but it didn’t work and now I understand why. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Material Icons Guide | Google Fonts
The material icon font is the easiest way to incorporate material icons with web projects. We have packaged all the material icons into...
Read more >
Material Symbols and Icons - Google Fonts
Material Symbols are our newest icons consolidating over 2,500 glyphs in a single font file with a wide range of design variants. Symbols...
Read more >
Introducing Material Symbols
The Material Symbols font is the variable version of the Material Icons font. Variable fonts are a relatively new font format that allow...
Read more >
@material-design-icons/font - npm
Latest icon fonts and CSS for material design icons.. Latest version: 0.14.2, last published: a month ago. Start using ...
Read more >
Material Design Icons – Building Blocks of Web and App Design
Designing with Material Design's Icons in UXPin · Step One – Click the icon element · Step Two – Draw an icon on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found