Git Product home page Git Product logo

simple-icons-font's Introduction

Node

Simple Icons: Icon font

Free SVG icon font for popular brands. See them all on one page at SimpleIcons.org. Contributions, corrections & requests can be made on GitHub.

Build status NPM version Build status

Setup

ℹ️ We ask that all users read our legal disclaimer before using icons from Simple Icons.

CDN Setup

The font can be served from a CDN such as JSDelivr or Unpkg. Simply use the simple-icons-font NPM package and specify a version in the URL like the following:

JSDelivr

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/simple-icons-font@v11/font/simple-icons.min.css" type="text/css">

Unpkg

<link rel="stylesheet" href="https://unpkg.com/simple-icons-font@v11/font/simple-icons.min.css" type="text/css">

These examples use the latest major version. This means you won't receive any updates following the next major release. You can use @latest instead to receive updates indefinitely. However this may cause an icon to disappear if it has been removed in the latest version.

Node Setup Node

The font is also available through our npm package. To install, simply run:

npm install simple-icons-font

After installation, the icons font and stylesheet font can be found in node_modules/simple-icons-font/font. You can use your favorite bundling tool to include them into your project.

PHP Setup PHP

The font is also available through our Packagist package. To install, simply run:

composer require simple-icons/simple-icons-font

The font can then be used by linking to the stylesheet in your HTML or PHP file (see example in Manual Setup).

Manual Setup

You can also download the latest version of the package and copy the content of the font folder into your project. Then, reference the CSS file using a link tag in your HTML:

<link rel="stylesheet" href="/path/to/simple-icons.min.css" type="text/css">

Usage

Use any of the icons available in simple-icons by adding the following classes to a node in your HTML. Use the si--color class to apply the brand's color to the icon.

<i class="si si-[ICON NAME]"></i>
<i class="si si-[ICON NAME] si--color"></i>

Where [ICON NAME] is replaced by the icon name, for example:

<i class="si si-simpleicons"></i>
<i class="si si-simpleicons si--color"></i>

In this example we use the <i> tag, but any inline HTML tag should work as you expect.

simple-icons-font's People

Contributors

actions-user avatar adamrusted avatar cactysman avatar dependabot[bot] avatar developstorm avatar eburghar avatar ericcornelissen avatar github-actions[bot] avatar litomore avatar mondeja avatar renovate[bot] avatar sachinraja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simple-icons-font's Issues

Font building fails for new icons in Simple Icons

As one can see in the Travis CI build there is an issue with new SVG that are being added the Simple Icons for the font building pipeline we use.

I'm not sure about the exact details of the issue, whether it is a problem with the SVGs or with our tooling. On the one hand many of the SVGs causing trouble also don't load properly in my editing software. On the other hand these SVGs are all compressed using SVGO or SVGOMG...

I worked around this problem earlier by patching the icons that were a problem for this project but that is a bit much work (though I think we would accept pull request for it over in the main repository if anyone wants to do it...).

A solution would be help in order to keep this project up-to-date with the main project. Either fix the pipeline we use or make sure the SVGs added in the main project are compatible with the tooling here.

Suggestion: Further Default Normalization Styles

.si {
	display: inline-block;
	font-family: 'Simple Icons', sans-serif;
	font-style: normal;
	line-height: normal;
	vertical-align: middle;
}

PS: Unless I'm just being a complete dumb-dumb, the actual /font/ folder appears to be missing from the GitHub repo? I had to go to unpkg.com to find the font files and download them.

Custom builds filtering by icons

If you want to use this library to add a few icons, it becames a lot of overload in page load size because the font adds all the icons. It would be great if we can expose the build process to customize it for a few icons filtering by icon slug.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Update all dependencies (@prettier/plugin-pug, husky)

  • Check this box to trigger a request for Renovate to run again on this repository

Postinstall issues

Hi,

I'm using simple-icons-font in one of projects.

Unfortunately, after update to 4.6.0 and npm install, each time I'm getting:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `is-ci || husky install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\tomek\AppData\Roaming\npm-cache\_logs\2021-01-16T02_55_59_755Z-debug.log

This wasn't issue for 4.5.0, but after upgrade it started. I'm using postinstall in my project.

Find a approriate solution for icons too complex for fonts

