Skip to content

Instantly share code, notes, and snippets.

@mirismaili
Created January 19, 2022 13:38
Show Gist options
  • Save mirismaili/5f5ca9b1c0d8cd77e2bebdc20606747e to your computer and use it in GitHub Desktop.
Save mirismaili/5f5ca9b1c0d8cd77e2bebdc20606747e to your computer and use it in GitHub Desktop.
vazir font variants
import vazirBlackWoff2 from './Vazir-Black.woff2'
import vazirBoldWoff2 from './Vazir-Bold.woff2'
import vazirLightWoff2 from './Vazir-Light.woff2'
import vazirMediumWoff2 from './Vazir-Medium.woff2'
import vazirThinWoff2 from './Vazir-Thin.woff2'
import vazirWoff2 from './Vazir.woff2'
/**
* Created on 1399/8/30 (2020/11/20).
* @author {@link https://mirismaili.github.io S. Mahdi Mir-Ismaili}
*/
const vazirVariants = [
{
weight: 100,
local: 'Vazir Thin',
url: vazirThinWoff2,
}, {
weight: 300,
local: 'Vazir Light',
url: vazirLightWoff2,
}, {
weight: 'normal', // 400
local: 'Vazir',
url: vazirWoff2,
}, {
weight: 500,
local: 'Vazir Medium',
url: vazirMediumWoff2,
}, {
weight: 'bold', // 700
local: 'Vazir Bold',
url: vazirBoldWoff2,
}, {
weight: 900,
local: 'Vazir Black',
url: vazirBlackWoff2,
},
]
export const vazirFamily = vazirVariants.map(({weight, local, url}) => ({
fontFamily: 'Vazir', // unique in each family
fontStyle: 'normal',
//fontDisplay: 'swap',
fontWeight: weight,
src: [
...process.env.NODE_ENV === 'development' ? [] : [`local("${local}")`],
`url("${url}") format("woff2")`,
].join(','),
//unicodeRange: 'U+0600-08FF', //'U+0628-0651, U+067E, U+0686, U+0698, U+06A9, U+06AF, U+06C0, U+06CC, U+06F0-06F9',
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment