My gulp iconfont renders like an ugly live traced icon - css

I noticed my icons look off when I zoom in to my navigation. I'm using Gulp-iconfont (npm package) with just the default template and styling as in the link is described.
My HTML:
<li class="pageNav_metaItem">
<i id="open-apps-bar" class="icon-apps"></i>
</li>
Rendered font
.svg file.
Can anyone help me with this issue?

As I see, all your icons don't feel well. To fix it add the fontHeight setting to the gulp-iconfont configuration:
// ...
.pipe(require('gulp-iconfont')({
fontName: 'icons',
formats: ['eot', 'woff', 'woff2'],
fontHeight: 1024
}))
// ...

Related

Fontawesome always reloading icons

I upgraded from Fontawesome 3 to Fontawesome 5.
Now I got several problems. If I am just linking the font-awesome.min.css in the head, the icons are not loading. I just see squares.
If I link the all.css and tha all.js in the head, I works. So the icons are shown correctly. But everytime, I am clicking any Button and the page is realoding, it takes around half a second to reload the icons. In the previous Version it worked without the js and the icons weren't reloading at all.
I am not sure why it is behaving like this. Maybe because all the <i ...> are converted into svg?
Do you have any hints what I can do?
The class names changed.
In FontAwesome 3:
<i class="icon-thumbs-up"></i>
In FontAwesome 5:
<i class="fas fa-thumbs-up"></i>
You should look them up here and change them manually.

Which fontawesome file should I include and why others do not work

I am working on a WordPress theme and tried many times to add fontawesome icons. Finally, by adding different fontawesome CSS files I found few of them works well but not others.
Please tell me why others do not work and which one should I use.
all.min.css file shows this result.
I have used the different to see which one works. "fa/far/fad/fas"
<div class="fa-3x">
<i class="fad fa-camera"></i>
<i class="fas fa-fire-alt"></i>
<i class="fa fa-bus-alt"></i>
<i class="far fa-fill-drip"></i>
</div>
And the functions.php file where I have added the CSS file to include in the header file.
...
//FontAwesome CSS file
wp_enqueue_style( 'epostlite-fontawesome', get_template_directory_uri() . '/fontawesome/css/all.min.css' );
...
I used version 5
Why "fad" and "far" shows a rectangle instead of the icon?
Why "fontawesome.min.css" and "brands.min.css do not work?
Why "fad" and "far" shows a rectangle instead of the icon?
Because fad & far are pro icons so both will not work in free version.
Why "fontawesome.min.css" and "brands.min.css do not work?
This both will work but you need to add one more css, which is
wp_enqueue_style('font-awesome-solid', get_template_directory_uri() . '/assets/css/font-awesome5/solid.min.css');
after adding solid.min.css you will get same result as all.min.css
But preferable is if you are using font awesome version 5 then just use all.min.css, no need to include all of them differently. you can check it from here.
Instead adding more & differrent kind of css you can fix the problem in less then 2 mins. Simple replacement of /font-awesome/5.13.0/css/fontawesome.min.css with /font-awesome/5.13.0/css/all.min.css and also font-awesome/5.13.0/js/fontawesome.min.js with /font-awesome/5.13.0/js/all.min.js can fix this issue. I prefer to use cdnjs
https://youtu.be/_GV_pEmLCLU

Using font awesome in codepen