As per #12 (comment) we should find a solution for icons that are too large/complex (e.g. the Elsevier icon).

Whether that is somehow getting it in the font (e.g. by reducing the complexity) or through documentation is open for discussion.

Relatedly we should look into proper error messaging when building the font and, if we stick with removing icons that are too large from the font, find a proper way to configure that, probably in an external file(?)

Set up repository labels that are in line with the main repository

Currently this repository has the default labels from GitHub, I propose updating them to be in line with the labels for the main repository. This has pretty low priority. I propose the following:


Add new labels: abandoned, docs, meta
Substitute for a out of scope label: wontfix, invalid
Labels that are definitely irrelevant to this repository: icon outdated, new icon, website
Additional labels that apply to this repository: bug, enhancement
Not sure labels (I don't think they're necessary): question, awaiting reply, release


For completion I'm also considering using the exact same colors as the main repository for the labels that are the same so it is easier to recognize them across repositories as well 🤔

Github event support

I published a wrapper for the simple icons in the flutter community, pub.dev.
The library works by running npm install simple-icons-font and converting the SimpleIcons.ttf into a dart class.

To have a fully automated build, it would be create, if we could work out a synergy, where this repo provides an event my github action can listen to, every time a new version is released (to npm).

How to use font?

Hey guys,
I'm not sure how to use font. I installed it within Angular project and I want to use now it. I assume I did proper importing to the main SCSS file.
Could you provide an example how to use it?

Thanks in advance.

Selecting an icon is somewhat clunky

Currently selecting an icon in text is a bit clunky in my opinion, see ⬇️

selecting example

I'm not at all familiar with icon-font-buildr but it seems to be the result of using ligatures. Perhaps this can be improved in some way?

Alternatively we might consider adding pointer-events: none to the .simpleicons class to discourage selecting the icons. But I'm not sure if that is really a good idea... 🤔

Increase functionality of test page

Would be interesting to have a toggle, besides light/dark background, on the test page that switches between:

  • The class variant and the ligature variant
  • Black icons and brand colored icons - #43

glyphs in font are aligned below baseline

Kind of issue

  • Improvement
  • Bug
  • Other, namely:

Description

