New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Start learning with our library of video tutorials taught by experts. Get started

Deploying Icon Fonts for the Web
Illustration by

Structuring multicolored glyphs


From:

Deploying Icon Fonts for the Web

with James Williamson

Video: Structuring multicolored glyphs

One of the chief complaints that some designers, If I go over to the font itself and I scroll down towards the bottom.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Deploying Icon Fonts for the Web
2h 4m Intermediate Apr 29, 2014

Viewers: in countries Watching now:

Icon fonts are a fast, effective way to feature scalable vector artwork on websites. James Williamson shows you how to properly deploy icon fonts on your own site in this short course. Learn how to find an icon font that's right for you and style it so it appears exactly the way you want. Then learn about deployment options that will make your icons accessible and display consistently across multiple browsers and devices. James also introduces advanced styling options such as animated and multicolored glyphs.

Want to create your own icon fonts? Check out James' companion course, Creating Icon Fonts for the Web.

Topics include:
  • Finding icon fonts
  • Ensuring consistent styling
  • Exploring class-based solutions for deployment
  • Deploying with the data-icon attribute
  • Aligning icons
  • Animating icons
  • Styling multicolored glyphs
Subjects:
Web Web Graphics Interaction Design Web Design
Author:
James Williamson

Structuring multicolored glyphs

One of the chief complaints that some designers, have about icon fonts is that unlike ping files and jif files and ASVG's and things like that icon fonts are typically just monochromatic. This is a specimen sheet that I've created, for the font that we've been using throughout the course called Chunky Mobile. This is an icon font I built specifically for this course. I'm going to be refining it shortly after that and then open sourcing it for the web. So, you guys are getting sort of an early version of it.

That you can take home with you, because it will be part of the exercise files. Part of the resource files at the end of the course. Alright. As I scroll down through here, though. You can see in this specimen, that all of these icons are a single color. In this case, black. But I certainly could have made them any color that I want. But if I scroll all the way down to the bottom, however. Aha! We have multi colored icons. So a lot of icon font sets out there will have multi colored icons, and that might prompt you to wonder, well wait a second. How does that work? How can you store multiple colors in, a single glyph file? Well the answer is, you can't.

If I go over to the font itself and I scroll down towards the bottom. You can kind of see what's going on here. We've got multiple glyph's, that when combined make a multi colored icon. So in the case of the map which is the one that we'll be doing in our uh,next couple of exercises, we have two versions of the map. We've got one monochromatic, version of it. And the answer's at the bottom. You can see we have one multicolored version of it, that is, made in much the same way that we used to make separations, when I was working in print design.

You have a single icon, for each color, and then we stack them one on top of each other and we can assign different colors. Is it a little bit of a heck? Yeah. It kind of is. But, since we are able to use the exact same type of structuring that we've been using up to this point it's still relatively semantic. Okay. So I have opened up the multi-color.htm file from the 04_05 folder. And in this exercise, what we are focussing on is the structuring of the HTML itself.

We'll style our multi-colored icon, in the following exercise. Alright so I'm going to scroll down, and since this is a specimen sheet it's got every single glif in the set. So we might have to scroll for quite some time. Here we are. Right al-, around line 115 to line 116 somewhere around in there, you're going to find an empty list item. Right here. And here's where we're going to put our map. Now I want to point out, using some of the existing code here kind of how this structure is working.

You're going to see that instead of using just one span tag, we're using two. Not only that but the span tags are nested one inside of the other. So if I have these guys selected you're going to see the outer span tag, has a data icon attribute. And the inner span tag has a data-icon attribute. Now in this case, this is the battery, and I want you to pay attention to which icon is being used where. So the outer icon is F102. The inner icon is F103. That's really important.

If we go out to our glyphs and we look at F102, that's the battery body. If we look at F103 That's the middle of it that's indicating the current charge. That means that the parent icon, in this case, f one of two is actually going to be underneath the nested icon. Now we could use CSS positioning to change that but if you change that it's sort of a logical structure. Okay, I'm going to go ahead and copy, the interior of the list item element just below our empty one and paste it in there then replace it with information specific to our maps.

The first thing I want to do is go find the DATA icons that I need for this. Now if I go back to my font file, I can see that I am using F One Zero Zero for the map body. And F101 for the pin, so we want the body to show up first then we want the pin. So I'm going to change this to F100, and change the interior one to F101. I'm going to go ahead and save that. The next thing I want to do is change the label.

And this really doesn't have anything to do, with the display of the icon. But since this is a specimen sheet, it makes sense to go ahead and have a label for this. And I'm just going to type in maps. And then I have to, I want to give the codes because, again, as a specimen sheet I want people to know what's mapped to what. All right. I'm going to go ahead and save that. And now currently, If I were to test the page as it is now If I scroll through it, the single color ones look pretty good, but the multi-color ones, not so good.

And that's mainly because the only styles we have right now controlling the styling of these icon fonts are the styles for just sort of the generic single icons. So what's happened is, these guys are stacking sort of in rows, so we need to change it so not only are they different colors but But they're also overlaying as well, and we'll do that in the next exercise.

There are currently no FAQs about Deploying Icon Fonts for the Web.

 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Deploying Icon Fonts for the Web.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.