Skip to content

Commit f33989d

Browse files
fix(googleicons): sort icons for glyph subsetting (#343)
1 parent 8f7c1ee commit f33989d

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/providers/googleicons.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default defineFontProvider('googleicons', async (providerOptions: Googlei
4545

4646
async function getFontDetails(family: string, options: ResolveFontOptions<GoogleiconsFamilyOptions>) {
4747
// Google Icons require sorted icon names, or we will see a 400 error
48-
const iconNames = (options.options?.experimental?.glyphs ?? providerOptions.experimental?.glyphs?.[family])?.join('')
48+
const iconNames = (options.options?.experimental?.glyphs ?? providerOptions.experimental?.glyphs?.[family])?.toSorted().join(',')
4949

5050
let css = ''
5151

test/providers/googleicons.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('googleicons', () => {
5252
const unifont = await createUnifont([providers.googleicons({
5353
experimental: {
5454
glyphs: {
55-
'Material Symbols Outlined': ['arrow_right', 'favorite', 'arrow_drop_down'],
55+
'Material Symbols Outlined': ['bar_chart', 'bolt'],
5656
},
5757
},
5858
})])
@@ -78,8 +78,8 @@ describe('googleicons', () => {
7878
{
7979
"format": "woff2",
8080
"identifier": {
81-
"kit": "",
82-
"skey": "",
81+
"kit": "kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsLjBuVYLAPbrM4kWKE8mcwLO8rfPSFqKIVE",
82+
"skey": "b8dc2088854b122f",
8383
},
8484
},
8585
],
@@ -97,7 +97,7 @@ describe('googleicons', () => {
9797
options: {
9898
googleicons: {
9999
experimental: {
100-
glyphs: ['arrow_right', 'favorite', 'arrow_drop_down'],
100+
glyphs: ['bar_chart', 'bolt'],
101101
},
102102
},
103103
},
@@ -118,8 +118,8 @@ describe('googleicons', () => {
118118
{
119119
"format": "woff2",
120120
"identifier": {
121-
"kit": "",
122-
"skey": "",
121+
"kit": "kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsLjBuVYLAPbrM4kWKE8mcwLO8rfPSFqKIVE",
122+
"skey": "b8dc2088854b122f",
123123
},
124124
},
125125
],

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"compilerOptions": {
3-
"target": "es2022",
3+
"target": "es2023",
44
"lib": [
5-
"es2022"
5+
"es2023"
66
],
77
"moduleDetection": "force",
88
"module": "preserve",

0 commit comments

Comments
 (0)