When using the font in LaTeX, the top of the glyphs are aligned below the baseline. (See ineshbose/simple-icons-latex#2)

This is also confirmed in the browser. Just use the following preview/html/testpage.pug

doctype html
html
  head
    meta(charset='utf-8')

    link(href='font/simple-icons.css', rel='stylesheet', type='text/css')
    link(href='preview/assets/style.css', rel='stylesheet', type='text/css')

    script(src='preview/assets/script.js')

body
  header
    h1 Icon font test page

  .buttons-list
    button.background-mode Dark background
    button.icons-color Colorless icons

  p
    each icon in icons
      | i
      i.si.si--color(class='si-' + icon.slug, title=icon.name)

TTF file positioning errors in flutter export

Kind of issue

  • Improvement
  • Bug
  • Other, namely:

Description

I provide the simple_icon library for flutter and some of the users noticed that there seems to be a positioning error when it comes to the generated ttf file. (related github issue)

Can you provide information regarding the build process of the ttf file and/or look into the positioning of eg. apple and play store icon?

Add support for OTF font type

Following up on #14, if there is interest we are open to adding a OTF version of the font to the package and would appreciate any help with implementing this.

Set up a release strategy

As discussed in simple-icons/simple-icons#1307 we need to figure out a way to sync up releases of the primary NPM package with the font version. I'm currently thinking of two different approaches: 1) publish an update for simple-icons-font through the CI of simple-icons; and 2) build the font upon install.

Other suggestions and comments are welcome 😃

Publish through CI

This is the straightforward solution (in terms of how to approach this, implementing isn't that straightforward). We would need to find a way to extend the .travis.yml configuration of the main repository to publish this (and potentially other packages) when an update for the simple-icons package is published.

One way of doing this is through a bot/GitHub Actions (relevant comment).

Related issues to this are: simple-icons/simple-icons#898, simple-icons/simple-icons#770, and simple-icons/simple-icons#982

Build the font upon install

I'm not 100% sure how to achieve this, but I'm pretty sure it is possible to run a script when a dependency is installed with npm install. For example, I know gulp-imagemin runs some scripts when installing it as a dependency.

In this scenario we would add run the build script when the simple-icons-font is installed as a dependency and have simple-icons listed a dependency for simple-icons-font such that it always uses the @latest version.

This significantly simplifies the release process for simple-icons-font. The main drawback is that it is an unconventional way to provide users with updates and it might be confusing for people using simple-icons-font as a dependency. Basically, to update the package and get the latest icons one needs to npm install simple-icons-font again.

Another drawback is that I think this would make it so the package as provided by CDNs is never updated, so new icons won't become available there... 😞

Again, I don't know how feasible this approach is. I will try to get something like this working as soon as possible and report my findings here 👍

Add documentation on how to use the font

Add some general documentation on how to use the font, in a Getting started-style, to the README. If more documentation is needed I propose putting it in a new docs/ folder.

Font assets not included in PHP package

is the composer package meant to include pre-compiled css and font files? the instructions here were pretty spartan and suggestive as such. it would be pretty great if so. or are we meant to go in there and deal with npm related stuff too? asking for a friend who is not a fan of front end and who is also me.

image

Consideration: shorter class names

I'm wondering whether we should use shorter class names, this has several obvious advantages and apart from backwards compatibility no real downsides - luckily we still have two major release for breaking changes at this point (the releases corresponding to simple-icons v3 and v4).

Following Font Awesome's fa class and fa- prefixed classes I suggest we go with the si class and si- prefixed classes. The only thing I'm unsure about is the "color modifier" class (currently simpleicons--color), I'm not sure if si--color works so well but I would be happy with it if there are no other suggestions as I prefer si over simpleicons as a prefix.

Thoughts?

\cc @mondeja

ucs2 is deprecated

let nextUnicode = ucs2.decode(String.fromCodePoint(startUnicode++));

I'm getting a deprecation warning or this line in VS Code (specifically on ucs2.decode):

@deprecated
since v7.0.0 The version of the punycode module bundled in Node.js is being deprecated. In a future major version of Node.js this module will be removed. Users currently depending on the punycode module should switch to using the userland-provided Punycode.js module instead.

'ucs2' is deprecated

So I think we should look into updating this.

Regarding italics normalization

When I add an icon between em tags the geometry seems to wrap a bit to the left:

italic-icon

Could this be solved adjusting the font original properties defined in the source SVG template? Or we must add font-style: normal to prohibit explicitly from made them italic as discussed in in #161?

Overlapping names confuses ligatures and wrong icons are displayed

Have a look at the image below, you might see the logo for the C and R programming languages quite often 😕

This is because the ligature for e.g. "CoronaRenderer" (highligted in the image) contains a C and 4 R's and instead of showing the ligature for it shows 1 for the C programming language and 4 for the R programming language.

I'm not sure if fonts can be somehow tweaked to look for the longest ligatures first... One interesting observation is that the different browsers show different icons differently. For example the Corona Renderer logo doesn't show in Firefox (below) but works in Chrome.

image

Utilize new `slug` property in build script

Instead of relying on the (copied) titleToFilename function in the lib/utils.js file (which we have to keep in sync with the main repository) I propose we switch to using the newly introduced icon.slug property.

Blocked by #20 as we need the latest version of Simple Icons.

Reduce the number of available ligatures to 1 per icon

Currently the font supports three ligatures (for most) icons, limiting this to just one can reduce the size of the output font. It's not much, as the table below shows, but it only becomes more beneficial over time. Also, I don't really see a reason to support three input values for the same icon, especially with #6 in mind.

File Size before (in bytes) Size after (in bytes)
SimpleIcons.woff 222,084 216,236
SimpleIcons.woff2 192,436 188,184

Font with offset when rendering

Kind of issue

  • Improvement
  • Bug
  • Other, namely:

Description

Hello! I've noticed an issue with the TTF font.
When using the font in Flutter, there is a small offset when rendering the font. There is a small gap at the top and it goes a bit out of bounds at the bottom.
I'm not sure where the problem is exactly, but I did try to create a TTF font with icomoon.io manually with a few of the Simple Icons SVGs and it doesn't have that problem.
So there are some differences in how both TTF are generated. Any ideas?

I've tried with the TTF files in the Github, v7 and v9, both with the same problem.

Screenshot_2023-11-22-11-00-10-67_082aea295e0e2b19157fadadca43d2cc.jpg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.