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

Add Custom font (farsi) #3283

Open
6 tasks done
pooryapr opened this issue Jan 18, 2025 · 1 comment
Open
6 tasks done

Add Custom font (farsi) #3283

pooryapr opened this issue Jan 18, 2025 · 1 comment
Labels

Comments

@pooryapr
Copy link

Checks before filing an issue

Mattermost Desktop Version

10.0.2

Operating System

Windows 10 x64

Mattermost Server Version

No response

Steps to reproduce

Add Custom font (farsi)

Expected behavior

Add Custom font (farsi)

Observed behavior

Add Custom font (farsi)

Log Output

Add Custom font (farsi)

Additional Information

Add Custom font (farsi)

@pooryapr
Copy link
Author

pooryapr commented Jan 18, 2025

At first step create the following directory
/opt/mattermost/client/images/fonts/

also please copy new farsi font under

$ cd /opt/mattermost/client/images/fonts/

$ ls
 fonts.css               Vazirmatn-Bold.ttf        Vazirmatn-ExtraBold.woff2    Vazirmatn-Light.ttf     Vazirmatn-Medium.woff2    Vazirmatn-SemiBold.ttf     Vazirmatn-Thin.woff2
 Vazirmatn-Black.ttf     Vazirmatn-Bold.woff2      Vazirmatn-ExtraLight.ttf     Vazirmatn-Light.woff2   Vazirmatn-Regular.ttf     Vazirmatn-SemiBold.woff2  'Vazirmatn[wght].woff2'
 Vazirmatn-Black.woff2   Vazirmatn-ExtraBold.ttf   Vazirmatn-ExtraLight.woff2   Vazirmatn-Medium.ttf    Vazirmatn-Regular.woff2   Vazirmatn-Thin.ttf
$

then create fonts.css there
$ vi font.css

/* Generated by script */
@font-face {
  font-family: Vazirmatn;
  src: url('/static/images/fonts/Vazirmatn-Thin.woff2') format('woff2');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('/static/images/fonts/Vazirmatn-ExtraLight.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('/static/images/fonts/Vazirmatn-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('/static/images/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('/static/images/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('/static/images/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('/static/images/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('/static/images/fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('/static/images/fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

body,* {
    font-family: Vazirmatn, sans-serif !important;
}
$ cat /opt/mattermost/client/root.html  | grep -i -A1 fonts.css
    <link href="/static/images/fonts/fonts.css" rel="stylesheet" type="text/css" />
  </head>
$

$ systemctl restart mattermost.service

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant