Upgrade to FontAwesome 5 (take two) (#6673)

Upgrade to FontAwesome 5 (take two) (#6673)

  • Add missing icons to set

  • Revert FA5 revert

This reverts commit 42572ff

  • use new SVG syntax in locales

  • Noscript page changes (remove login button, center “powered by” footer text)

  • Cast wider net for SVG icons in settings

  • include any _icon setting for SVG registry (offers better support for plugin settings)

  • let themes store multiple pipe-delimited icons in a setting

  • also replaces broken onebox image icon with SVG reference in cooked post processor

  • interpolate icons in locales

  • Fix composer whisper icon alignment

  • Add support for stacked icons

  • SECURITY: enforce hostname to match discourse hostname

This ensures that the hostname rails uses for various helpers always matches
the Discourse hostname

  • load SVG sprite with pre-initializers

  • FIX: enable caching on SVG sprites

  • PERF: use JSONP for SVG sprites so they are served from CDN

This avoids needing to deal with CORS for loading of the SVG

Note, added the svg- prefix to the filename so we can quickly tell in
dev tools what the file is

  • Add missing SVG sprite JSONP script to CSP

  • Upgrade to FA 5.5.0

  • Add support for all FA4.7 icons

  • adds complete frontend and backend for renamed FA4.7 icons

  • improves performance of SvgSprite.bundle and SvgSprite.all_icons

  • Fix group avatar flair preview
  • adds an endpoint at /svg-sprites/search/:keyword

  • adds frontend ajax call that pulls icon in avatar flair preview even when it is not in subset

  • Remove FA 4.7 font files
From 03deda2147ff709115f5eab6e4afd691918d1b5e Mon Sep 17 00:00:00 2001
From: Penar Musaraj <pmusaraj@gmail.com>
Date: Mon, 26 Nov 2018 16:49:57 -0500
Subject: [PATCH] Upgrade to FontAwesome 5 (take two) (#6673)

* Add missing icons to set

* Revert FA5 revert

 This reverts commit 42572ff

* use new SVG syntax in locales

* Noscript page changes (remove login button, center "powered by" footer text)

* Cast wider net for SVG icons in settings

- include any _icon setting for SVG registry (offers better support for plugin settings)

- let themes store multiple pipe-delimited icons in a setting

- also replaces broken onebox image icon with SVG reference in cooked post processor

* interpolate icons in locales

* Fix composer whisper icon alignment

* Add support for stacked icons

* SECURITY: enforce hostname to match discourse hostname

This ensures that the hostname rails uses for various helpers always matches
the Discourse hostname

* load SVG sprite with pre-initializers

* FIX: enable caching on SVG sprites

* PERF: use JSONP for SVG sprites so they are served from CDN

This avoids needing to deal with CORS for loading of the SVG

Note, added the svg- prefix to the filename so we can quickly tell in
dev tools what the file is

* Add missing SVG sprite JSONP script to CSP

* Upgrade to FA 5.5.0

* Add support for all FA4.7 icons

- adds complete frontend and backend for renamed FA4.7 icons

- improves performance of SvgSprite.bundle and SvgSprite.all_icons

* Fix group avatar flair preview

- adds an endpoint at /svg-sprites/search/:keyword

- adds frontend ajax call that pulls icon in avatar flair preview even when it is not in subset

* Remove FA 4.7 font files

diff --git a/app/assets/fonts/FontAwesome.otf b/app/assets/fonts/FontAwesome.otf
deleted file mode 100644
index 401ec0f..0000000
Binary files a/app/assets/fonts/FontAwesome.otf and /dev/null differ
diff --git a/app/assets/fonts/fontawesome-webfont.eot b/app/assets/fonts/fontawesome-webfont.eot
deleted file mode 100644
index e9f60ca..0000000
Binary files a/app/assets/fonts/fontawesome-webfont.eot and /dev/null differ
diff --git a/app/assets/fonts/fontawesome-webfont.svg b/app/assets/fonts/fontawesome-webfont.svg
deleted file mode 100644
index 855c845..0000000
--- a/app/assets/fonts/fontawesome-webfont.svg
+++ /dev/null
@@ -1,2671 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
-<svg>
-<metadata>
-Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016
- By ,,,
-Copyright Dave Gandy 2016. All rights reserved.
-</metadata>
-<defs>
-<font id="FontAwesome" horiz-adv-x="1536" >
-  <font-face 
-    font-family="FontAwesome"
-    font-weight="400"
-    font-stretch="normal"
-    units-per-em="1792"
-    panose-1="0 0 0 0 0 0 0 0 0 0"
-    ascent="1536"
-    descent="-256"
-    bbox="-1.02083 -256.962 2304.6 1537.02"
-    underline-thickness="0"
-    underline-position="0"
-    unicode-range="U+0020-F500"
-  />
-<missing-glyph horiz-adv-x="896" 
-d="M224 112h448v1312h-448v-1312zM112 0v1536h672v-1536h-672z" />
-    <glyph glyph-name=".notdef" horiz-adv-x="896" 
-d="M224 112h448v1312h-448v-1312zM112 0v1536h672v-1536h-672z" />
-    <glyph glyph-name=".null" horiz-adv-x="0" 
- />
-    <glyph glyph-name="nonmarkingreturn" horiz-adv-x="597" 
- />
-    <glyph glyph-name="space" unicode=" " horiz-adv-x="448" 
- />
-    <glyph glyph-name="dieresis" unicode="&#xa8;" horiz-adv-x="1792" 
- />
-    <glyph glyph-name="copyright" unicode="&#xa9;" horiz-adv-x="1792" 
- />
-    <glyph glyph-name="registered" unicode="&#xae;" horiz-adv-x="1792" 
- />
-    <glyph glyph-name="acute" unicode="&#xb4;" horiz-adv-x="1792" 
- />
-    <glyph glyph-name="AE" unicode="&#xc6;" horiz-adv-x="1792" 
- />
-    <glyph glyph-name="Oslash" unicode="&#xd8;" horiz-adv-x="1792" 
- />
-    <glyph glyph-name="trademark" unicode="&#x2122;" horiz-adv-x="1792" 
- />
-    <glyph glyph-name="infinity" unicode="&#x221e;" horiz-adv-x="1792" 
- />
-    <glyph glyph-name="notequal" unicode="&#x2260;" horiz-adv-x="1792" 
- />
-    <glyph glyph-name="glass" unicode="&#xf000;" horiz-adv-x="1792" 
-d="M1699 1350q0 -35 -43 -78l-632 -632v-768h320q26 0 45 -19t19 -45t-19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45t45 19h320v768l-632 632q-43 43 -43 78q0 23 18 36.5t38 17.5t43 4h1408q23 0 43 -4t38 -17.5t18 -36.5z" />
-    <glyph glyph-name="music" unicode="&#xf001;" 
-d="M1536 1312v-1120q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v537l-768 -237v-709q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89
-t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v967q0 31 19 56.5t49 35.5l832 256q12 4 28 4q40 0 68 -28t28 -68z" />
-    <glyph glyph-name="search" unicode="&#xf002;" horiz-adv-x="1664" 
-d="M1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -52 -38 -90t-90 -38q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5
-t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
-    <glyph glyph-name="envelope" unicode="&#xf003;" horiz-adv-x="1792" 
-d="M1664 32v768q-32 -36 -69 -66q-268 -206 -426 -338q-51 -43 -83 -67t-86.5 -48.5t-102.5 -24.5h-1h-1q-48 0 -102.5 24.5t-86.5 48.5t-83 67q-158 132 -426 338q-37 30 -69 66v-768q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1664 1083v11v13.5t-0.5 13
-t-3 12.5t-5.5 9t-9 7.5t-14 2.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5q0 -168 147 -284q193 -152 401 -317q6 -5 35 -29.5t46 -37.5t44.5 -31.5t50.5 -27.5t43 -9h1h1q20 0 43 9t50.5 27.5t44.5 31.5t46 37.5t35 29.5q208 165 401 317q54 43 100.5 115.5t46.5 131.5z
-M1792 1120v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47t47 -113z" />
-    <glyph glyph-name="heart" unicode="&#xf004;" horiz-adv-x="1792" 
-d="M896 -128q-26 0 -44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5q224 0 351 -124t127 -344q0 -221 -229 -450l-623 -600
-q-18 -18 -44 -18z" />
-    <glyph glyph-name="star" unicode="&#xf005;" horiz-adv-x="1664" 
-d="M1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -21 -10.5 -35.5t-30.5 -14.5q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455
-l502 -73q56 -9 56 -46z" />
-    <glyph glyph-name="star_empty" unicode="&#xf006;" horiz-adv-x="1664" 
-d="M1137 532l306 297l-422 62l-189 382l-189 -382l-422 -62l306 -297l-73 -421l378 199l377 -199zM1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -50 -41 -50q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500
-l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455l502 -73q56 -9 56 -46z" />
-    <glyph glyph-name="user" unicode="&#xf007;" horiz-adv-x="1280" 
-d="M1280 137q0 -109 -62.5 -187t-150.5 -78h-854q-88 0 -150.5 78t-62.5 187q0 85 8.5 160.5t31.5 152t58.5 131t94 89t134.5 34.5q131 -128 313 -128t313 128q76 0 134.5 -34.5t94 -89t58.5 -131t31.5 -152t8.5 -160.5zM1024 1024q0 -159 -112.5 -271.5t-271.5 -112.5
-t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5z" />
-    <glyph glyph-name="film" unicode="&#xf008;" horiz-adv-x="1920" 
-d="M384 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 320v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 704v128q0 26 -19 45t-45 19h-128
-q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 -64v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM384 1088v128q0 2

GitHub

2 Likes

:heart: