How to add Google Material Icons in Writer?

I’ve dowloaded the library, have .ttf, .woff and .woff2 files along with a big .swg file. I want to use Google Material Icons in my documents, is there a way to add those? Opening the font file I only see letters.

Google Material Icons: https://material.io/resources/icons/

Those are generally used for web projects but since they offer the source, there could be a way to integrate for desktop apps, just dont know how to add a new font of this type to LibreOffice.

And what is “Google Material Icons”? A font (because you mention “ttf”)?

Edit your question to be more descriptive for those who aren’t inside your head. Don’t forget you OS name and LO version. Don’t use an answer which is reserved for solutions.

@ajlittoz added

From what I see in the link you provided, GMI are primarily icons, i.e. images. You can then paste them as images in your document and apply the usual position adjustments (anchor mode, wrap mode, position relative to anchor or some reference, …).

There is also a font. This is the .ttf file you mentioned. You don’t install font in LO, you install fonts into your system and LO uses whatever the OS hands it over. How to install a font depend on the OS. You didn’t tell which is yours; I can’t help more than recommending you follow your OS method for font management.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

yes but if I preview the font in Windows 10 before installing, it just show some letters not symbols.

I downloaded one of the font to have an idea of its content.

  • only 37 characters are defined in the ASCII set: 0-9, _, a-z; they all show as empty in my utility
  • 1516 shapes are hosted in the Private Use Area U+E000-U+F8FF out of the 6400 possible characters
  • one extra character at U+10FFD (a horny animal profile) in PUA B

This means that any standard preview utility will show only the subset defined in ASCII. Since you see digits and letters while my “technical” utility reports the glyphs as void, this means the W10 font renderer substitutes some other shape.

Using the font in LO needs to know the encoding of a shape. For instance, the black bell with white plus sign is at U+E003. To insert it into your text type u+e003 then Alt+X. Not user-friendly!

Make first a directory of the icons: description of icon => hexadecimal encoding.

It might be faster to copy and paste an icon as an image.

what does the Alt+X command do on LO? Did you try typing the icon name instead the encoding? For example writing face and then Alt+X does it render the icon? Also what utility did you use to access these icons? is it sort of a plug-in for LO?

confirmed, installed the icon font and typing the icon name render the icon! Here is a short .gif video showing how it works: http://share.creoweb.it/f0db3bcf.gif thanks for pointing me in the right direction. Even more easy I an insert>symbol and browse the list. I was thinking the solution to be more complicate that that, it is like using Webdings font in the end.

Alt+X is a command toggling between glyph and Unicode hexadecimal encoding. It allows you to access any character, even those not included in a font.

I think the trick in the GIF video works because of hidden macros installed simultaneously with the font. I didn’t find any icon name in the font. And there can’t be standard any because the icons are hosted in the Private Use Area of BMP which, by definition, is not standardised and left free of any constraint for whatever use you can dream of.

I tried the trick with LATIN SMALL LETTER A, selected this name and forced-assigned a font with no effect. I selected the name and Alt+X: only the last “word” in selection (“A”) was changed to U+0041.

FYI I snooped into the font with utility FontForge.

I used the words that are used to call up the icon using the web font. While writing “face” the icon didnt show up until the word was complete. Selecting whole words and setting the Google Material Font switched to the relative icon. Interesting if I print the document into a PDF and select the text, the icon (pasting the text in notepad) are rendered with their initial, so for “face” I see a F etc…