1.0.7 โ€ข Published 6 years ago

iblis-font v1.0.7

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
6 years ago

Iblis Font

Embedding SVG by creating your own font

NPM version

CSS and web font files example to easily embeded in a font your own logos or icons in SVG.

Example

The purpose is also to show how to create your own font.

๐Ÿง ย  Why

When you use javascript or typescript (with React or React Native for example) it could be difficult to display a SVG file in your app.

Many libraries exists but looks a little too much complicated to use :

๐Ÿ’ก ย  Solution

By creating your own font, you can easily use your SVG file by displaying it like normal text.

๐Ÿ“Ÿ ย  Demos

๐Ÿ“Œ ย  Install

npm install iblis-font

or

yarn install iblis-font

๐Ÿ’ป ย  Usage

Iblis-Font assume youโ€™re using webpack to process CSS and files. This package includes all necessary font files (woff, eot, ttf, svg) and a CSS file with font-face declarations pointing at these files.

You will need to have webpack setup to load css and font files. Many tools built with Webpack will work out of the box with Typefaces such as Gatsby and Create React App.

To use, simply require the package in your projectโ€™s entry file e.g.

// Load Iblis Font
require('iblis-font')

You can then display the icon by typing :



Or if you use React:

   <div style={{ fontFamily: 'Iblis' }}>
       {'\ue900'}
   </div>

If you are using react native for iOS :

In info.plist add for the key: <key>UIAppFonts</key> the value in array <string>Iblis.ttf</string>

Add the Iblis.ttf to your assets folder and lauch react-native link to link the file with your android and iOS project

How to create your own font

First you need to have your icons in SVG format

To create the font I use the online tools: IcoMoon App

You need to import your svg file

IconMoon Import

Then select all the icon your want for your font and click on generate font

Generate Font

Then in the zip you can find the fonts in the /fonts folder and the style.css

๐Ÿ•บ ย  Contribute

  1. Fork this repository to your own GitHub account and then clone it to your local device
  2. Send a pull request ๐Ÿ™Œ

๐Ÿ”จ ย  Todo

  • Add more icons

๐Ÿ’Š ย  Known issues:

  • Nothing for the moment

๐Ÿ™ ย  Thanks:

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago