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