Commit Graph

21 Commits

Author SHA1 Message Date
hellofromTonya
8c4c35311b Introduce font-face styles generator and printer.
Introducing Font Face, a server-side `@font-face` styles generator and printer. 

tl;dr:
* Introduces Font Face.
* Deprecates `_wp_theme_json_webfonts_handler()`.

**Introduce Font Face**

From an array of fonts (i.e. each font-family and its font variations to be processed), it:

1. Validates each `font-face` declaration, i.e. the CSS property and value pairing. If validation fails, processing stops with no font-face styles printed.
3. Generates the `@font-face` CSS for each font-family.
4. Prints the CSS within a `<style id="wp-fonts-local">` element.

The entry point into Font Face is through a new global function called `wp_print_font_faces()`, which is automatically called:

* when the `'wp_head'` hook runs (for the front-end).
* when the `'admin_print_styles'` hook runs (for the back-end).
* when `_wp_get_iframed_editor_assets()` runs to inject the `@font-face` styles into the iframed editor.

Once called, it gets the fonts from Theme_JSON merged data layer, which includes theme defined fonts and user activated fonts (once the Font Library #59166 is introduced into Core).

For classic sites, themes and plugins can directly call `wp_print_font_faces()` and pass their fonts array to it for processing.

**Deprecates `_wp_theme_json_webfonts_handler()`.**

As Font Face is a direct replacement, the stopgap code in `_wp_theme_json_webfonts_handler()` (introduced in 6.0.0 via [53282]) is deprecated and unused in Core.

**Props note:**
There's a long multiple year history baked into Font Face, which dates back to the early versions of a web font API (see #46370 and [https://github.com/WordPress/gutenberg/issues/41479 roadmap]. The props list includes those who contributed from those early versions up to this commit.

**References:**
* #46370 original (Web)Fonts API proposal for registering and enqueuing web fonts.
* [https://github.com/WordPress/gutenberg/issues/41479 Gutenberg tracking issue] which includes the evolution from Webfonts API to Fonts API to Font Face.
* [53282] / #55567 Added the stopgap code `_wp_theme_json_webfonts_handler()` in 6.0.
* [https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face @font-face on mdn web docs]
* #59166 Font Library: Font manager for WordPress

Follow-up to [53282].

Props aristath, jonoaldersonwp, hellofromTonya, andraganescu, annezazu, antonvlasenko, arena, askdesign, azaozz, bph, bradley2083, colorful-tones, costdev, davidbaumwald, desrosj, dingo_d, djcowan, domainsupport, dryanpress, elmastudio, flixos90, francina, garrett-eclipse, gigitux, grantmkin, grapplerulrich, gziolo, ironprogrammer, jb510, jeffpaul, jeremyyip, jffng, joostdevalk, jorgefilipecosta, juanmaguitar, mamaduka, matveb, mburridge, mitogh, ndiego, ntsekouras, oandregal, ocean90, oglekler, paaljoachim, pagelab, peterwilsoncc, poena, priethor, scruffian, SergeyBiryukov, shiloey, simison, skorasaurus, soean, westonruter, wildworks, zaguiini.
Fixes #59165.
Built from https://develop.svn.wordpress.org/trunk@56500


git-svn-id: http://core.svn.wordpress.org/trunk@56012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-08-31 21:49:20 +00:00
desrosj
c482c8e8ad Administration: Reverse the arrow direction for database import/export icons.
In [48456], database import and export icons were introduced. However, the arrows were pointing in the wrong directions. This reverses the arrows to be pointing correctly based on the action described in the name.

Props johnbillion, joen, desrosj, empireoflight.
Fixes #49913.
Built from https://develop.svn.wordpress.org/trunk@48506


git-svn-id: http://core.svn.wordpress.org/trunk@48268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-17 17:11:03 +00:00
desrosj
5121beae78 Administration: Update Dashicons to the latest version.
This update introduces the following new icons:

- `.dashicons-align-pull-left (f10a)`
- `.dashicons-align-pull-right (f10b)`
- `.dashicons-block-default (f12b)`
- `.dashicons-cloud-saved (f137)`
- `.dashicons-cloud-upload (f13b)`
- `.dashicons-columns (f13c)`
- `.dashicons-cover-image (f13d)`
- `.dashicons-embed-audio (f13e)`
- `.dashicons-embed-generic (f13f)`
- `.dashicons-embed-photo (f144)`
- `.dashicons-embed-post (f146)`
- `.dashicons-embed-video (f149)`
- `.dashicons-exit (f14a)`
- `.dashicons-html (f14b)`
- `.dashicons-info-outline (f14c)`
- `.dashicons-insert-after (f14d)`
- `.dashicons-insert-before (f14e)`
- `.dashicons-remove (f14f)`
- `.dashicons-shortcode (f150)`
- `.dashicons-table-col-after (f151)`
- `.dashicons-table-col-before (f152)`
- `.dashicons-table-col-delete (f15a)`
- `.dashicons-table-row-after (f15b)`
- `.dashicons-table-row-before (f15c)`
- `.dashicons-table-row-delete (f15d)`
- `.dashicons-saved (f15e)`
- `.dashicons-airplane (f15f)`
- `.dashicons-amazon (f162)`
- `.dashicons-bank (f16a)`
- `.dashicons-beer (f16c)`
- `.dashicons-bell (f16d)`
- `.dashicons-calculator (f16e)`
- `.dashicons-coffee (f16f)`
- `.dashicons-database-add (f170)`
- `.dashicons-database-export (f17a)`
- `.dashicons-database-import (f17b)`
- `.dashicons-database-remove (f17c)`
- `.dashicons-database-view (f17d)`
- `.dashicons-database (f17e)`
- `.dashicons-drumstick (f17f)`
- `.dashicons-edit-page (f186)`
- `.dashicons-food (f187)`
- `.dashicons-fullscreen-alt (f188)`
- `.dashicons-fullscreen-exit-alt (f189)`
- `.dashicons-games (f18a)`
- `.dashicons-google (f18b)`
- `.dashicons-hourglass (f18c)`
- `.dashicons-linkedin (f18d)`
- `.dashicons-money-alt (f18e)`
- `.dashicons-open-folder (f18f)`
- `.dashicons-pdf (f190)`
- `.dashicons-pets (f191)`
- `.dashicons-pinterest (f192)`
- `.dashicons-printer (f193)`
- `.dashicons-privacy (f194)`
- `.dashicons-reddit (f195)`
- `.dashicons-spotify (f196)`
- `.dashicons-superhero-alt (f197)`
- `.dashicons-superhero (f198)`
- `.dashicons-twitch (f199)`
- `.dashicons-whatsapp (f19a)`
- `.dashicons-youtube (f19b)`
- `.dashicons-car (f16b)`
- `.dashicons-podio (f19c)`
- `.dashicons-xing (f19d)`


This update is the final planned update of the Dashicons font. Moving forward, the more modern approach of using SVG icons directly (as the block editor currently does) will be explored. More information on the future of Dashicons can be found on the Make Design blog: https://make.wordpress.org/design/2020/04/20/next-steps-for-dashicons/.

Props joen, johnjamesjacoby, empireoflight, youknowriad, netweb, zodiac1978, desrosj, automaton, chrisvanpatten.
Fixes #49913.
Built from https://develop.svn.wordpress.org/trunk@48456


git-svn-id: http://core.svn.wordpress.org/trunk@48225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-13 14:26:04 +00:00
desrosj
f9de2f860d Administration: Fix Dashicon backwards compatibility issues.
In [44940], the Dashicon files in core were updated to contain the latest version of the font from the GitHub repo. This change follows that up by fixing several backwards compatibility issues caused by the new build process used to generate the font files and fixes the missing menu icon when viewing the admin on small screens.

- `buddicons-bbpress-logo (f12b)` was moved back to the correct location of `f477`.
- `editor-ltr (f129)` was moved back to the correct location of `f10c`.
- `email-alt2 (f10a)` was moved to the correct location of `f467`. 

The following icons were restored to their previous locations:

- `camera-alt (f129)`
- `edit-large (f327)`
- `editor-distractionfree (f211)`
- `update-alt (f113)`
- `twitter-alt (f302)`
- `text-page (f121)`
- `plugins-checked (f485)`
- `menu-alt3 (f349)`
- `menu-alt2 (f329)`
- `menu-alt (f228)`
- Duplicate lock icon at location `f315`
- Duplicate `editor-code` icon at location `f494`
- `arrow-up` at `f143`.

The `editor-ltr` and `editor-rtl` icons had also been switched. The arrows now point in the correct directions at the correct Unicode locations (`f10c` and `f320` respectively).

And, lastly, this change also introduces the `code-standards (f13a)` icon that was not included in the previous build.

Props afercia, earnjam, oztaser, joen, cathibosco1, ianbelanger, desrosj.
See #41074.
Fixes #46611.
Built from https://develop.svn.wordpress.org/trunk@45040


git-svn-id: http://core.svn.wordpress.org/trunk@44849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 19:59:52 +00:00
desrosj
8baa737840 Administration: Update Dashicons to the latest version.
This change introduces the following new icons to the Dashicon font:

- `.dashicons-admin-site-alt (f11d)`
- `.dashicons-admin-site-alt2 (f11e)`
- `.dashicons-admin-site-alt3 (f11f)`
- `.dashicons-buddicons-activity (f452)`
- `.dashicons-buddicons-bbpress-logo (f12b)`
- `.dashicons-buddicons-buddypress-logo (f448)`
- `.dashicons-buddicons-community (f453)`
- `.dashicons-buddicons-forums (f449)`
- `.dashicons-buddicons-friends (f454)`
- `.dashicons-buddicons-groups (f456)`
- `.dashicons-buddicons-pm (f457)`
- `.dashicons-buddicons-replies (f451)`
- `.dashicons-buddicons-topics (f450)`
- `.dashicons-buddicons-tracking (f455)`
- `.dashicons-businessperson (f12e)`
- `.dashicons-businesswoman (f12f)`
- `.dashicons-color-picker (f131)`
- `.dashicons-editor-ltr (f129)`
- `.dashicons-editor-ol-rtl (f12c)`
- `.dashicons-email-alt2 (f10a)`
- `.dashicons-instagram (f12d)`
- `.dashicons-menu-alt (f10b)`
- `.dashicons-rest-api (f124)`
- `.dashicons-yes-alt (f12a)`
- `.dashicons-tide (f10d)`

These icons were added to the `.ttf, ` and `.eot` font files, as well as the SVG sprite. However, they were not added to the `.woff` font file. The new `dashicons.woff2` file should be utilized instead.

For instances where IE<11 needs to be supported, the `.woff` file will remain for backwards compatibility. However, if the new icons are needed in those scenarios, the WOFF format is now included as embedded within the `dashicons.css`.

Props EmpireOfLight, liljimmi, jaymanpandya, netweb, melchoyce, joen, folletto, nateallen, bahia0019, JeffPaul, desrosj, cathibosco1.
Fixes #41074. 
Built from https://develop.svn.wordpress.org/trunk@44940


git-svn-id: http://core.svn.wordpress.org/trunk@44771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-20 15:44:00 +00:00
Mel Choyce
04c2d5d253 Dashicons: Fix incorrect ID in SVG version of font.
See #34221.

Built from https://develop.svn.wordpress.org/trunk@37037


git-svn-id: http://core.svn.wordpress.org/trunk@37004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-18 20:43:26 +00:00
Mel Choyce
02523f91c2 Dashicons: Update to the latest files.
Updates .dashicons-googleplus (f462) and adds three new icons, .dashicons-move (f545), .dashicons-laptop (f547), and .dashicons-paperclip (f546).

Props liljimmi, melchoyce, empireoflight, aargh-a-knot.
See #34221.

Built from https://develop.svn.wordpress.org/trunk@37036


git-svn-id: http://core.svn.wordpress.org/trunk@37003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-18 20:26:26 +00:00
Dominik Schilling
aa8229a868 Dashicons: Fix font ID in SVG file.
see #33084.
Built from https://develop.svn.wordpress.org/trunk@33394


git-svn-id: http://core.svn.wordpress.org/trunk@33362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-23 10:03:24 +00:00
Mark Jaquith
8d72575b00 Fix vertical alignment of the eye in the "hidden" dashicon to match "visibility".
fixes #33084
props empireoflight, liljimmi
Built from https://develop.svn.wordpress.org/trunk@33373


git-svn-id: http://core.svn.wordpress.org/trunk@33345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-23 03:02:24 +00:00
Dominik Schilling
34eb53b4e6 Dashicons: Update to the latest files.
Revert the updates to .dashicons-plus (f132) in [33108] and instead introduce a new icon, .dashicons-plus-alt2 (f543).

props liljimmi, melchoyce, empireoflight.
see #30902.
Built from https://develop.svn.wordpress.org/trunk@33126


git-svn-id: http://core.svn.wordpress.org/trunk@33097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-08 19:38:25 +00:00
Dominik Schilling
7bbf64a2b9 Dashicons: Update to the latest files.
New icons:
* .dashicons-admin-customizer (f540)
* .dashicons-admin-multisite (f541)
* .dashicons-editor-table (f535)
* .dashicons-filter (f536)
* .dashicons-hidden (f530)
* .dashicons-image-filter (f533)
* .dashicons-image-rotate (f531)
* .dashicons-layout (f538)
* .dashicons-sticky (f537)
* .dashicons-thumbs-down (f542)
* .dashicons-thumbs-up (f529)
* .dashicons-unlock (f528)
* .dashicons-warning (f534)

Updated icons:
* .dashicons-plus (f132)
* .dashicons-yes (f147)

props liljimmi, melchoyce, empireoflight.
fixes #30902.
Built from https://develop.svn.wordpress.org/trunk@33108


git-svn-id: http://core.svn.wordpress.org/trunk@33079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-07 16:03:26 +00:00
Dominik Schilling
2428fce4ed Dashicons: Update to the latest files.
New icons:
* .dashicons-controls-play (f522)
* .dashicons-controls-pause (f523)
* .dashicons-controls-forward (f519)
* .dashicons-controls-skipforward (f517)
* .dashicons-controls-back (f518)
* .dashicons-controls-skipback (f516)
* .dashicons-controls-repeat (f515)
* .dashicons-controls-volumeon (f521)
* .dashicons-controls-volumeoff (f520)
* .dashicons-phone (f525)
* .dashicons-building (f512)
* .dashicons-store (f513)
* .dashicons-album (f514)
* .dashicons-palmtree (f527)
* .dashicons-tickets-alt (f524)
* .dashicons-money (f526)

Updated icons:
* .dashicons-align-left (f135)
* .dashicons-align-right (f136)
* .dashicons-align-center (f134)
* .dashicons-align-none (f138)

props liljimmi, melchoyce, empireoflight.
fixes #29444.
Built from https://develop.svn.wordpress.org/trunk@30797


git-svn-id: http://core.svn.wordpress.org/trunk@30787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-09 19:34:23 +00:00
Dominik Schilling
b40bf05ef5 Dashicons: Update to the latest dashicons files.
New icons:
* .dashicons-calendar-alt (f508)
* .dashicons-carrot (f511)
* .dashicons-grid-view (f509)
* .dashicons-index-card (f510)

props liljimmi, melchoyce, empireoflight.
see #27844.
Built from https://develop.svn.wordpress.org/trunk@29520


git-svn-id: http://core.svn.wordpress.org/trunk@29296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-17 15:01:16 +00:00
Dominik Schilling
771fcb128a Update Dashicons.
New icons: `.dashicons-external`, `.dashicons-editor-contract` and `.dashicons-universal-access-alt`.
Updated icons: `.dashicons-code`, `.dashicons-universal-access`, `.dashicons-arrow-x-alt` and `.dashicons-arrow-x-alt2`.
Restores also `.dashicons-post-trash` as an alias for `.dashicons-trash`, which is the new one.

props melchoyce, empireoflight.
see #26936.
Built from https://develop.svn.wordpress.org/trunk@27989


git-svn-id: http://core.svn.wordpress.org/trunk@27819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 17:52:16 +00:00
Dominik Schilling
6dd40a18d4 Update Dashicons.
* Includes new Media icons, see #26650.
* Includes icons for clipboard, megaphone, schedule, tickets, nametag, universal-access, microphone and <3.
* Includes icon for randomize, see #21785.
* Updates Google+ icon, fixes #26851.

props melchoyce, empireoflight.
see #26936.
Built from https://develop.svn.wordpress.org/trunk@27705


git-svn-id: http://core.svn.wordpress.org/trunk@27544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-25 12:05:16 +00:00
Andrew Nacin
833c8e5419 Widgets dashicons update.
props melchoyce, michael-arestad, empireoflight.
see #26936.

Built from https://develop.svn.wordpress.org/trunk@27468


git-svn-id: http://core.svn.wordpress.org/trunk@27313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-08 03:38:16 +00:00
Andrew Nacin
c88f57d7c0 Update Dashicons to latest. Adds line break, paragraph, code, and bbPress.
props empireoflight, melchoyce.
see #26936.

Built from https://develop.svn.wordpress.org/trunk@27061


git-svn-id: http://core.svn.wordpress.org/trunk@26934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-31 00:41:13 +00:00
Dominik Schilling
dea41019ef Dashicons: Update to the latest dashicons files.
props empireoflight, melchoyce.
see #26518 for trunk.
Built from https://develop.svn.wordpress.org/trunk@26925


git-svn-id: http://core.svn.wordpress.org/trunk@26806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-08 22:26:10 +00:00
Dominik Schilling
b25df0640a Dashicons: Update to the latest dashicons files.
props empireoflight, melchoyce.
fixes #26362.
Built from https://develop.svn.wordpress.org/trunk@26755


git-svn-id: http://core.svn.wordpress.org/trunk@26643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-06 23:46:10 +00:00
Dion Hulse
096fe2d4f0 Dashicons: Update to the latest dashicons files. Fixes #26251
These are imported from 9d78124720 [2013-11-25T11:03:44-08:00]


Built from https://develop.svn.wordpress.org/trunk@26378


git-svn-id: http://core.svn.wordpress.org/trunk@26278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-26 02:04:09 +00:00
Helen Hou-Sandí
69d432410a Say hello to a fresh new look for the WordPress admin.
Still to come: more color schemes, a responsive component, and more.

see #25858.
props iammattthomas, tillkruess, EmpireOfLight, melchoyce, ryelle, joen, mitchoyoshitaka, sirbrillig, andypeatling, isaackeyet, Otto42, dd32, matt, helen.

Built from https://develop.svn.wordpress.org/trunk@26072


git-svn-id: http://core.svn.wordpress.org/trunk@25992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-10 00:27:10 +00:00