Skip to content

Commit

Permalink
Merge pull request #11599 from bbc/WSTEAM1-1005-gujarati-telugu-fonts
Browse files Browse the repository at this point in the history
WSTEAM1-1005: Gujarati Telugu font updates
  • Loading branch information
Isabella-Mitchell committed May 23, 2024
2 parents 766b8df + e8b1279 commit 289302e
Show file tree
Hide file tree
Showing 31 changed files with 270 additions and 65 deletions.
123 changes: 113 additions & 10 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<link
rel="preload"
href="fonts/ReithQalam/normal.woff2"
Expand Down Expand Up @@ -551,6 +550,70 @@
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansTelugu/normal.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansTelugu/normal.woff"
as="font"
type="font/woff"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansTelugu/normal.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansTelugu/normal.eot"
as="font"
type="font/eot"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansTelugu/bold.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansTelugu/bold.woff"
as="font"
type="font/woff"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansTelugu/bold.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansTelugu/bold.eot"
as="font"
type="font/eot"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansTamil/normal.woff2"
Expand Down Expand Up @@ -617,71 +680,111 @@

<link
rel="preload"
href="fonts/NotoSansEthiopic/normal.woff"
href="fonts/NotoSansGujarati/normal.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansGujarati/normal.woff"
as="font"
type="font/woff"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansEthiopic/normal.ttf"
href="fonts/NotoSansGujarati/normal.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansEthiopic/normal.eot"
href="fonts/NotoSansGujarati/normal.eot"
as="font"
type="font/eot"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansEthiopic/bold.woff"
href="fonts/NotoSansGujarati/bold.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansGujarati/bold.woff"
as="font"
type="font/woff"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansEthiopic/bold.ttf"
href="fonts/NotoSansGujarati/bold.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansEthiopic/bold.eot"
href="fonts/NotoSansGujarati/bold.eot"
as="font"
type="font/eot"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansEthiopic/normal.woff"
as="font"
type="font/woff"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansEthiopic/normal.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/NotoSansEthiopic/normal.eot"
as="font"
type="font/eot"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/Mallanna/normal.woff"
href="fonts/NotoSansEthiopic/bold.woff"
as="font"
type="font/woff"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/Mallanna/normal.ttf"
href="fonts/NotoSansEthiopic/bold.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>

<link
rel="preload"
href="fonts/Mallanna/normal.eot"
href="fonts/NotoSansEthiopic/bold.eot"
as="font"
type="font/eot"
crossorigin="anonymous"
Expand Down
41 changes: 37 additions & 4 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,42 @@ const NOTO_SANS_TAMIL_BOLD = {
},
};

