aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLarge Libravatar memdmp <memdmpestrogenzone>2025-07-21 22:17:01 +0000
committerLibravatarLarge Libravatar memdmp <memdmpestrogenzone>2025-07-21 22:17:01 +0000
commitdea384b91ac7d33b152a137fe392467abfac8602 (patch)
tree30feca452991a46413348ff3066b7098030367e3 /src
parent400fb710078963a3ad48c5769f54119ab35c68c7 (diff)
downloadfahrplan-dea384b91ac7d33b152a137fe392467abfac8602.tar.gz
fahrplan-dea384b91ac7d33b152a137fe392467abfac8602.tar.bz2
fahrplan-dea384b91ac7d33b152a137fe392467abfac8602.tar.lz
fahrplan-dea384b91ac7d33b152a137fe392467abfac8602.zip

fix: solve pixel cutoff, add fallback fonts

Diffstat (limited to 'src')
-rw-r--r--src/lib/assets/LineGlyph.svelte79
1 files changed, 61 insertions, 18 deletions
diff --git a/src/lib/assets/LineGlyph.svelte b/src/lib/assets/LineGlyph.svelte
index ffc95de..ac8a0d6 100644
--- a/src/lib/assets/LineGlyph.svelte
+++ b/src/lib/assets/LineGlyph.svelte
@@ -67,19 +67,22 @@
isNightRendering =
routeShortName.toUpperCase().startsWith('SN') ||
routeShortName.toUpperCase().startsWith('REN') ||
- routeShortName.toUpperCase().startsWith('IRN');
+ routeShortName.toUpperCase().startsWith('IRN'),
+ isErsatzverkehr = routeShortName.toUpperCase().startsWith('EV');
let currentColor = $derived(
_currentColor ?? (isRE ? '#eb0000' : 'currentColor')
);
+ const sbbFontFamilySvgDeclaration =
+ "font-family: SBB, 'SBB Web', 'Helvetica Neue', Helvetica, Inter, system-ui, sans-serif";
</script>
-<!-- svelte-ignore attribute_illegal_colon -->
<svg
- width="15.61mm"
- height="5.2919998mm"
- viewBox="0 0 15.61 5.2919998"
+ width="59"
+ height="20"
+ viewBox="0 0 15.61 5.2979998"
version="1.1"
id="svg1"
+ aria-label="{lineType} Line {line}"
data-kind={routeShortName}
data-type={lineType}
data-line={line}
@@ -94,13 +97,18 @@
})
: undefined}
>
- <defs id="defs1">
+ <defs id="defs1" aria-hidden="true">
<clipPath id="a">
<path fill="#fff" d="M0 0h59v20H0z" id="path3" />
</clipPath>
</defs>
{#if isFernverkehr}
- <g id="layer4" data-inkscape-label="Fernverkehr" style="display:inline">
+ <g
+ id="layer4"
+ data-inkscape-label="Fernverkehr"
+ style="display:inline"
+ aria-hidden="true"
+ >
<path
fill="#eb0000"
fill-rule="evenodd"
@@ -152,29 +160,64 @@
id="g2"
transform="scale(0.26458333)"
data-inkscape-label="Regioverkehr"
+ aria-hidden="true"
>
- <title id="title1">A</title>
<path
stroke="#000000"
d="M 2,0.5 H 57 A 1.5,1.5 0 0 1 58.5,2 V 18 A 1.5,1.5 0 0 1 57,19.5 H 2 A 1.5,1.5 0 0 1 0.5,18 V 2 A 1.5,1.5 0 0 1 2,0.5 Z"
id="path1-8"
- style="display:inline;fill:{nightIsFilled && isNightRendering
- ? '#000'
- : 'none'};stroke:{isNightRendering
- ? nightIsFilled
+ style="display:inline;fill:{isErsatzverkehr
+ ? '#e84e10'
+ : nightIsFilled && isNightRendering
? '#000'
- : '#FFDE15'
- : currentColor};stroke-opacity:1"
+ : 'none'};stroke:{isErsatzverkehr
+ ? '#e84e10'
+ : isNightRendering
+ ? nightIsFilled
+ ? '#000'
+ : '#FFDE15'
+ : currentColor};stroke-opacity:1"
data-inkscape-label="Background"
/>
<text
xml:space="preserve"
- style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.32594px;line-height:0;font-family:SBB;-inkscape-font-specification:'SBB, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;direction:ltr;text-anchor:start;display:inline;fill:{isNightRendering
- ? '#FFDE15'
- : currentColor};fill-opacity:1;stroke:{/*isNightRendering
+ style={[
+ 'font-style:normal',
+ 'font-variant:normal',
+ 'font-weight:bold',
+ 'font-stretch:normal',
+ 'font-size:4.32594px',
+ 'line-height:0',
+ sbbFontFamilySvgDeclaration,
+ "-inkscape-font-specification:'SBB, Bold'",
+ 'font-variant-ligatures:normal',
+ 'font-variant-caps:normal',
+ 'font-variant-numeric:normal',
+ 'font-variant-east-asian:normal',
+ 'text-align:start',
+ 'letter-spacing:0px',
+ 'word-spacing:0px',
+ 'writing-mode:lr-tb',
+ 'direction:ltr',
+ 'text-anchor:start',
+ 'display:inline',
+ `fill:${
+ isErsatzverkehr
+ ? '#000'
+ : isNightRendering
+ ? '#FFDE15'
+ : currentColor
+ }`,
+ 'fill-opacity:1',
+ `stroke:${
+ /*isNightRendering
? nightIsFilled
'#FFDE15'
- : currentColor*/ 'none'};stroke-width:0.0264583;stroke-opacity:1"
+ : currentColor*/ 'none'
+ }`,
+ 'stroke-width:0.0264583',
+ 'stroke-opacity:1',
+ ].join(';')}
x="0.80801982"
y="4.2193737"
id="text1"