Skip to content

Commit

Permalink
Merge branch 'main' into #512-unselect-multi-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
langonginc committed Dec 5, 2023
2 parents 421c33c + d7f03cc commit 4af7ae7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@
"last 1 safari version"
]
},
"version": "3.3.29"
"version": "3.3.31"
}
2 changes: 0 additions & 2 deletions public/styles/fonts_mtr.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

.rmp-name__mtr__zh {
font-family: Vegur, Helvetica, 'GenYoMin TW', HiraMinProN-W6, serif;
fill: #001f50;
}
.rmp-name__mtr__en {
font-family: Myriad Pro, Vegur, Helvetica, sans-serif;
fill: #001f50;
font-weight: bold;
}
2 changes: 2 additions & 0 deletions src/components/svgs/stations/mtr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const MTRStation = (props: StationComponentProps) => {
lineHeight={10}
grow="up"
baseOffset={1}
fill="#001f50"
className="rmp-name__mtr__zh"
/>
<MultilineText
Expand All @@ -144,6 +145,7 @@ const MTRStation = (props: StationComponentProps) => {
lineHeight={7.5}
grow="down"
baseOffset={1}
fill="#001f50"
className="rmp-name__mtr__en"
/>
</g>
Expand Down
10 changes: 8 additions & 2 deletions src/util/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,21 @@ export const makeImages = async (
Object.entries({
'.rmp-name__zh': ['font-family'],
'.rmp-name__en': ['font-family'],
'.rmp-name__mtr__zh': ['font-family', 'fill'],
'.rmp-name__mtr__en': ['font-family', 'fill'],
'.rmp-name__mtr__zh': ['font-family'],
'.rmp-name__mtr__en': ['font-family', 'font-weight'],
'.rmp-name__berlin': ['font-family'],
'.rmp-name-outline': ['paint-order', 'stroke', 'stroke-width', 'stroke-linejoin'],
}).forEach(([className, styleSet]) => {
const e = document.querySelector(className);
if (e === null) return; // no element in the canvas uses this class
const style = window.getComputedStyle(e);
elem.querySelectorAll(className).forEach(el => {
// Polyfill paint-order used in .rmp-name-outline for Adobe Illustrator.
// This is an SVG 2 specification and SVG 2 is not finalized or released yet.
// https://www.w3.org/TR/SVG2/painting.html#PaintOrder
if (className === '.rmp-name-outline')
el.insertAdjacentElement('afterend', el.cloneNode(true) as SVGElement);

styleSet.forEach(styleName => {
el.setAttribute(styleName, style.getPropertyValue(styleName));
});
Expand Down

0 comments on commit 4af7ae7

Please sign in to comment.