fix(frontend): Temml를 사용할 때 폰트가 올바르게 표시되지 않을 수 있음

This commit is contained in:
NoriDev 2024-01-02 19:04:45 +09:00
parent 0e3c3275dd
commit ed1cebdad3
5 changed files with 111 additions and 205 deletions

View file

@ -91,6 +91,7 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGE
- Fix: 노트 상세 페이지에서 노트 작성 폼을 클릭했을 때, 노트 작성자가 자동으로 멘션에 포함되지 않을 수 있음
- Fix: 링크를 인용해서 노트를 작성할 때 노트 작성 폼의 디자인이 올바르지 않게 표시됨
- Fix: MFM 도움말의 수식(블록) 항목이 누락됨
- Fix: Temml를 사용할 때 폰트가 올바르게 표시되지 않을 수 있음
### Server
- Enhance: (dev) 개발 모드에서 locale 및 유형 정의가 자동으로 재생성됨 (misskey-dev/misskey#12481)

Binary file not shown.

View file

@ -65,7 +65,7 @@
"sass": "1.69.5",
"shiki": "0.14.7",
"strict-event-emitter-types": "2.0.0",
"temml": "0.10.13",
"temml": "0.10.20",
"textarea-caret": "3.1.0",
"three": "0.159.0",
"throttle-debounce": "5.0.0",

View file

@ -1,27 +1,4 @@
/*
The MIT License (MIT)
Copyright (c) 2020 Ron Kok
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/*
The Latin Modern fonts are released under the GUST font license, which is
legally equivalent to the LaTeX Project Public License. See the files in this
directory for details. The fonts can be obtained from several TeX distributions
@ -36,215 +13,143 @@ Unicode range 1D49C to 1D4B5.
*/
@font-face {
font-family: 'Temml';
src: url('/assets/Temml.woff2') format('woff2');
font-weight: normal;
font-style: normal;
font-family: 'Temml';
src: url('assets/Temml.woff2') format('woff2');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: Latin Modern Math;
src: url('/assets/latinmodernmath.woff2');
font-family: Latin Modern Math;
src: url('assets/latinmodernmath.woff2');
}
math {
font-style: normal;
font-weight: normal;
line-height: normal;
font-size-adjust: none;
text-indent: 0;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
direction: ltr;
font-size: 120%;
font-style: normal;
font-weight: normal;
line-height: normal;
font-size-adjust: none;
text-indent: 0;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
direction: ltr;
}
math * {
border-color: currentColor;
border-color: currentColor;
}
math {
font-family: "Latin Modern Math", "Times New Roman", math;
font-family: "Latin Modern Math", math;
}
/* Next line is active in Firefox and Safari.
* Not in Chromium, which recognizes display: "block math" written inline. */
math.tml-display { display: block; }
*.mathscr {
font-family: "Temml";
font-family: "Temml";
}
/* Chromium prime alignment */
mo.tml-prime {
font-family: Temml;
font-family: Temml;
}
mrow.tml-cancel {
background: linear-gradient(to top left,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.06em),
rgba(0,0,0,1) 50%,
rgba(0,0,0,0) calc(50% + 0.06em),
rgba(0,0,0,0) 100%);
}
mrow.tml-bcancel {
background: linear-gradient(to top right,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.06em),
rgba(0,0,0,1) 50%,
rgba(0,0,0,0) calc(50% + 0.06em),
rgba(0,0,0,0) 100%);
}
mrow.tml-xcancel {
background: linear-gradient(to top left,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.06em),
rgba(0,0,0,1) 50%,
rgba(0,0,0,0) calc(50% + 0.06em),
rgba(0,0,0,0) 100%),
linear-gradient(to top right,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.06em),
rgba(0,0,0,1) 50%,
rgba(0,0,0,0) calc(50% + 0.06em),
rgba(0,0,0,0) 100%)
}
/* Prevent f' from overlapping in Chromium */
mo.prime-pad {
padding-left: 0.08em;
}
/* Array cell justification in Firefox & WebKit */
.tml-right {
text-align: right;
}
.tml-left {
text-align: left;
}
/* Stretch \widetilde & set array cell justification in Chromium */
@supports (not (-webkit-backdrop-filter: blur(1px))) and (not (-moz-appearance: none)) {
.tml-crooked-2 {
transform: scale(2.0, 1.1)
}
.tml-crooked-3 {
transform: scale(3.0, 1.3)
}
.tml-crooked-4 {
transform: scale(4.0, 1.4)
}
.tml-right {
text-align: -webkit-right;
}
.tml-left {
text-align: -webkit-left;
}
}
/* Adjust WebKit accents */
@supports (-webkit-backdrop-filter: blur(1px)) {
.tml-xshift { transform: translate(0px, 0.45em) }
.tml-capshift { transform: translate(0px, 0.35em) }
}
/* flex-wrap for line-breaking in Chromium */
math {
display: inline-flex;
flex-wrap: wrap;
align-items: baseline;
display: inline-flex;
flex-wrap: wrap;
align-items: baseline;
}
math > mrow {
padding: 0.5ex 0ex;
padding: 0.5ex 0ex;
}
/* Avoid flex-wrap in Firefox */
@supports (-moz-appearance:meterbar) and (display:flex) {
math { display: inline; }
math > mrow { padding: 0 }
@-moz-document url-prefix() {
math { display: inline; }
math > mrow { padding: 0 }
}
/* AMS environment auto-numbering via CSS counter. */
.tml-eqn::before {
counter-increment: tmlEqnNo;
content: "(" counter(tmlEqnNo) ")";
counter-increment: tmlEqnNo;
content: "(" counter(tmlEqnNo) ")";
}
body {
counter-reset: tmlEqnNo;
}
/* Environment arrays */
/* Environments that addjot to row spacing */
mtable.tml-jot > mtr > mtd {
padding-top: calc(0.5ex + 0.09em);
padding-bottom: calc(0.5ex + 0.09em);
}
/* Zero column gap for {alignat}, {split}, etc */
mtable.tml-abut > mtr > mtd,
mtable.tml-align > mtr > mtd:nth-child(odd),
mtable.tml-align-star > mtr > mtd:nth-child(even) {
padding-left: 0em;
padding-right: 0em;
}
mtable.tml-align > mtr > mtd:nth-child(even),
mtable.tml-align-star > mtr > mtd:nth-child(odd) {
padding-left: 1em;
padding-right: 0em;
}
mtable.tml-align > mtr > mtd:nth-child(1) {
padding-left: 0em;
}
mtable.tml-align > mtr > mtd:nth-child(odd),
mtable.tml-alignat > mtr > mtd:nth-child(odd),
mtable.tml-aligned > mtr > mtd:nth-child(even) {
text-align: -webkit-left;
text-align: -moz-left;
}
mtable.tml-align > mtr > mtd:nth-child(even),
mtable.tml-alignat > mtr > mtd:nth-child(even),
mtable.tml-aligned > mtr > mtd:nth-child(odd),
mtable.tml-align-star > mtr > mtd:nth-child(odd) {
text-align: -webkit-right;
text-align: -moz-right;
}
mtable.tml-cases > mtr > mtd {
padding-left: 0em;
padding-right: 0em;
text-align: -webkit-left;
text-align: -moz-left;
}
mtable.tml-cases > mtr > mtd:nth-child(2) {
padding-left: 1em;
}
mtable.tml-small > mtr > mtd {
padding-top: 0.35ex;
padding-bottom: 0.35ex;
padding-left: 0.1389em;
padding-right: 0.1389em;
}
mtable.tml-subarray > mtr > mtd {
padding-top: 0em;
padding-left: 0em;
}
mtable.tml-cd > mtr > mtd {
padding-left: 0.25em;
padding-right: 0.25em;
}
mtable > mtr:first-child > mtr > mtd {
padding-top: 0em;
}
mtable > mtr:last-child > mtr > mtd {
padding-bottom: 0em;
}
mtable:not(.tml-array) > mtr > mtd:first-child {
padding-left: 0em;
}
mtable:not(.tml-array) > mtr > mtd:last-child {
padding-right: 0em;
}
mtr.tml-top-solid > mtd {
border-top: 0.06em solid;
}
mtr.tml-top-double > mtd {
border-top: 0.15em double;
}
mtr.tml-top-dashed > mtd {
border-top: 0.06em dashed;
}
mtr.tml-hline-solid > mtd {
border-bottom: 0.06em solid;
}
mtr.tml-hline-double > mtd {
border-bottom: 0.15em double;
}
mtr.tml-hline-dashed > mtd {
border-bottom: 0.06em dashed;
}
/* MathML-Core does not support <menclose> attributes.
* So Use background images for \cancel */
menclose.cancel {
background:
linear-gradient(to top left,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.06em),
rgba(0,0,0,1) 50%,
rgba(0,0,0,0) calc(50% + 0.06em),
rgba(0,0,0,0) 100%);
}
menclose.bcancel {
background:
linear-gradient(to top right,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.06em),
rgba(0,0,0,1) 50%,
rgba(0,0,0,0) calc(50% + 0.06em),
rgba(0,0,0,0) 100%);
}
menclose.xcancel {
background:
linear-gradient(to top left,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.06em),
rgba(0,0,0,1) 50%,
rgba(0,0,0,0) calc(50% + 0.06em),
rgba(0,0,0,0) 100%),
linear-gradient(to top right,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.06em),
rgba(0,0,0,1) 50%,
rgba(0,0,0,0) calc(50% + 0.06em),
rgba(0,0,0,0) 100%);
counter-reset: tmlEqnNo;
}

View file

@ -903,8 +903,8 @@ importers:
specifier: 2.0.0
version: 2.0.0
temml:
specifier: 0.10.13
version: 0.10.13
specifier: 0.10.20
version: 0.10.20
textarea-caret:
specifier: 3.1.0
version: 3.1.0
@ -19049,8 +19049,8 @@ packages:
memoizerific: 1.11.3
dev: true
/temml@0.10.13:
resolution: {integrity: sha512-tW7MGueYNp/TEqYl1gEJLzov98Z6wQlZQ0VQ7xdGD4qzSKC2W5d05KmI66PGqDHEqbGXPrG2a/nynkni/G9AVA==}
/temml@0.10.20:
resolution: {integrity: sha512-UqT8IbGQnb/IWEqEP6Yh2TCUeS9oKwgP3VO7E/qfKN1jQ2rVr5KCmpFor+hkeRIxIyynvPlkJwGRGRYfO8qhoA==}
engines: {node: '>=18.13.0'}
dev: false