fix font issue
This commit is contained in:
@@ -79,13 +79,11 @@ export function ChatInvite({
|
||||
minHeight: 130,
|
||||
maxWidth: 1000,
|
||||
wordBreak: 'break-word',
|
||||
// textWrap: 'balance',
|
||||
lineClamp: 2,
|
||||
textOverflow: 'ellipsis',
|
||||
overflow: 'hidden',
|
||||
}}>
|
||||
{preview.name}
|
||||
{/*{(preview.name + ' ').repeat(200)}*/}
|
||||
</div>
|
||||
|
||||
{/* By @handle */}
|
||||
|
||||
@@ -40,7 +40,7 @@ export class AppContext {
|
||||
const fontFiles = readdirSync(fontDirectory)
|
||||
const fonts = fontFiles.map(file => {
|
||||
return {
|
||||
name: path.basename(file, path.extname(file)),
|
||||
name: getName(file),
|
||||
data: readFileSync(path.join(fontDirectory, file)),
|
||||
weight: getWeight(file),
|
||||
}
|
||||
@@ -55,6 +55,12 @@ export class AppContext {
|
||||
}
|
||||
}
|
||||
|
||||
function getName(file: string): string {
|
||||
const base = path.basename(file, path.extname(file))
|
||||
if (base.startsWith('Inter-')) return 'Inter'
|
||||
return base
|
||||
}
|
||||
|
||||
function getWeight(file: string): FontWeight {
|
||||
switch (path.basename(file, path.extname(file))) {
|
||||
case 'Inter-Regular':
|
||||
|
||||
Reference in New Issue
Block a user