All Projects → BTBurke → Svg Embed Font

BTBurke / Svg Embed Font

Licence: mit
A tool to embed font files in SVG so they will render properly across all devices

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Svg Embed Font

Official Bash Logo
Everything you need to start using the official GNU Bash logo
Stars: ✭ 89 (+61.82%)
Mutual labels:  svg, font
Linearicons
Linearicons is the highest quality set of line icons, matching with minimalist UI designs in iOS.
Stars: ✭ 64 (+16.36%)
Mutual labels:  svg, font
Fontello Svg
Generate SVG icons from a Fontello icon set.
Stars: ✭ 59 (+7.27%)
Mutual labels:  svg, font
Devicon
Set of icons representing programming languages, designing & development tools
Stars: ✭ 4,536 (+8147.27%)
Mutual labels:  svg, font
Svelte Awesome
Awesome SVG icon component for Svelte JS, built with Font Awesome icons. Based on Justineo/vue-awesome
Stars: ✭ 193 (+250.91%)
Mutual labels:  svg, font
Zfont
💬 Text plugin for Zdog - works with any .ttf font!
Stars: ✭ 126 (+129.09%)
Mutual labels:  svg, font
Govicons
🇺🇸 US Government themed icons and CSS toolkit
Stars: ✭ 60 (+9.09%)
Mutual labels:  svg, font
Coreui Icons
CoreUI Free Icons - Premium designed free icon set with marks in SVG, Webfont and raster formats
Stars: ✭ 1,813 (+3196.36%)
Mutual labels:  svg, font
Picasso
Picasso is a high quality 2D vector graphic rendering library. It support path , matrix , gradient , pattern , image and truetype font.
Stars: ✭ 205 (+272.73%)
Mutual labels:  svg, font
Yii2 Widget Rating
A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)
Stars: ✭ 47 (-14.55%)
Mutual labels:  svg, font
React Icomoon
It allows you to simply view the icons in the selection.json file provided by Icomoon.
Stars: ✭ 48 (-12.73%)
Mutual labels:  svg
Imagine Svg
Contao Imagine SVG Library
Stars: ✭ 48 (-12.73%)
Mutual labels:  svg
Svg Snippets
🔰 A set of custom SVG snippets for Sublime Text 2/3
Stars: ✭ 50 (-9.09%)
Mutual labels:  svg
React Native Svg Image
Load SVG images from network; Does not work with local svgs
Stars: ✭ 53 (-3.64%)
Mutual labels:  svg
Open Relay
Free and open source fonts from Kreative Software
Stars: ✭ 48 (-12.73%)
Mutual labels:  font
Dompdf
HTML to PDF converter for PHP
Stars: ✭ 8,446 (+15256.36%)
Mutual labels:  font
Hack Font Ligature Nerd Font
Nerd font patched Hack font with ligatures
Stars: ✭ 48 (-12.73%)
Mutual labels:  font
Vue Svg Map
A set of Vue.js components to display an interactive SVG map
Stars: ✭ 48 (-12.73%)
Mutual labels:  svg
Font Awesome Php
A PHP library for Font Awesome 4.7.
Stars: ✭ 47 (-14.55%)
Mutual labels:  font
React Native Svg Asset Plugin
Asset plugin for importing SVG images in React Native
Stars: ✭ 55 (+0%)
Mutual labels:  svg

Embed Fonts in SVG Assets

SVG is useful for device-independent resolution, but can often be a pain because fonts must be embedded in the file to render properly across all browsers. svg-embed-font is a command line tool to easily determine what fonts are used in an SVG file and encode them as Base64 assets within it.

If your SVG assets look great on your computer and messed up on everyone else's, it's because the fonts aren't embedded properly in the file.

Usage

svg-embed-font input.svg

In the default mode, the tool will scan the SVG file for all font-family declarations then attempt to locate matching font files (any font file format). Matches are defined as a case-insensitive substring match for the font family name ignoring any spaces. So if you declare:

font-family: 'Permanent Marker'

Matches:
permanentmarker.ttf
PermanentMarker-700.otf

In this case, there are two possible matches, which can often happen when a font comes in multiple weights. To specify which should be used, list the font on the command line after the input file. Multiple possible matches must be resolved by listing the correct one on the command line.

svg-embed-font input.svg permanentmarker.ttf

One or more preferred font files can be listed on the command line and it will use those files instead of any other matches it finds.

Font File Path Search

If you don't specify the exact font files, it will look in the current directory and all subdirectories for a match, so you can lay out your files in a logical hierarchy and it will find them. If it exhausts all possible files without finding a match to every font in the SVG file, it will return an error.

How It Works

The font file is Base64 encoded and included as a stylesheet asset directly in the SVG file. If you open the file in a text editor, right before the closing </defs> tag you will see something like the following for each font:

<style type="text/css">
	<![CDATA[
		@font-face {
			font-family: 'Permanent Marker';
			src: url('data:application/x-font-ttf;base64,AAEAAAAOAIAAAwBgT1MvMmH1Ke...<lots more>');
		}
	]]>
</style>

Installation

Download the release appropriate for your operating system on the releases page.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].