forked from misskey-dev/misskey
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pari Plus! add default font settings
- Loading branch information
1 parent
4cfc6d0
commit b49277f
Showing
50 changed files
with
503 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+7.56 MB
packages/backend/assets/fonts/ChillRoundGothic/ChillRoundGothic_Bold.woff
Binary file not shown.
Binary file added
BIN
+5.86 MB
packages/backend/assets/fonts/ChillRoundGothic/ChillRoundGothic_ExtraLight.woff
Binary file not shown.
Binary file added
BIN
+6.76 MB
packages/backend/assets/fonts/ChillRoundGothic/ChillRoundGothic_Light.woff
Binary file not shown.
Binary file added
BIN
+7.41 MB
packages/backend/assets/fonts/ChillRoundGothic/ChillRoundGothic_Medium.woff
Binary file not shown.
Binary file added
BIN
+7.13 MB
packages/backend/assets/fonts/ChillRoundGothic/ChillRoundGothic_Normal.woff
Binary file not shown.
Binary file added
BIN
+7.26 MB
packages/backend/assets/fonts/ChillRoundGothic/ChillRoundGothic_Regular.woff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+400 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-10px-proportional-ja.woff2
Binary file not shown.
Binary file added
BIN
+411 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-10px-proportional-ko.woff2
Binary file not shown.
Binary file added
BIN
+409 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-10px-proportional-latin.woff2
Binary file not shown.
Binary file added
BIN
+404 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-10px-proportional-zh_hans.woff2
Binary file not shown.
Binary file added
BIN
+400 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-10px-proportional-zh_hant.woff2
Binary file not shown.
Binary file added
BIN
+596 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-12px-proportional-ja.woff2
Binary file not shown.
Binary file added
BIN
+604 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-12px-proportional-ko.woff2
Binary file not shown.
Binary file added
BIN
+585 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-12px-proportional-latin.woff2
Binary file not shown.
Binary file added
BIN
+588 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-12px-proportional-zh_hans.woff2
Binary file not shown.
Binary file added
BIN
+595 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-12px-proportional-zh_hant.woff2
Binary file not shown.
Binary file added
BIN
+327 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-8px-proportional-ja.woff2
Binary file not shown.
Binary file added
BIN
+333 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-8px-proportional-ko.woff2
Binary file not shown.
Binary file added
BIN
+326 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-8px-proportional-latin.woff2
Binary file not shown.
Binary file added
BIN
+324 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-8px-proportional-zh_hans.woff2
Binary file not shown.
Binary file added
BIN
+308 KB
packages/backend/assets/fonts/fusion-pixel/fusion-pixel-8px-proportional-zh_hant.woff2
Binary file not shown.
Binary file not shown.
30 changes: 30 additions & 0 deletions
30
packages/backend/assets/fonts/sharkey-icons/shark-font.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
@font-face { | ||
font-display: auto; | ||
font-family: "shark-font"; | ||
font-style: normal; | ||
font-weight: normal; | ||
|
||
src: url("./shark-font.woff?1722899913909") format("woff"), url("./shark-font.ttf?1722899913909") format("truetype"), url("./shark-font.svg?1722899913909#shark-font") format("svg"); | ||
} | ||
|
||
.sk-icons { | ||
display: inline-block; | ||
font-family: "shark-font"; | ||
font-weight: normal; | ||
font-style: normal; | ||
font-variant: normal; | ||
text-rendering: auto; | ||
line-height: 1; | ||
-moz-osx-font-smoothing: grayscale; | ||
-webkit-font-smoothing: antialiased; | ||
} | ||
|
||
.sk-icons-lg { | ||
font-size: 1.33333em; | ||
line-height: 0.75em; | ||
vertical-align: -0.0667em; | ||
} | ||
|
||
.sk-icons-xs { | ||
font-size: 0.75em; | ||
} | ||
|
||
.sk-icons-sm { | ||
font-size: 0.875em; | ||
} | ||
|
||
.sk-icons-1x { | ||
font-size: 1em; | ||
} | ||
|
||
.sk-icons-2x { | ||
font-size: 2em; | ||
} | ||
|
||
.sk-icons-3x { | ||
font-size: 3em; | ||
} | ||
|
||
.sk-icons-4x { | ||
font-size: 4em; | ||
} | ||
|
||
.sk-icons-5x { | ||
font-size: 5em; | ||
} | ||
|
||
.sk-icons-6x { | ||
font-size: 6em; | ||
} | ||
|
||
.sk-icons-7x { | ||
font-size: 7em; | ||
} | ||
|
||
.sk-icons-8x { | ||
font-size: 8em; | ||
} | ||
|
||
.sk-icons-9x { | ||
font-size: 9em; | ||
} | ||
|
||
.sk-icons-10x { | ||
font-size: 10em; | ||
} | ||
|
||
.sk-icons-fw { | ||
text-align: center; | ||
width: 1.25em; | ||
} | ||
|
||
.sk-icons-border { | ||
border: solid 0.08em #eee; | ||
border-radius: 0.1em; | ||
padding: 0.2em 0.25em 0.15em; | ||
} | ||
|
||
.sk-icons-pull-left { | ||
float: left; | ||
} | ||
|
||
.sk-icons-pull-right { | ||
float: right; | ||
} | ||
|
||
.sk-icons.sk-icons-pull-left { | ||
margin-right: 0.3em; | ||
} | ||
|
||
.sk-icons.sk-icons-pull-right { | ||
margin-left: 0.3em; | ||
} | ||
|
||
|
||
.sk-icons.sk-foldermove::before { | ||
content: "\ea01"; | ||
} | ||
|
||
.sk-icons.sk-misskey::before { | ||
content: "\ea02"; | ||
} | ||
|
||
.sk-icons.sk-shark::before { | ||
content: "\ea03"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import { computed, ref, watch } from 'vue'; | ||
import type { Ref, ComputedRef } from 'vue'; | ||
import { miLocalStorage } from '@/local-storage.js'; | ||
import { i18n } from '@/i18n.js'; | ||
|
||
const fontList = [ | ||
{ id: 'system-ui', name: i18n.ts.useSystemFont }, | ||
{ id: 'maokentangyuan', name: '猫啃糖圆' }, | ||
{ id: 'chillroundgothic', name: '寒蝉圆黑' }, | ||
{ id: 'lxgw-wenkai', name: '霞鹜文楷' }, | ||
{ id: 'lxgw-marker-gothic', name: '霞鹜漫黑' }, | ||
{ id: 'clearsans', name: '思源屏显臻宋' }, | ||
{ id: 'genryomin2', name: '源流明體' }, | ||
{ id: 'genwanmin2', name: '源雲明體' }, | ||
{ id: 'jinghualaosong', name: '京華老宋體' }, | ||
{ id: 'fusion-pixel', name: '缝合像素体' }, | ||
{ id: 'misskey-biz', name: 'BIZ UDGothic' }, | ||
{ id: 'roboto', name: 'Roboto' }, | ||
{ id: 'arial', name: 'Arial' }, | ||
{ id: 'times', name: 'Times' }, | ||
{ id: 'yishanbeizhuan', name: '峄山碑篆体' }, | ||
{ id: 'chongxiseal', name: '崇羲篆體' }, | ||
]; | ||
|
||
function getFontOptionsList(val: string): { id: string, name: string, default?: boolean }[] { | ||
switch (val) { | ||
case 'fusion-pixel': | ||
return [ | ||
{ name: '8px', id: '8' }, | ||
{ name: '10px', id: '10' }, | ||
{ name: '12px', id: '12', default: true }, | ||
]; | ||
case 'chillroundgothic': | ||
return [ | ||
{ name: 'Extra Light', id: 'EL' }, | ||
{ name: 'Light', id: 'L' }, | ||
{ name: 'Normal', id: 'N', default: true }, | ||
{ name: 'Regular', id: 'R' }, | ||
{ name: 'Middle', id: 'M' }, | ||
{ name: 'Bold', id: 'B' }, | ||
]; | ||
default: | ||
return []; | ||
} | ||
} | ||
|
||
function getFontId(name: string, option: string) { | ||
if (getFontOptionsList(name).length === 0) { | ||
return `${name}`; | ||
} else { | ||
return `${name}_${option}`; | ||
} | ||
} | ||
|
||
export function getDefaultFontSettings() { | ||
const def_arr = miLocalStorage.getItem('defaultFontFace')?.split('_'); | ||
const fontFace = ref(def_arr?.[0] ?? 'maokentangyuan'); | ||
const fontFaceType = ref(def_arr?.[1] ?? ''); | ||
const availableTypes = computed(() => getFontOptionsList(fontFace.value)); | ||
|
||
function setDafaultFont() { | ||
for (const klass of [...document.documentElement.classList.values()]) { | ||
if (klass.startsWith('default-font-')) { | ||
document.documentElement.classList.remove(klass); | ||
} | ||
} | ||
const newFontId = getFontId(fontFace.value, fontFaceType.value); | ||
miLocalStorage.setItem('defaultFontFace', newFontId); | ||
document.documentElement.classList.add(`default-font-${newFontId}`); | ||
console.log(newFontId); | ||
} | ||
|
||
watch(fontFace, (newVal) => { | ||
const optionsList = getFontOptionsList(newVal); | ||
if (optionsList.length !== 0) { | ||
fontFaceType.value = optionsList.find((v) => v.default)?.id ?? ''; | ||
} else { | ||
setDafaultFont(); | ||
} | ||
}); | ||
watch(fontFaceType, () => { | ||
setDafaultFont(); | ||
}); | ||
|
||
return ref({ | ||
fontList, | ||
fontFace, | ||
fontFaceType, | ||
availableTypes, | ||
}) as Ref<{ | ||
fontList: { | ||
id: string; | ||
name: string; | ||
}[]; | ||
fontFace: string; | ||
fontFaceType: string; | ||
availableTypes: { | ||
id: string; | ||
name: string; | ||
default?: boolean; | ||
}[]; | ||
}>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.