From 129df7cfe3cec412fea2022577d61e583124fed1 Mon Sep 17 00:00:00 2001 From: danidfra Date: Mon, 18 Nov 2024 22:22:14 -0300 Subject: [PATCH 1/8] Fix ios-font-problem - Arabic/Javanese --- package.json | 2 +- src/init/soapbox-head.tsx | 15 ++++++++++++++- src/main.tsx | 2 -- yarn.lock | 8 ++++---- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 3fd88e2c6..855f1bb5d 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "@emoji-mart/data": "^1.2.1", "@floating-ui/react": "^0.26.0", "@fontsource/inter": "^5.0.0", - "@fontsource/noto-sans-javanese": "^5.0.16", + "@fontsource/noto-sans-javanese": "^5.1.0", "@fontsource/roboto-mono": "^5.0.0", "@fontsource/vazirmatn": "^5.0.20", "@gamestdio/websocket": "^0.3.2", diff --git a/src/init/soapbox-head.tsx b/src/init/soapbox-head.tsx index a9ead879b..9c25d0f78 100644 --- a/src/init/soapbox-head.tsx +++ b/src/init/soapbox-head.tsx @@ -25,6 +25,14 @@ const SoapboxHead: React.FC = ({ children }) => { const themeCss = generateThemeCss(demo ? normalizeSoapboxConfig({ brandColor: '#0482d8' }) : soapboxConfig); const dsn = soapboxConfig.sentryDsn; + const loadLocaleCss = async (locale: string) => { + if (locale === 'ar') { + await import('soapbox/styles/i18n/arabic.css'); + } else if (locale === 'jv') { + await import('soapbox/styles/i18n/javanese.css'); + } + }; + const bodyClass = clsx('h-full bg-white text-base black:bg-black dark:bg-gray-800', { 'no-reduce-motion': !reduceMotion, 'underline-links': underlineLinks, @@ -32,10 +40,12 @@ const SoapboxHead: React.FC = ({ children }) => { }); useEffect(() => { + loadLocaleCss(locale); + if (dsn) { startSentry(dsn).catch(console.error); } - }, [dsn]); + }, [dsn, locale]); return ( <> @@ -46,6 +56,9 @@ const SoapboxHead: React.FC = ({ children }) => { {themeCss && } {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {['dark', 'black'].includes(theme) && } + {/* eslint-disable formatjs/no-literal-string-in-jsx */} + {(locale === 'ar' || locale === 'jv') ? : } + {/* eslint-enable formatjs/no-literal-string-in-jsx */} diff --git a/src/main.tsx b/src/main.tsx index ba0510b10..7a9f1150b 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -17,8 +17,6 @@ import 'line-awesome/dist/font-awesome-line-awesome/css/all.css'; import 'soapbox/features/nostr/keyring.ts'; import './iframe.ts'; -import './styles/i18n/arabic.css'; -import './styles/i18n/javanese.css'; import './styles/tailwind.css'; import ready from './ready.ts'; diff --git a/yarn.lock b/yarn.lock index 4c66b8110..839dbae25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1312,10 +1312,10 @@ resolved "https://registry.yarnpkg.com/@fontsource/inter/-/inter-5.0.8.tgz#61b50cb0eb72b14ae1938d47c4a9a91546d2a50c" integrity sha512-28knWH1BfOiRalfLs90U4sge5mpQ8ZH6FS0PTT+IZMKrZ7wNHDHRuKa1kQJg+uHcc6axBppnxll+HXM4c7zo/Q== -"@fontsource/noto-sans-javanese@^5.0.16": - version "5.0.16" - resolved "https://registry.yarnpkg.com/@fontsource/noto-sans-javanese/-/noto-sans-javanese-5.0.16.tgz#e6a2acad3b520e379a5f760196246951d6d7eb3e" - integrity sha512-foh5yX/kbY28QMx6jU8aezMLAnBTKscNAVeuDIt8myScEDqXDm+1v2pIxVCh0zZUyxt/Yj/qkDTOM/Vegq9hzA== +"@fontsource/noto-sans-javanese@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@fontsource/noto-sans-javanese/-/noto-sans-javanese-5.1.0.tgz#bfae45a2324d40e2bc1e5b14479a7d47ae59c7a7" + integrity sha512-N3yvfUucmc5hC5ksxdd8DYHTGgx1rMqfgZm4qZ5T1TNMe+773exqGAKVYgdgzCyLCxdOVHQui9ATEeO8hr1Nqg== "@fontsource/roboto-mono@^5.0.0": version "5.0.8" From cffc34c7cf60bce2f0af960ffff99401d5ce9cc2 Mon Sep 17 00:00:00 2001 From: danidfra Date: Tue, 19 Nov 2024 17:19:54 -0300 Subject: [PATCH 2/8] Update: vazirmatn font --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 855f1bb5d..dd8b5b612 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@fontsource/inter": "^5.0.0", "@fontsource/noto-sans-javanese": "^5.1.0", "@fontsource/roboto-mono": "^5.0.0", - "@fontsource/vazirmatn": "^5.0.20", + "@fontsource/vazirmatn": "^5.1.0", "@gamestdio/websocket": "^0.3.2", "@lexical/clipboard": "^0.18.0", "@lexical/hashtag": "^0.18.0", diff --git a/yarn.lock b/yarn.lock index 839dbae25..a5814c5df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1322,10 +1322,10 @@ resolved "https://registry.yarnpkg.com/@fontsource/roboto-mono/-/roboto-mono-5.0.8.tgz#9b3df61f884f46e12d3eca46e75517fde58da68e" integrity sha512-vjnNX8zQCSp4HadUJ3gpZiizCsK/ROjgGMpd4bcRxuyiTNGGMaznmKbhqdyVeFVap1sX8h2Qu380awaotey/mQ== -"@fontsource/vazirmatn@^5.0.20": - version "5.0.20" - resolved "https://registry.yarnpkg.com/@fontsource/vazirmatn/-/vazirmatn-5.0.20.tgz#9e8d56b712f6c397e7a6c63498a2fecca9fde9a3" - integrity sha512-5h9bKrZjJ3U7C5tj2OtGdDBWGzS+acOOFhlonYlNekS4vNzcwMU7qkKADHTZYGQrMqhpUNKqGwHEHlxXqZpXmQ== +"@fontsource/vazirmatn@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@fontsource/vazirmatn/-/vazirmatn-5.1.0.tgz#bf758d2fcff91a15dd6db8e01d043e5d4707d8dc" + integrity sha512-qoHGF9VDKRX7m92QzznU+Et4cF02HOafuaBmu1igAqYOzJdHVNAsRsWUs86revIIpZcMO0ens4pz3Xzq8KZnNw== "@formatjs/cli@^6.3.11": version "6.3.11" From 686367b6e081b647675902ad86dc80f3756da450 Mon Sep 17 00:00:00 2001 From: danidfra Date: Tue, 19 Nov 2024 17:26:05 -0300 Subject: [PATCH 3/8] Refactor: remove "Soapbox i18n" font and clean up code --- src/init/soapbox-head.tsx | 14 ++----- src/main.tsx | 2 + src/styles/i18n/arabic.css | 71 ------------------------------------ src/styles/i18n/javanese.css | 39 -------------------- tailwind.config.ts | 7 ++-- 5 files changed, 9 insertions(+), 124 deletions(-) delete mode 100644 src/styles/i18n/arabic.css delete mode 100644 src/styles/i18n/javanese.css diff --git a/src/init/soapbox-head.tsx b/src/init/soapbox-head.tsx index 9c25d0f78..02d3f542a 100644 --- a/src/init/soapbox-head.tsx +++ b/src/init/soapbox-head.tsx @@ -25,14 +25,6 @@ const SoapboxHead: React.FC = ({ children }) => { const themeCss = generateThemeCss(demo ? normalizeSoapboxConfig({ brandColor: '#0482d8' }) : soapboxConfig); const dsn = soapboxConfig.sentryDsn; - const loadLocaleCss = async (locale: string) => { - if (locale === 'ar') { - await import('soapbox/styles/i18n/arabic.css'); - } else if (locale === 'jv') { - await import('soapbox/styles/i18n/javanese.css'); - } - }; - const bodyClass = clsx('h-full bg-white text-base black:bg-black dark:bg-gray-800', { 'no-reduce-motion': !reduceMotion, 'underline-links': underlineLinks, @@ -40,7 +32,6 @@ const SoapboxHead: React.FC = ({ children }) => { }); useEffect(() => { - loadLocaleCss(locale); if (dsn) { startSentry(dsn).catch(console.error); @@ -57,7 +48,10 @@ const SoapboxHead: React.FC = ({ children }) => { {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {['dark', 'black'].includes(theme) && } {/* eslint-disable formatjs/no-literal-string-in-jsx */} - {(locale === 'ar' || locale === 'jv') ? : } + {['ar', 'jv'].includes(locale) ? : } {/* eslint-enable formatjs/no-literal-string-in-jsx */} diff --git a/src/main.tsx b/src/main.tsx index 7a9f1150b..9204d45bd 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -12,6 +12,8 @@ import '@fontsource/inter/500.css'; import '@fontsource/inter/600.css'; import '@fontsource/inter/700.css'; import '@fontsource/inter/900.css'; +import '@fontsource/vazirmatn/arabic.css'; +import '@fontsource/noto-sans-javanese/javanese.css'; import '@fontsource/roboto-mono/400.css'; import 'line-awesome/dist/font-awesome-line-awesome/css/all.css'; import 'soapbox/features/nostr/keyring.ts'; diff --git a/src/styles/i18n/arabic.css b/src/styles/i18n/arabic.css deleted file mode 100644 index 66c634354..000000000 --- a/src/styles/i18n/arabic.css +++ /dev/null @@ -1,71 +0,0 @@ -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 200; - src: url('@fontsource/vazirmatn/files/vazirmatn-arabic-200-normal.woff2') format('woff2'), url('@fontsource/vazirmatn/files/vazirmatn-arabic-200-normal.woff') format('woff'); - unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+067E, U+0686, U+0698, U+06AF, U+06CC; -} - -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 300; - src: url('@fontsource/vazirmatn/files/vazirmatn-arabic-300-normal.woff2') format('woff2'), url('@fontsource/vazirmatn/files/vazirmatn-arabic-300-normal.woff') format('woff'); - unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+067E, U+0686, U+0698, U+06AF, U+06CC; -} - -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 400; - src: url('@fontsource/vazirmatn/files/vazirmatn-arabic-400-normal.woff2') format('woff2'), url('@fontsource/vazirmatn/files/vazirmatn-arabic-400-normal.woff') format('woff'); - unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+067E, U+0686, U+0698, U+06AF, U+06CC; -} - -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 500; - src: url('@fontsource/vazirmatn/files/vazirmatn-arabic-500-normal.woff2') format('woff2'), url('@fontsource/vazirmatn/files/vazirmatn-arabic-500-normal.woff') format('woff'); - unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+067E, U+0686, U+0698, U+06AF, U+06CC; -} - -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 600; - src: url('@fontsource/vazirmatn/files/vazirmatn-arabic-600-normal.woff2') format('woff2'), url('@fontsource/vazirmatn/files/vazirmatn-arabic-600-normal.woff') format('woff'); - unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+067E, U+0686, U+0698, U+06AF, U+06CC; -} - -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 700; - src: url('@fontsource/vazirmatn/files/vazirmatn-arabic-700-normal.woff2') format('woff2'), url('@fontsource/vazirmatn/files/vazirmatn-arabic-700-normal.woff') format('woff'); - unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+067E, U+0686, U+0698, U+06AF, U+06CC; -} - -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 800; - src: url('@fontsource/vazirmatn/files/vazirmatn-arabic-800-normal.woff2') format('woff2'), url('@fontsource/vazirmatn/files/vazirmatn-arabic-800-normal.woff') format('woff'); - unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+067E, U+0686, U+0698, U+06AF, U+06CC; -} - -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 900; - src: url('@fontsource/vazirmatn/files/vazirmatn-arabic-900-normal.woff2') format('woff2'), url('@fontsource/vazirmatn/files/vazirmatn-arabic-900-normal.woff') format('woff'); - unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+067E, U+0686, U+0698, U+06AF, U+06CC; -} \ No newline at end of file diff --git a/src/styles/i18n/javanese.css b/src/styles/i18n/javanese.css deleted file mode 100644 index 0d00873ad..000000000 --- a/src/styles/i18n/javanese.css +++ /dev/null @@ -1,39 +0,0 @@ -/* noto-sans-javanese-javanese-400-normal */ -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 400; - src: url(@fontsource/noto-sans-javanese/files/noto-sans-javanese-javanese-400-normal.woff2) format('woff2'), url(@fontsource/noto-sans-javanese/files/noto-sans-javanese-javanese-400-normal.woff) format('woff'); - unicode-range: U+A980-A9DF; -} - -/* noto-sans-javanese-javanese-500-normal */ -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 500; - src: url(@fontsource/noto-sans-javanese/files/noto-sans-javanese-javanese-500-normal.woff2) format('woff2'), url(@fontsource/noto-sans-javanese/files/noto-sans-javanese-javanese-500-normal.woff) format('woff'); - unicode-range: U+A980-A9DF; -} - -/* noto-sans-javanese-javanese-600-normal */ -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 600; - src: url(@fontsource/noto-sans-javanese/files/noto-sans-javanese-javanese-600-normal.woff2) format('woff2'), url(@fontsource/noto-sans-javanese/files/noto-sans-javanese-javanese-600-normal.woff) format('woff'); - unicode-range: U+A980-A9DF; -} - -/* noto-sans-javanese-javanese-700-normal */ -@font-face { - font-family: 'Soapbox i18n'; - font-style: normal; - font-display: swap; - font-weight: 700; - src: url(@fontsource/noto-sans-javanese/files/noto-sans-javanese-javanese-700-normal.woff2) format('woff2'), url(@fontsource/noto-sans-javanese/files/noto-sans-javanese-javanese-700-normal.woff) format('woff'); - unicode-range: U+A980-A9DF; -} \ No newline at end of file diff --git a/tailwind.config.ts b/tailwind.config.ts index 57bb3709d..977af52b1 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -28,7 +28,6 @@ const config: Config = { }, fontFamily: { sans: [ - 'Soapbox i18n', 'Inter', 'ui-sans-serif', 'system-ui', @@ -95,11 +94,11 @@ const config: Config = { width: '0px', height: '0px', }, - + '29%': { backgroundColor: 'rgb(229, 231, 235)', }, - + '30%': { width: '3rem', height: '3rem', @@ -107,7 +106,7 @@ const config: Config = { opacity: '1', borderWidth: '6px', }, - + '100%': { width: '3rem', height: '3rem', From 3898fe303474fcfc2686cdd6af0514c7186cc79a Mon Sep 17 00:00:00 2001 From: danidfra Date: Tue, 19 Nov 2024 17:34:12 -0300 Subject: [PATCH 4/8] Remove redundant code and simplify logic --- src/init/soapbox-head.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init/soapbox-head.tsx b/src/init/soapbox-head.tsx index 02d3f542a..00c2560d8 100644 --- a/src/init/soapbox-head.tsx +++ b/src/init/soapbox-head.tsx @@ -48,10 +48,10 @@ const SoapboxHead: React.FC = ({ children }) => { {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {['dark', 'black'].includes(theme) && } {/* eslint-disable formatjs/no-literal-string-in-jsx */} - {['ar', 'jv'].includes(locale) ? : } + `} {/* eslint-enable formatjs/no-literal-string-in-jsx */} From a9c7afb50287322376f4f94f35585214baefd9bc Mon Sep 17 00:00:00 2001 From: danidfra Date: Tue, 19 Nov 2024 19:30:41 -0300 Subject: [PATCH 5/8] Add support for Persian language --- src/init/soapbox-head.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/init/soapbox-head.tsx b/src/init/soapbox-head.tsx index 00c2560d8..ef562a928 100644 --- a/src/init/soapbox-head.tsx +++ b/src/init/soapbox-head.tsx @@ -36,7 +36,7 @@ const SoapboxHead: React.FC = ({ children }) => { if (dsn) { startSentry(dsn).catch(console.error); } - }, [dsn, locale]); + }, [dsn]); return ( <> @@ -49,8 +49,8 @@ const SoapboxHead: React.FC = ({ children }) => { {['dark', 'black'].includes(theme) && } {/* eslint-disable formatjs/no-literal-string-in-jsx */} {/* eslint-enable formatjs/no-literal-string-in-jsx */} From 23e6a4668532f5d015ba1043719237fe0a4f6dee Mon Sep 17 00:00:00 2001 From: danidfra Date: Mon, 25 Nov 2024 21:21:53 -0300 Subject: [PATCH 6/8] Improve fonts and remove "family" prop --- src/components/ui/text.tsx | 9 --------- src/features/developers/developers-challenge.tsx | 2 +- src/init/soapbox-head.tsx | 6 ++---- tailwind.config.ts | 6 ++++++ 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/components/ui/text.tsx b/src/components/ui/text.tsx index 1e31c90f4..91abe4284 100644 --- a/src/components/ui/text.tsx +++ b/src/components/ui/text.tsx @@ -45,11 +45,6 @@ const transformProperties = { uppercase: 'uppercase', }; -const families = { - sans: 'font-sans', - mono: 'font-mono', -}; - export type Sizes = keyof typeof sizes type Tags = 'abbr' | 'p' | 'span' | 'pre' | 'time' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'div' | 'blockquote' type Directions = 'ltr' | 'rtl' @@ -63,8 +58,6 @@ interface IText extends Pick, 'danger className?: string; /** Text direction. */ direction?: Directions; - /** Typeface of the text. */ - family?: keyof typeof families; /** The "for" attribute specifies which form element a label is bound to. */ htmlFor?: string; /** Font size of the text. */ @@ -92,7 +85,6 @@ const Text = forwardRef( align, className, direction, - family = 'sans', size = 'md', tag = 'p', theme = 'default', @@ -122,7 +114,6 @@ const Text = forwardRef( [themes[theme]]: true, [weights[weight]]: true, [trackingSizes[tracking]]: true, - [families[family]]: true, [alignmentClass]: typeof align !== 'undefined', [transformProperties[transform]]: typeof transform !== 'undefined', }, className)} diff --git a/src/features/developers/developers-challenge.tsx b/src/features/developers/developers-challenge.tsx index ea2010389..656287979 100644 --- a/src/features/developers/developers-challenge.tsx +++ b/src/features/developers/developers-challenge.tsx @@ -56,7 +56,7 @@ const DevelopersChallenge = () => { {/* eslint-enable formatjs/no-literal-string-in-jsx */} - + {challenge} diff --git a/src/init/soapbox-head.tsx b/src/init/soapbox-head.tsx index ef562a928..e9729221b 100644 --- a/src/init/soapbox-head.tsx +++ b/src/init/soapbox-head.tsx @@ -29,6 +29,8 @@ const SoapboxHead: React.FC = ({ children }) => { 'no-reduce-motion': !reduceMotion, 'underline-links': underlineLinks, 'demetricator': demetricator, + 'font-arabic': ['ar', 'fa'].includes(locale), + 'font-javanese': locale === 'jv', }); useEffect(() => { @@ -48,10 +50,6 @@ const SoapboxHead: React.FC = ({ children }) => { {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {['dark', 'black'].includes(theme) && } {/* eslint-disable formatjs/no-literal-string-in-jsx */} - {/* eslint-enable formatjs/no-literal-string-in-jsx */} diff --git a/tailwind.config.ts b/tailwind.config.ts index 977af52b1..7071c6741 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -27,6 +27,12 @@ const config: Config = { base: '0.9375rem', }, fontFamily: { + arabic: [ + 'Vazirmatn', + ], + javanese: [ + 'Noto Sans Javanese', + ], sans: [ 'Inter', 'ui-sans-serif', From aeaa6322b848d67928555127cdbbf77f508522a8 Mon Sep 17 00:00:00 2001 From: danidfra Date: Tue, 26 Nov 2024 12:17:14 -0300 Subject: [PATCH 7/8] Including font-sans in the bodyClass --- src/init/soapbox-head.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/init/soapbox-head.tsx b/src/init/soapbox-head.tsx index e9729221b..2a06a4a6c 100644 --- a/src/init/soapbox-head.tsx +++ b/src/init/soapbox-head.tsx @@ -29,8 +29,9 @@ const SoapboxHead: React.FC = ({ children }) => { 'no-reduce-motion': !reduceMotion, 'underline-links': underlineLinks, 'demetricator': demetricator, - 'font-arabic': ['ar', 'fa'].includes(locale), - 'font-javanese': locale === 'jv', + 'font-sans': true, + '!font-arabic': ['ar', 'fa'].includes(locale), + '!font-javanese': locale === 'jv', }); useEffect(() => { @@ -49,8 +50,6 @@ const SoapboxHead: React.FC = ({ children }) => { {themeCss && } {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {['dark', 'black'].includes(theme) && } - {/* eslint-disable formatjs/no-literal-string-in-jsx */} - {/* eslint-enable formatjs/no-literal-string-in-jsx */} From 809153936f271d6864510b90804af727a4025687 Mon Sep 17 00:00:00 2001 From: danidfra Date: Tue, 26 Nov 2024 12:31:19 -0300 Subject: [PATCH 8/8] Setting alternative fonts --- package.json | 3 +++ tailwind.config.ts | 5 +++++ yarn.lock | 15 +++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/package.json b/package.json index dd8b5b612..26dd718fa 100644 --- a/package.json +++ b/package.json @@ -41,9 +41,12 @@ "@akryum/flexsearch-es": "^0.7.32", "@emoji-mart/data": "^1.2.1", "@floating-ui/react": "^0.26.0", + "@fontsource/amiri": "^5.1.0", + "@fontsource/cairo": "^5.1.0", "@fontsource/inter": "^5.0.0", "@fontsource/noto-sans-javanese": "^5.1.0", "@fontsource/roboto-mono": "^5.0.0", + "@fontsource/tajawal": "^5.1.0", "@fontsource/vazirmatn": "^5.1.0", "@gamestdio/websocket": "^0.3.2", "@lexical/clipboard": "^0.18.0", diff --git a/tailwind.config.ts b/tailwind.config.ts index 7071c6741..2220c5583 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -29,9 +29,14 @@ const config: Config = { fontFamily: { arabic: [ 'Vazirmatn', + 'Cairo', + 'Amiri', + 'Tajawal', + 'sans-serif', ], javanese: [ 'Noto Sans Javanese', + 'serif', ], sans: [ 'Inter', diff --git a/yarn.lock b/yarn.lock index a5814c5df..8521bc851 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1307,6 +1307,16 @@ resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.1.5.tgz#f0bada210a75fdf41101c48ddcc291e1b33b3f47" integrity sha512-3lClsx2F3ei6hup0LYFbbm+NH87qVTX/6T63IllEFCLjT7XCxmbgBM42sXf8LTZx0CE5VpRRUnISUbqSlsxGSA== +"@fontsource/amiri@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@fontsource/amiri/-/amiri-5.1.0.tgz#86da9f17fbab9ecdb6b23e49d083cc9501abc0dd" + integrity sha512-epfiqkAaDIHyIW7Mz2HVEcSTjpJZLdnvd1AkpnpKnngYWxo+GDl5TrXsQjZp6/CnL/UYZsQZoiugajiL9HGQUA== + +"@fontsource/cairo@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@fontsource/cairo/-/cairo-5.1.0.tgz#89dc3babe15ac02ba02c5a1f32f08ea5d3457ec4" + integrity sha512-gjiQa8YP4ORv20WhWHHymEBgeHEZ2GP6H0VZACWylG5VoqsHXawRn3V+9YVg3nOZWIknUexCqncIrlXbKDXnqQ== + "@fontsource/inter@^5.0.0": version "5.0.8" resolved "https://registry.yarnpkg.com/@fontsource/inter/-/inter-5.0.8.tgz#61b50cb0eb72b14ae1938d47c4a9a91546d2a50c" @@ -1322,6 +1332,11 @@ resolved "https://registry.yarnpkg.com/@fontsource/roboto-mono/-/roboto-mono-5.0.8.tgz#9b3df61f884f46e12d3eca46e75517fde58da68e" integrity sha512-vjnNX8zQCSp4HadUJ3gpZiizCsK/ROjgGMpd4bcRxuyiTNGGMaznmKbhqdyVeFVap1sX8h2Qu380awaotey/mQ== +"@fontsource/tajawal@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@fontsource/tajawal/-/tajawal-5.1.0.tgz#9508e6da41fa6eae59e025c98c791603bd73ad0a" + integrity sha512-CYYxryDbFK4r4ev4xis+SyklUtnGy5O8nlJoDES/zEUdEz/qc7eYn1nVlQnUqWYLPzN5DgyTqHOx/5gWwHS7BA== + "@fontsource/vazirmatn@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@fontsource/vazirmatn/-/vazirmatn-5.1.0.tgz#bf758d2fcff91a15dd6db8e01d043e5d4707d8dc"