Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSTEAM1-1005: Gujarati Telugu font updates #11599

Merged
merged 14 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
2 changes: 1 addition & 1 deletion scripts/bundleSize/bundleSizeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
*/

export const MIN_SIZE = 640 - 5;
export const MAX_SIZE = 1093 + 5;
export const MAX_SIZE = 1099 + 5;
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/';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not live yet, hence 'do not merge' label


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not live yet, hence 'do not merge' label

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a PR for the font server repo or is that already up there/has it been merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep it's linked in this ticket: https://jira.dev.bbc.co.uk/browse/WSTEAM1-1003

It has been merged but I'm still working through the steps to deploy


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
Loading
Loading