5

Trello uses an icon font and I'd like to figure out how to bring in some of the glyphs into an Illustrator project. Admittedly, this is going a bit backwards (usually you want to import Illustrator art into Glyphs). I'm creating a board mock-up in Illustrator to be used in a video (After Effects).

Here's a direct link to Trello's icon font SVG file: https://d2k1ftgv7pobq7.cloudfront.net/images/fonts/a91174257e439d87d1987b15ad199035/trellicons-regular.svg

5 Answers 5

6

I think I'm getting close to an answer (quack quack), but it's pretty ugly so far.

They key is to get the structure of the SVG file to match what Illustrator is expecting. The easiest way to start is to simply save an existing illustrator file as SVG and open up the result in a text editor.

First, strip down the XML so that all you have the the basic "frame" of the SVG file without any content. Here's an example.

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1920px"
   height="1080px" viewBox="0 0 1920 1080" enable-background="new 0 0 1920 1080" xml:space="preserve">


</svg>

In the SVG file for the icon font, the glyphs are going to look like this (at least for Trello's SVG icon font):

<glyph unicode="&#xf001;" d="M120 186q0 109 68 240t195.5 247.5t277.5 164.5l-9 -14q-106 73 -168.5 189.5t-62.5 249.5q0 146 72.5 269.5t197 195.5t271.5 72q144 0 268 -71.5t197 -195.5t73 -270q0 -132 -63 -249t-169 -193l-11 20q115 -37 218.5 -115.5t173 -170.5t110.5 -190t41 -179 q0 -78 -71 -138.5t-192 -96t-267.5 -53.5t-309.5 -18t-309.5 18t-267.5 53.5t-192 96t-71 138.5z" />

We're going to need to modify that a bit before pasting into the file we plan to import into Illustrator. Here are some things I had to change:

  • Change the word glyph to path
  • You don't need the unicode attribute, so change it to id. (I also modified the value so it Illustrator didn't try to render the Unicode, e.g. "&#xf001;" became "xf001". This may not be neccesary).
  • Wrap the new path element in a g tag with an id that matches the id of the path.

Your glyph tag should now look something like this:

<g id="xf004">
   <path id="xf004" d="M0 190v1300q0 64 30.5 97t89.5 33h1680q59 0 89.5 -33t30.5 -97v-1300q0 -63 -31 -96.5t-89 -33.5h-1680q-58 0 -89 33.5t-31 96.5zM320 510q0 -58 31 -89t89 -31h667q59 0 89.5 31t30.5 89v60q0 58 -30.5 89t-89.5 31h-667q-58 0 -89 -31t-31 -89v-60zM330 1110 q0 -58 28.5 -89t81.5 -31h1070q110 0 110 120v60q0 120 -110 120h-1070q-53 0 -81.5 -31t-28.5 -89v-60z" />
</g>

Put together, the file will look like this:

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1920px"
   height="1080px" viewBox="0 0 1920 1080" enable-background="new 0 0 1920 1080" xml:space="preserve">

<g id="xf004">
   <path id="xf004" d="M0 190v1300q0 64 30.5 97t89.5 33h1680q59 0 89.5 -33t30.5 -97v-1300q0 -63 -31 -96.5t-89 -33.5h-1680q-58 0 -89 33.5t-31 96.5zM320 510q0 -58 31 -89t89 -31h667q59 0 89.5 31t30.5 89v60q0 58 -30.5 89t-89.5 31h-667q-58 0 -89 -31t-31 -89v-60zM330 1110 q0 -58 28.5 -89t81.5 -31h1070q110 0 110 120v60q0 120 -110 120h-1070q-53 0 -81.5 -31t-28.5 -89v-60z" />
</g>

</svg>

Of course, you need to apply those steps for all of the glyphs you want to import, but that's what Macros and Search/Replace are for :)

2
  • This is good info Ben Aug 30, 2013 at 11:07
  • Perhaps i have misunderstood entirely; but what i do, is use IcoMoon. I make my icons as svgs, upload (add some from icoMoon if i want), then download it as a font. Thereby having it system-wide as a font to use anywhere.
    – benteh
    Apr 2, 2015 at 22:06
2

I think the most straight forward solution is to install the font file into your OS and then in Illustrator type in all the characters that you think are mapped to icons.

Then all you have to do is change the font to the font you installed. That is it. Now you can do what you want with the character.

1
  • 1
    You probably need to add detail on how to convert the SVG file to a format you can install.
    – e100
    Mar 6, 2014 at 14:43
2

I used a little XSL transform I wrote to convert the svg font to a svg graphic. The resulting svg file can be opened in illustrator.

Here is the xsl:

<xsl:stylesheet
        xmlns="http://www.w3.org/2000/svg"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xpath-default-namespace="http://www.w3.org/2000/svg"
        version="2.0"
        >
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
        <svg>
            <xsl:apply-templates/>
        </svg>
    </xsl:template>

    <xsl:template match="glyph">
        <g>
            <path>
                <xsl:attribute name="d" select="@d" />
            </path>
        </g>
    </xsl:template>

    <xsl:template match="text()"/>

</xsl:stylesheet>
2

Here is the procedure that I have successfully used to import a font and edit it in Illustrator.

  1. Use FontBook to import the ttf (true-type font) file onto your computer (you can easily delete it later if you don't want to pollute your fonts)
  2. Open Illustrator
  3. Select "Window->Type-Glyphs".
  4. At the bottom of the Glyphs window, you can select the font that you just imported.
  5. Create a text box, and then click on one of your icons in the Glyphs window to make the font appear in the text box.
  6. Convert the font to a shape by selecting it and then choosing "Type->Create Outlines"
  7. Expand the font to the correct size and edit it.
  8. Select all of the shapes in your new font, and combine them into a single shape by selecting "Window->Pathfinder" and then choosing "Merge"
  9. Save the file as an SVG, and import into icomoon.io or some other service that allows you to create fonts.
1

I think it can be done much easier. In Illustrator open the GLYPHS panel, on the canvas make a empyt text field, set the font of that text field to the icon font and that dubble click on an icon in the GLYPHS panel.

1
  • Does this assume that step 0 is to install the font on your system? And do you still need to add all the characters to your file and do a trace on them, if you want to edit them as vector art?
    – Jon Coombs
    Feb 11, 2016 at 1:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.