Skip to content

Commit 597001a

Browse files
janhasselemyarod
andauthored
fix: update unicode ranges for IBM plex (#21748)
* fix: update unicode ranges for IBM plex * chore: update @ibm/plex * chore: run dedupe * fix(fonts/unicode): correct sass parameter type * fix(fonts/unicode): ensure backwards compatibility * fix: fix * chore(fonts/unicode): fix copyright headers * docs(fonts/unicode): clarify deprecation date * fix(fonts/unicode): update serif ranges * test(styles): add unicode-range to fonts snapshot * chore: run dedupe * chore: revert unintended dependency changes * chore: run dedupe * chore: fix copyright header --------- Co-authored-by: emyarod <emyarod@users.noreply.github.com>
1 parent b20a44b commit 597001a

11 files changed

Lines changed: 461 additions & 124 deletions

File tree

packages/styles/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@carbon/motion": "^11.44.0",
4848
"@carbon/themes": "^11.71.0",
4949
"@carbon/type": "^11.57.0",
50-
"@ibm/plex": "6.0.0-next.6",
50+
"@ibm/plex": "6.4.1",
5151
"@ibm/plex-mono": "1.1.0",
5252
"@ibm/plex-sans": "1.1.0",
5353
"@ibm/plex-sans-arabic": "1.1.0",

packages/styles/scss/fonts/__tests__/__snapshots__/fonts-test.js.snap

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ Map {
3939
"normal",
4040
"italic",
4141
},
42+
"unicodeRange": Set {
43+
"U+0400-045F, U+0462-0463, U+046A-046B, U+0472-0475, U+0490-04C2, U+04CF-04D9, U+04DC-04E9, U+04EE-04F9, U+0524-0525",
44+
"U+03C0, U+0E3F, U+2000-200D, U+2028-2029, U+202F, U+2032-2033, U+205F, U+2070, U+2074-2079, U+2080-2089, U+2113, U+2116, U+2126, U+212E, U+2150-2151, U+2153-215E, U+2190-2199, U+21A9-21AA, U+21B0-21B3, U+21B6-21B7, U+21BA-21BB, U+21C4, U+21C6, U+2202, U+2206, U+220F, U+2211, U+2215, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+2500-259F, U+25CA, U+2713, U+274C, U+2B0E-2B11, U+3000, U+FEFF, U+FFFD",
45+
"U+0102-0103, U+01CD-01DC, U+1EA0-1EF9, U+20AB",
46+
"U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF",
47+
"U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02",
48+
},
4249
"weights": Set {
4350
"300",
4451
"400",
@@ -82,6 +89,13 @@ Map {
8289
"normal",
8390
"italic",
8491
},
92+
"unicodeRange": Set {
93+
"U+0400-045F, U+0462-0463, U+046A-046B, U+0472-0475, U+0490-04C2, U+04CF-04D9, U+04DC-04E9, U+04EE-04F9, U+0524-0525",
94+
"U+0E3F, U+2000-200D, U+2015, U+2028-2029, U+202F, U+2032-2033, U+2070, U+2074-2079, U+2080-2089, U+2113, U+2116, U+2126, U+212E, U+2150-2151, U+2153-215E, U+2190-2199, U+21A9-21AA, U+21B0-21B3, U+21B6-21B7, U+21BA-21BB, U+21C4, U+21C6, U+2202, U+2206, U+220F, U+2211, U+2215, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+2713, U+274C, U+2B0E-2B11, U+ECE0, U+EFCC, U+FEFF, U+FFFD",
95+
"U+0102-0103, U+01CD-01DC, U+1EA0-1EF9, U+20AB",
96+
"U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF",
97+
"U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02",
98+
},
8599
"weights": Set {
86100
"300",
87101
"400",
@@ -125,6 +139,13 @@ Map {
125139
"normal",
126140
"italic",
127141
},
142+
"unicodeRange": Set {
143+
"U+0400-045F, U+0462-0463, U+046A-046B, U+0472-0475, U+0490-04C2, U+04CF-04D9, U+04DC-04E9, U+04EE-04F9, U+0524-0525",
144+
"U+0E3F, U+2000-200D, U+2010-2012, U+2015, U+2028-2029, U+202F, U+2032-2033, U+2070, U+2074-2079, U+2080-2089, U+2113, U+2116, U+2126, U+212E, U+2150-2151, U+2153-215E, U+2190-2199, U+21A9-21AA, U+21B0-21B3, U+21B6-21B7, U+21BA-21BB, U+21C4, U+21C6, U+2202, U+2206, U+220F, U+2211, U+2215, U+2219-221A, U+221E, U+222B, U+2236, U+2248, U+2260, U+2264-2265, U+25CA, U+2713, U+274C, U+2B0E-2B11, U+ECE0, U+EFCC, U+FEFF, U+FFFD",
145+
"U+0102-0103, U+01CD-01DC, U+1EA0-1EF9, U+20AB",
146+
"U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF",
147+
"U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02",
148+
},
128149
"weights": Set {
129150
"300",
130151
"400",

packages/styles/scss/fonts/__tests__/fonts-test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ describe('@carbon/styles/scss/fonts', () => {
5454
weights: new Set(),
5555
styles: new Set(),
5656
src: new Set(),
57+
unicodeRange: new Set(),
5758
});
5859
}
5960

@@ -71,6 +72,10 @@ describe('@carbon/styles/scss/fonts', () => {
7172
if (declaration.property === 'src') {
7273
entry.src.add(declaration.value);
7374
}
75+
76+
if (declaration.property === 'unicode-range') {
77+
entry.unicodeRange.add(declaration.value);
78+
}
7479
}
7580
}
7681

packages/styles/scss/fonts/_mono.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
@use '../config';
99
@use './src';
10-
@use './unicode';
10+
@use './unicode/mono' as unicode;
1111

1212
$font-family: 'IBM Plex Mono';
1313
$name: 'IBM-Plex-Mono';

packages/styles/scss/fonts/_sans.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
@use '../config';
99
@use './src';
10-
@use './unicode';
10+
@use './unicode/sans' as unicode;
1111

1212
$font-family: 'IBM Plex Sans';
1313
$name: 'IBM-Plex-Sans';

packages/styles/scss/fonts/_serif.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
@use '../config';
99
@use './src';
10-
@use './unicode';
10+
@use './unicode/serif' as unicode;
1111

1212
$font-family: 'IBM Plex Serif';
1313
$name: 'IBM-Plex-Serif';
Lines changed: 6 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,19 @@
11
//
2-
// Copyright IBM Corp. 2018, 2023
2+
// Copyright IBM Corp. 2018, 2026
33
//
44
// This source code is licensed under the Apache-2.0 license found in the
55
// LICENSE file in the root directory of this source tree.
66
//
77

8-
@use 'sass:map';
8+
@use './sans';
99

10-
/// All available unicode ranges where the keys are unicode range names and the
11-
/// value is the list of unicode ranges that are applicable
12-
/// @type {List}
13-
$ranges: (
14-
Cyrillic: (
15-
U+0400-045F,
16-
U+0472-0473,
17-
U+0490-049D,
18-
U+04A0-04A5,
19-
U+04AA-04AB,
20-
U+04AE-04B3,
21-
U+04B6-04BB,
22-
U+04C0-04C2,
23-
U+04CF-04D9,
24-
U+04DC-04DF,
25-
U+04E2-04E9,
26-
U+04EE-04F5,
27-
U+04F8-04F9,
28-
),
29-
Greek: (
30-
U+0384-038A,
31-
U+038C,
32-
U+038E-03A1,
33-
U+03A3-03CE,
34-
),
35-
Latin1: (
36-
U+0000,
37-
U+000D,
38-
U+0020-007E,
39-
U+00A0-00A3,
40-
U+00A4-00FF,
41-
U+0131,
42-
U+0152-0153,
43-
U+02C6,
44-
U+02DA,
45-
U+02DC,
46-
U+2013-2014,
47-
U+2018-201A,
48-
U+201C-201E,
49-
U+2020-2022,
50-
U+2026,
51-
U+2030,
52-
U+2039-203A,
53-
U+2044,
54-
U+2074,
55-
U+20AC,
56-
U+2122,
57-
U+2212,
58-
U+FB01-FB02,
59-
),
60-
Latin2: (
61-
U+0100-024F,
62-
U+0259,
63-
U+1E00-1EFF,
64-
U+20A0-20AB,
65-
U+20AD-20CF,
66-
U+2C60-2C7F,
67-
U+A720-A7FF,
68-
U+FB01-FB02,
69-
),
70-
Latin3: (
71-
U+0102-0103,
72-
U+1EA0-1EF9,
73-
U+20AB,
74-
),
75-
Pi: (
76-
U+0E3F,
77-
U+2032-2033,
78-
U+2070,
79-
U+2075-2079,
80-
U+2080-2081,
81-
U+2083,
82-
U+2085-2089,
83-
U+2113,
84-
U+2116,
85-
U+2126,
86-
U+212E,
87-
U+2150-2151,
88-
U+2153-215E,
89-
U+2190-2199,
90-
U+21A9-21AA,
91-
U+21B0-21B3,
92-
U+21B6-21B7,
93-
U+21BA-21BB,
94-
U+21C4,
95-
U+21C6,
96-
U+2202,
97-
U+2206,
98-
U+220F,
99-
U+2211,
100-
U+221A,
101-
U+221E,
102-
U+222B,
103-
U+2248,
104-
U+2260,
105-
U+2264-2265,
106-
U+25CA,
107-
U+2713,
108-
U+274C,
109-
U+2B0E-2B11,
110-
U+EBE1-EBE7,
111-
U+ECE0,
112-
U+EFCC,
113-
),
114-
);
10+
/// @deprecated Will be removed in Carbon v12. Use the exported $ranges from the ./sans, ./serif, and ./mono modules instead.
11+
$ranges: sans.$ranges;
11512

11613
/// Retrieve the unicode range for a given unicode range name
11714
/// @param {String} $name
11815
/// @returns {List}
16+
/// @deprecated Will be removed in Carbon v12. Use the exported get-range function from the ./sans, ./serif, and ./mono modules instead.
11917
@function get-range($name) {
120-
@if map.has-key($ranges, $name) {
121-
@return map.get($ranges, $name);
122-
}
123-
@error 'Unable to find range with the name: #{$name}';
18+
@return sans.get-range($name);
12419
}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
//
2+
// Copyright IBM Corp. 2026
3+
//
4+
// This source code is licensed under the Apache-2.0 license found in the
5+
// LICENSE file in the root directory of this source tree.
6+
//
7+
8+
@use 'sass:map';
9+
10+
/// All available unicode ranges where the keys are unicode range names and the
11+
/// value is the list of unicode ranges that are applicable
12+
/// @type {List}
13+
$ranges: (
14+
Cyrillic: (
15+
U+0400-045F,
16+
U+0462-0463,
17+
U+046A-046B,
18+
U+0472-0475,
19+
U+0490-04C2,
20+
U+04CF-04D9,
21+
U+04DC-04E9,
22+
U+04EE-04F9,
23+
U+0524-0525,
24+
),
25+
Latin1: (
26+
U+0020-007E,
27+
U+00A0-00FF,
28+
U+0131,
29+
U+0152-0153,
30+
U+02C6,
31+
U+02DA,
32+
U+02DC,
33+
U+2013-2014,
34+
U+2018-201A,
35+
U+201C-201E,
36+
U+2020-2022,
37+
U+2026,
38+
U+2030,
39+
U+2039-203A,
40+
U+2044,
41+
U+20AC,
42+
U+2122,
43+
U+2212,
44+
U+FB01-FB02,
45+
),
46+
Latin2: (
47+
U+0100-0101,
48+
U+0104-0130,
49+
U+0132-0151,
50+
U+0154-017F,
51+
U+018F,
52+
U+0192,
53+
U+01A0-01A1,
54+
U+01AF-01B0,
55+
U+01FA-01FF,
56+
U+0218-021B,
57+
U+0237,
58+
U+0259,
59+
U+1E80-1E85,
60+
U+1E9E,
61+
U+20A1,
62+
U+20A4,
63+
U+20A6,
64+
U+20A8-20AA,
65+
U+20AD-20AE,
66+
U+20B1-20B2,
67+
U+20B4-20B5,
68+
U+20B8-20BA,
69+
U+20BD,
70+
U+20BF,
71+
),
72+
Latin3: (
73+
U+0102-0103,
74+
U+01CD-01DC,
75+
U+1EA0-1EF9,
76+
U+20AB,
77+
),
78+
Pi: (
79+
U+03C0,
80+
U+0E3F,
81+
U+2000-200D,
82+
U+2028-2029,
83+
U+202F,
84+
U+2032-2033,
85+
U+205F,
86+
U+2070,
87+
U+2074-2079,
88+
U+2080-2089,
89+
U+2113,
90+
U+2116,
91+
U+2126,
92+
U+212E,
93+
U+2150-2151,
94+
U+2153-215E,
95+
U+2190-2199,
96+
U+21A9-21AA,
97+
U+21B0-21B3,
98+
U+21B6-21B7,
99+
U+21BA-21BB,
100+
U+21C4,
101+
U+21C6,
102+
U+2202,
103+
U+2206,
104+
U+220F,
105+
U+2211,
106+
U+2215,
107+
U+221A,
108+
U+221E,
109+
U+222B,
110+
U+2248,
111+
U+2260,
112+
U+2264-2265,
113+
U+2500-259F,
114+
U+25CA,
115+
U+2713,
116+
U+274C,
117+
U+2B0E-2B11,
118+
U+3000,
119+
U+FEFF,
120+
U+FFFD,
121+
),
122+
);
123+
124+
/// Retrieve the unicode range for a given unicode range name
125+
/// @param {String} $name
126+
/// @returns {List}
127+
@function get-range($name) {
128+
@if map.has-key($ranges, $name) {
129+
@return map.get($ranges, $name);
130+
}
131+
@error 'Unable to find range with the name: #{$name}';
132+
}

0 commit comments

Comments
 (0)