From 652c00ae280d6fc6118b77d7126eaa95c72e919f Mon Sep 17 00:00:00 2001 From: Arturs Jansons Date: Mon, 16 Feb 2015 17:30:54 +0200 Subject: [PATCH] Created Merge FontAwesome with any other font (markdown) --- Merge-FontAwesome-with-any-other-font.md | 81 ++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Merge-FontAwesome-with-any-other-font.md diff --git a/Merge-FontAwesome-with-any-other-font.md b/Merge-FontAwesome-with-any-other-font.md new file mode 100644 index 0000000..04cc3ad --- /dev/null +++ b/Merge-FontAwesome-with-any-other-font.md @@ -0,0 +1,81 @@ +It is possible to merge FontAwesome to any other font, because all characters belongs to `unicode-range="U+0020-F500` - which is different cells neither popular chars at other fonts. + +As described on http://fontforge.github.io/scripting.html#Example - use following command `sfddiff.sh FontAwesome.sfd --merge FontAwesome.sfd` to merge two font files together. + +``` +#!/usr/local/bin/fontforge +#This is the sfddiff script which compares two fonts + +if ( Strtol($version) < 20060330 ) + Error( "Please upgrade to a more recent version of fontforge" ) +endif + +flags=0x789 +outfile="" + +while ( $argc > 1 && Strsub($1,0,1)=="-" ) + temp = $1 + if ( Strsub(temp,1,2)=='-' ) + temp = Strsub(temp,1) + endif + + if ( temp=="-ignorehints" ) + flags = flags & ~0x8 + elseif ( temp=="-ignorenames" ) + flags = flags & ~0x100 + elseif ( temp=="-ignoregpos" ) + flags = flags & ~0x200 + elseif ( temp=="-ignoregsub" ) + flags = flags & ~0x400 + elseif ( temp=="-ignorebitmaps" ) + flags = flags & ~0x80 + elseif ( temp=="-exact" ) + flags = flags | 0x2 + elseif ( temp=="-warn" ) + flags = flags | 0x44 + elseif ( temp=="-merge" ) + flags = flags | 0x1800 + shift + outfile = $1 + elseif ( temp=="-help" ) + Print( "sfddiff: [--version] [--help] [--usage] [--ignorehints] [--ignorenames] [--ignoregpos] [--ignoregsup] [--ignorebitmaps] [--warn] [--exact] fontfile1 fontfile2" ) + Print( " Compares two fontfiles" ) + Print( " --ignorehints: Do not compare postscript hints or truetype instructions" ) + Print( " --ignorenames: Do not compare font names" ) + Print( " --ignoregpos: Do not compare kerning, etc." ) + Print( " --ignoregsub: Do not compare ligatures, etc." ) + Print( " --ignorebitmaps: Do not compare bitmap strikes" ) + Print( " --exact: Normally sfddiff will match contours which are not exact" ) + Print( " but where the differences are slight (so you could compare" ) + Print( " truetype and postscript and get reasonable answers). Also" ) + Print( " normally sfddiff will unlink references before it compares" ) + Print( " (so you can compare a postscript font (with no references)" ) + Print( " to the original source (which does have references)). Setting") + Print( " this flag means glyphs must match exactly.") + Print( " --warn: Provides a warning when an exact match is not found" ) + Print( " --merge outfile: Put any outline differences in the backgrounds of" ) + Print( " appropriate glyphs" ) +return(0) + elseif ( temp=="-version" ) + Print( "Version 1.0" ) +return(0) + else +break + endif + shift +endloop + +if ( $argc!=3 || $1=="--usage" || $1=="-usage" ) + Print( "sfddiff: [--version] [--help] [--usage] [--ignorehints] [--ignorenames] [--ignoregpos] [--ignoregsup] [--ignorebitmaps] [--warn] [--exact] [--merge outfile] fontfile1 fontfile2" ) +return(0) +endif + +Open($2) +Open($1) +CompareFonts($2,"-",flags) +if ( outfile!="" ) + Save(outfile) +endif +``` + +https://github.com/FortAwesome/Font-Awesome/issues/4339 \ No newline at end of file