I'm trying to add the styles sheet for font-awesome into a Codepen but seem to be getting nowhere, can anybody help please.
Codepen (https://codepen.io/kellett/pen/YreKaW)
Below is the styles sheet I've inserted in the top of HTML page.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
It's working, you just are using the wrong font-awesome class.
Line 19 should be <span class="fa fa-search"></span>.
See this updated CodePen
Note: You can also add CDNs in the CodePen settings so you don't have to include it inline in your html.
simply add this http://static.fontawesome.com/css/fontawesome-app.css in css setting panel:
you are using wrong . Check this
<span class="fa fa-search"></span> use like this instead of <span class="fa-search"></span>.
Go to Settings on the top right-hand corner. Then paste the CDN code in the box that says "Stuff for <head>." Press Save and Close before adding your Font Awesome tags, which should be formatted like this:
<i class="fa fa-thumbs-up"></i>
Here's the CodePen. You should see a thumbs up icon on the bottom of the page:
https://codepen.io/calumchilds/pen/boLwVb
Hope this helps!
Add this link into js setting:
https://use.fontawesome.com/4d74086fc6.js.
Open settings.
On the Pen Settings modal, select the CSS tab
In the "Add External Stylesheets/Pens" section, search for font-awesome.

Font Awesome and Material Icons used in ngFor (Angular 2)

I have a dynamic list of Icons that are displayed in a right side bar. The Icons are passed into the sidebar depending on what the user does. This dynamic array of icons is displayed using ngFor.
Unfortunately, some of the icons are from Font Awesome and some are from Google Material.
<!--Font Awesome-->
<i class="{{myIcon}}"></i>
<!--Material-->
<md-icon>{{myIcon}}></md-icon>
<!--Or-->
<i class="material-icon">{{myIcon}}</i>
Seeing that they are not an exact match, how do you get them to display both kinds using an ngFor with nothing but the string of the icon's name.
I have a solution for you. I just implemented exactly this.
Now I know you asked for just what goes between the *ngFor to dynamically select and render the appropriate icon based on the icon string, but I am going to document the complete solution including getting font awesome registered, for others.
Let us start at the top by making sure you have font awesome css included in your header. You can have fontawesome email you a link to their CDN version here http://fontawesome.io/get-started/ and include this in your header.
<script src="https://use.fontawesome.com/c26638a4cc.js"></script>
Next create and register an alias for fontawesome in your app.module. You can do this by first importing these:
import { MdIconModule, MdIconRegistry } from '#angular/material';
Don't forget to include MdIconRegistry in your providers
providers: [
...
MdIconRegistry,
...
],
Then let us register fontawesome with MdIconRegistry in our AppModule like so..
constructor(...,
public mdIconRegistry: MdIconRegistry) {
mdIconRegistry.registerFontClassAlias('fontawesome', 'fa');
...
}
What we have done so far allows us to use font awesome icons in our application as follows:
<md-icon class="some-class" fontSet="fa" fontIcon="fa-trophy"></md-icon>
Now let us answer the original question i.e. how to dynamically display either a material design icon or a font-awesome icon based on just the icon string.
To do this, I am going to rely on font-awesome icons starting with a 'fa-' prefix. If we are good with this, then I can check for 'fa-' and use that to set fontSet and fontIcon appropriately.
<md-list-item *ngFor="let menuitem of menuList">
<button md-button ...>
<md-icon [fontSet]="menuitem.icon.substr(0,3) === 'fa-' ? 'fa' : ''"
[fontIcon]="menuitem.icon.substr(0,3) === 'fa-' ? menuitem.icon : ''"
[ngClass]="{'your-fa-custom-class': true }">
<span>{{ menuitem.name }} </span>
</button>
ngClass includes .your-fa-custom-class where you can change the font-size for your font awesome icons specifically.
You are all set!

Glyph shows over pull down menu

I am updating an Angular app to use Bootstrap 3 glyphicons instead of some images, and have run into the following difficulty:
I have this glyph in a view that's in my content section:
<i class="glyphicon glyphicon-play"></i>
and this one in a pull-down menu:
<i class="glyphicon glyphicon-log-out"></i>
It seems that when I pull down the menu, the "-play" glyph is not hidden and still shows through it.
I'm not 100% sure what the issue is without seeing more of your code, but you could add some quick jQuery to show/hide the appropriate icon on click.
$('.the-dropdown').on('click', function() {
$('i.glyphicon-play').hide();
});

Resources