fix font issue

This commit is contained in:
Samuel Newman
2026-05-27 16:19:59 +03:00
parent c2d51b646b
commit 41c6454441
2 changed files with 7 additions and 3 deletions
-2
View File
@@ -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 */}
+7 -1
View File
@@ -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':