const MALLANNA_REGULAR = {
const NOTO_SANS_TELUGU_REGULAR = {
'@font-face': {
fontFamily: 'Mallanna',
fontFamily: 'Noto Sans Telugu',
fontWeight: 400,
fontStyle: 'normal',
src: `url('fonts/Mallanna/normal.woff') format('woff'), url('fonts/Mallanna/normal.eot') format('eot'), url('fonts/Mallanna/normal.ttf') format('ttf')`,
src: `url('fonts/NotoSansTelugu/normal.woff') format('woff'), url('fonts/NotoSansTelugu/normal.eot') format('eot'), url('fonts/NotoSansTelugu/normal.ttf') format('ttf')`,
fontDisplay: 'swap',
},
};

const NOTO_SANS_TELUGU_BOLD = {
'@font-face': {
fontFamily: 'Noto Sans Telugu',
fontWeight: 700,
fontStyle: 'normal',
src: `url('fonts/NotoSansTelugu/bold.woff') format('woff'), url('fonts/NotoSansTelugu/bold.eot') format('eot'), url('fonts/NotoSansTelugu/bold.ttf') format('ttf')`,
fontDisplay: 'swap',
},
};

const NOTO_SANS_GUJARATI_REGULAR = {
'@font-face': {
fontFamily: 'Noto Sans Gujarati',
fontWeight: 400,
fontStyle: 'normal',
src: `url('fonts/NotoSansGujarati/normal.woff') format('woff'), url('fonts/NotoSansGujarati/normal.eot') format('eot'), url('fonts/NotoSansGujarati/normal.ttf') format('ttf')`,
fontDisplay: 'swap',
},
};

const NOTO_SANS_GUJARATI_BOLD = {
'@font-face': {
fontFamily: 'Noto Sans Gujarati',
fontWeight: 700,
fontStyle: 'normal',
src: `url('fonts/NotoSansGujarati/bold.woff') format('woff'), url('fonts/NotoSansGujarati/bold.eot') format('eot'), url('fonts/NotoSansGujarati/bold.ttf') format('ttf')`,
fontDisplay: 'swap',
},
};
Expand Down Expand Up @@ -623,7 +653,10 @@ const preview: Preview = {
NOTO_SERIF_SINHALA_BOLD,
NOTO_SANS_TAMIL_REGULAR,
NOTO_SANS_TAMIL_BOLD,
MALLANNA_REGULAR,
NOTO_SANS_TELUGU_REGULAR,
NOTO_SANS_TELUGU_BOLD,
NOTO_SANS_GUJARATI_REGULAR,
NOTO_SANS_GUJARATI_BOLD,
NOTO_SANS_ETHIOPIC_REGULAR,
NOTO_SANS_ETHIOPIC_BOLD,
PADAUK_REGULAR,
Expand Down
Binary file removed .storybook/static/fonts/Mallanna/normal.eot
Binary file not shown.
Binary file removed .storybook/static/fonts/Mallanna/normal.ttf
Binary file not shown.
Binary file removed .storybook/static/fonts/Mallanna/normal.woff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .storybook/static/fonts/NotoSansTelugu/bold.eot
Binary file not shown.
Binary file added .storybook/static/fonts/NotoSansTelugu/bold.ttf
Binary file not shown.
Binary file added .storybook/static/fonts/NotoSansTelugu/bold.woff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
43 changes: 38 additions & 5 deletions src/app/components/ThemeProvider/fontFaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ const NOTO_SERIF_SINHALA_FONTS_DIR =
const NOTO_SANS_TAMIL_FONTS_DIR =
'https://ws-downloads.files.bbci.co.uk/fonts/NotoSansTamil/v1.00/';

const MALLANA_FONTS_DIR =
'https://ws-downloads.files.bbci.co.uk/fonts/Mallanna/v1.0.4/';
const NOTO_SANS_TELUGU_FONTS_DIR =
'https://ws-downloads.files.bbci.co.uk/fonts/NotoSansTelugu/v1.00/';

const NOTO_SANS_GUJARATI_FONTS_DIR =
'https://ws-downloads.files.bbci.co.uk/fonts/NotoSansGujarati/v1.00/';

const NOTO_SANS_ETHIOPIC_FONTS_DIR =
'https://ws-downloads.files.bbci.co.uk/fonts/NotoSansEthiopic/v1.901/';
Expand Down Expand Up @@ -186,12 +189,42 @@ export const NOTO_SANS_TAMIL_BOLD = {
},
};

export const MALLANNA_REGULAR = {
export const NOTO_SANS_TELUGU_REGULAR = {
'@font-face': {
fontFamily: 'Noto Sans Telugu',
fontWeight: 400,
fontStyle: 'normal',
src: `url('${NOTO_SANS_TELUGU_FONTS_DIR}normal.woff') format('woff'), url('${NOTO_SANS_TELUGU_FONTS_DIR}normal.eot') format('eot'), url('${NOTO_SANS_TELUGU_FONTS_DIR}normal.ttf') format('ttf')`,
fontDisplay: 'swap',
},
};

export const NOTO_SANS_TELUGU_BOLD = {
'@font-face': {
fontFamily: 'Noto Sans Telugu',
fontWeight: 700,
fontStyle: 'normal',
src: `url('${NOTO_SANS_TELUGU_FONTS_DIR}bold.woff') format('woff'), url('${NOTO_SANS_TELUGU_FONTS_DIR}bold.eot') format('eot'), url('${NOTO_SANS_TELUGU_FONTS_DIR}bold.ttf') format('ttf')`,
fontDisplay: 'swap',
},
};

export const NOTO_SANS_GUJARATI_REGULAR = {
'@font-face': {
fontFamily: 'Mallanna',
fontFamily: 'Noto Sans Gujarati',
fontWeight: 400,
fontStyle: 'normal',
src: `url('${MALLANA_FONTS_DIR}normal.woff') format('woff'), url('${MALLANA_FONTS_DIR}normal.eot') format('eot'), url('${MALLANA_FONTS_DIR}normal.ttf') format('ttf')`,
src: `url('${NOTO_SANS_GUJARATI_FONTS_DIR}normal.woff') format('woff'), url('${NOTO_SANS_GUJARATI_FONTS_DIR}normal.eot') format('eot'), url('${NOTO_SANS_GUJARATI_FONTS_DIR}normal.ttf') format('ttf')`,
fontDisplay: 'swap',
},
};

export const NOTO_SANS_GUJARATI_BOLD = {
'@font-face': {
fontFamily: 'Noto Sans Gujarati',
fontWeight: 700,
fontStyle: 'normal',
src: `url('${NOTO_SANS_GUJARATI_FONTS_DIR}bold.woff') format('woff'), url('${NOTO_SANS_GUJARATI_FONTS_DIR}bold.eot') format('eot'), url('${NOTO_SANS_GUJARATI_FONTS_DIR}bold.ttf') format('ttf')`,
fontDisplay: 'swap',
},
};
Expand Down
46 changes: 39 additions & 7 deletions src/app/components/ThemeProvider/fontFacesLazy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ const NOTO_SERIF_SINHALA_FONTS_DIR =
const NOTO_SANS_TAMIL_FONTS_DIR =
'https://ws-downloads.files.bbci.co.uk/fonts/NotoSansTamil/v1.00/';

const MALLANA_FONTS_DIR =
'https://ws-downloads.files.bbci.co.uk/fonts/Mallanna/v1.0.4/';
const NOTO_SANS_TELUGU_FONTS_DIR =
'https://ws-downloads.files.bbci.co.uk/fonts/NotoSansTelugu/v1.00/';

const NOTO_SANS_GUJARATI_FONTS_DIR =
'https://ws-downloads.files.bbci.co.uk/fonts/NotoSansGujarati/v1.00/';

const NOTO_SANS_ETHIOPIC_FONTS_DIR =
'https://ws-downloads.files.bbci.co.uk/fonts/NotoSansEthiopic/v1.901/';
Expand Down Expand Up @@ -97,13 +100,40 @@ const NOTO_SANS_TAMIL_BOLD = {
baseUrl: NOTO_SANS_TAMIL_FONTS_DIR,
};

const MALLANNA_REGULAR = {
fontFamily: 'Mallanna',
const NOTO_SANS_TELUGU_REGULAR = {
fontFamily: 'Noto Sans Telugu',
fontWeight: 400,
fontStyle: 'normal',
src: `${NOTO_SANS_TELUGU_FONTS_DIR}normal.woff2`,
fontDisplay: 'swap',
baseUrl: NOTO_SANS_TELUGU_FONTS_DIR,
};

const NOTO_SANS_TELUGU_BOLD = {
fontFamily: 'Noto Sans Telugu',
fontWeight: 700,
fontStyle: 'normal',
src: `${NOTO_SANS_TELUGU_FONTS_DIR}bold.woff2`,
fontDisplay: 'swap',
baseUrl: NOTO_SANS_TELUGU_FONTS_DIR,
};

const NOTO_SANS_GUJARATI_REGULAR = {
fontFamily: 'Noto Sans Gujarati',
fontWeight: 400,
fontStyle: 'normal',
src: `${MALLANA_FONTS_DIR}normal.woff2`,
src: `${NOTO_SANS_GUJARATI_FONTS_DIR}normal.woff2`,
fontDisplay: 'swap',
baseUrl: NOTO_SANS_GUJARATI_FONTS_DIR,
};

const NOTO_SANS_GUJARATI_BOLD = {
fontFamily: 'Noto Sans Gujarati',
fontWeight: 700,
fontStyle: 'normal',
src: `${NOTO_SANS_GUJARATI_FONTS_DIR}bold.woff2`,
fontDisplay: 'swap',
baseUrl: MALLANA_FONTS_DIR,
baseUrl: NOTO_SANS_GUJARATI_FONTS_DIR,
};

const NOTO_SANS_ETHIOPIC_REGULAR = {
Expand Down Expand Up @@ -208,7 +238,9 @@ export default (service: string) => {
case 'tamil':
return [NOTO_SANS_TAMIL_REGULAR, NOTO_SANS_TAMIL_BOLD];
case 'telugu':
return [MALLANNA_REGULAR];
return [NOTO_SANS_TELUGU_REGULAR, NOTO_SANS_TELUGU_BOLD];
case 'gujarati':
return [NOTO_SANS_GUJARATI_REGULAR, NOTO_SANS_GUJARATI_BOLD];
case 'amharic':
case 'tigrinya':
return [NOTO_SANS_ETHIOPIC_REGULAR, NOTO_SANS_ETHIOPIC_BOLD];
Expand Down
8 changes: 4 additions & 4 deletions src/app/components/ThemeProvider/fontFamilies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export const HELVETICA_CHINESE =
'Helvetica, Arial, STHeiti, 华文黑体, "Microsoft YaHei", 微软雅黑, SimSun, 宋体';
export const HIRAGINO_KAGU_GOTHIC_PRO =
'"Hiragino Kaku Gothic Pro", "ヒラギノ角ゴPro W3", "MS PGothic", "MS UI Gothic", Helvetica, Arial, sans-serif';
export const MALLANA_NOTO_SANS_TELUGU =
'Mallanna, "Noto Sans Telugu", "Hind Guntur", Gautami, "Kohinoor Telugu", sans-serif';
export const MUKTA_VAANI =
'"Mukta Vaani", Rasa, "Noto Sans Gujarati", "Hind vadodara", Shruti, Gautami, "Gujarati Sangam MN", "Gujarati MT", sans-serif';
export const NOTO_SANS_TELUGU =
'"Noto Sans Telugu", "Hind Guntur", Gautami, "Kohinoor Telugu", sans-serif';
export const NOTO_SANS_GUJARATI =
'"Noto Sans Gujarati", Rasa, "Hind vadodara", Shruti, Gautami, "Gujarati Sangam MN", "Gujarati MT", sans-serif';
export const NOTO_SANS_BENGALI =
'"Noto Serif Bengali", Helmet, Freesans, Helvetica, Arial, sans-serif';
export const NOTO_SANS_DEVANAGARI =
Expand Down
Loading

0 comments on commit 289302e

Please sign in to comment.