Compare commits

..
3 Commits
Author SHA1 Message Date
nvrl c0298dab38 chore(version + deps) 2026-11-18 02:01:30 +01:00
nvrl 3d6aa3c64c feat(branding) logo + app icon 2026-11-18 01:44:14 +01:00
nvrl a475ad3575 docs: 2.0 screenshots of the library, the whole library and a title page 2026-10-31 14:38:47 +01:00
31 changed files with 549 additions and 235 deletions

No files matched your search

Generated
+12 -11
View File
@@ -5218,13 +5218,14 @@ checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5"
[[package]] [[package]]
name = "proton-drive-rs" name = "proton-drive-rs"
version = "0.9.0" version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb9638bbcc807188ce43e6012361d0f5ce4ab70011f6160240df05e474eb3b54" checksum = "d05ad4be849ce2104759631063dd06867fbe6b6f0e5c37a172a84b5a90203fa7"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"base64 0.23.0", "base64 0.23.0",
"bytes", "bytes",
"chrono",
"futures", "futures",
"getrandom 0.4.3", "getrandom 0.4.3",
"hex", "hex",
@@ -5245,9 +5246,9 @@ dependencies = [
[[package]] [[package]]
name = "proton-sdk" name = "proton-sdk"
version = "0.9.0" version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79557071826330cebd39cf4081d6b75a42721134e5b442682d8e82e709584875" checksum = "80c381e9066c0bca3c32597df2e902eecaa4c6e05e202e70ec9d0ac2eec78bfe"
dependencies = [ dependencies = [
"aes-gcm 0.11.0", "aes-gcm 0.11.0",
"async-trait", "async-trait",
@@ -5279,7 +5280,7 @@ dependencies = [
[[package]] [[package]]
name = "pstr-android" name = "pstr-android"
version = "2.0.1" version = "2.1.0"
dependencies = [ dependencies = [
"android_logger", "android_logger",
"futures", "futures",
@@ -5299,7 +5300,7 @@ dependencies = [
[[package]] [[package]]
name = "pstr-app" name = "pstr-app"
version = "2.0.1" version = "2.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@@ -5333,7 +5334,7 @@ dependencies = [
[[package]] [[package]]
name = "pstr-cli" name = "pstr-cli"
version = "2.0.1" version = "2.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@@ -5352,7 +5353,7 @@ dependencies = [
[[package]] [[package]]
name = "pstr-core" name = "pstr-core"
version = "2.0.1" version = "2.1.0"
dependencies = [ dependencies = [
"directories", "directories",
"futures", "futures",
@@ -5372,7 +5373,7 @@ dependencies = [
[[package]] [[package]]
name = "pstr-meta" name = "pstr-meta"
version = "2.0.1" version = "2.1.0"
dependencies = [ dependencies = [
"pstr-core", "pstr-core",
"reqwest", "reqwest",
@@ -5385,7 +5386,7 @@ dependencies = [
[[package]] [[package]]
name = "pstr-player" name = "pstr-player"
version = "2.0.1" version = "2.1.0"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"libloading", "libloading",
@@ -5400,7 +5401,7 @@ dependencies = [
[[package]] [[package]]
name = "pstr-stream" name = "pstr-stream"
version = "2.0.1" version = "2.1.0"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"futures", "futures",
+3 -3
View File
@@ -11,7 +11,7 @@ members = [
] ]
[workspace.package] [workspace.package]
version = "2.0.1" version = "2.1.0"
edition = "2024" edition = "2024"
license = "MIT" license = "MIT"
repository = "https://github.com/narrrl/proton-stream" repository = "https://github.com/narrrl/proton-stream"
@@ -28,8 +28,8 @@ authors = ["Nils Pukropp <contact@narl.io>"]
opt-level = 2 opt-level = 2
[workspace.dependencies] [workspace.dependencies]
proton-sdk = { version = "0.9.0" } proton-sdk = { version = "0.12.1" }
proton-drive-rs = { version = "0.9.0" } proton-drive-rs = { version = "0.12.1" }
# Internal crates. # Internal crates.
pstr-core = { path = "crates/pstr-core" } pstr-core = { path = "crates/pstr-core" }
+2 -2
View File
@@ -1,8 +1,8 @@
<div align="center"> <div align="center">
<img src="images/logo.svg" alt="" width="112" height="112"> <a href="images/logo.svg"><img src="images/logo.svg" alt="Proton Stream icon" width="128" height="128"></a>
# proton-stream # Proton Stream
**Your Proton Drive, streaming.** A Netflix-style library for the videos in your Proton Drive and **Your Proton Drive, streaming.** A Netflix-style library for the videos in your Proton Drive and
the share links people send you, on Linux, Windows, Android, Android TV and iOS. the share links people send you, on Linux, Windows, Android, Android TV and iOS.
+1 -1
View File
@@ -39,7 +39,7 @@
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:label="@string/launcher_name" android:label="@string/app_name"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|uiMode|density|fontScale|locale|layoutDirection|keyboardHidden" android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|uiMode|density|fontScale|locale|layoutDirection|keyboardHidden"
android:exported="true" android:exported="true"
android:launchMode="singleTask" android:launchMode="singleTask"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 23 KiB

@@ -1,20 +1,5 @@
<!-- <?xml version="1.0" encoding="utf-8"?>
The launcher tile: packaging/io.narl.proton-stream.svg's face gradient, on <!-- Generated by scripts/render-branding.py; edit images/logo.svg. -->
the full 108dp canvas because the launcher cuts its own shape out of it. <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="108dp" android:height="108dp" android:viewportWidth="108" android:viewportHeight="108">
--> <path android:fillColor="#FFF4F0FA" android:pathData="M0 0H108V108H0Z" />
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp" android:height="108dp"
android:viewportWidth="108" android:viewportHeight="108">
<path android:pathData="M0,0h108v108h-108z">
<aapt:attr name="android:fillColor">
<gradient android:type="linear"
android:startX="0" android:startY="0"
android:endX="108" android:endY="108">
<item android:offset="0" android:color="#FFA48BFF" />
<item android:offset="0.55" android:color="#FF7552FF" />
<item android:offset="1" android:color="#FF5B36F2" />
</gradient>
</aapt:attr>
</path>
</vector> </vector>
@@ -1,34 +1,34 @@
<!-- <?xml version="1.0" encoding="utf-8"?>
The play mark from packaging/io.narl.proton-stream.svg, cut into the blocks a <!-- Generated by scripts/render-branding.py; edit images/logo.svg. -->
revision is fetched in. The paths are in the SVG's 128-unit space; the group <vector xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android" android:width="108dp" android:height="108dp" android:viewportWidth="108" android:viewportHeight="108">
maps its 104-unit tile onto the 72dp a launcher shows of a 108dp layer. <group android:scaleX="0.25" android:scaleY="0.25" android:translateX="22.0" android:translateY="22.0">
It centres x=70, between the glyph's centroid (66) and its box (73): the <group android:translateX="6" android:translateY="-6">
SVG's own centre, 64, leaves it sitting visibly right in a round mask. <path android:pathData="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" android:fillType="nonZero" android:fillAlpha="1" android:strokeColor="#FF7D4936" android:strokeWidth=".8" android:strokeAlpha="1" android:strokeLineJoin="round">
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp" android:height="108dp"
android:viewportWidth="108" android:viewportHeight="108">
<group
android:pivotX="70" android:pivotY="62"
android:scaleX="0.6923" android:scaleY="0.6923"
android:translateX="-16" android:translateY="-8">
<group android:translateY="3">
<clip-path android:pathData="M0,0h63v128h-63zM68.5,0h10v128h-10zM84,0h44v128h-44z" />
<path android:fillColor="#4D2E1596" android:pathData="M50,41.5v41a6,6 0,0 0,9.1 5.1l34.2,-20.5a6,6 0,0 0,0 -10.3L59.1,36.4A6,6 0,0 0,50 41.5z" />
</group>
<group>
<clip-path android:pathData="M0,0h63v128h-63zM68.5,0h10v128h-10zM84,0h44v128h-44z" />
<path android:pathData="M50,41.5v41a6,6 0,0 0,9.1 5.1l34.2,-20.5a6,6 0,0 0,0 -10.3L59.1,36.4A6,6 0,0 0,50 41.5z">
<aapt:attr name="android:fillColor"> <aapt:attr name="android:fillColor">
<gradient android:type="linear" <gradient android:type="linear" android:startX="32" android:startY="32" android:endX="232" android:endY="224">
android:startX="0" android:startY="36" <item android:offset="0" android:color="#FF703E30" />
android:endX="0" android:endY="88"> <item android:offset=".16" android:color="#FFB47456" />
<item android:offset="0" android:color="#FFFFFFFF" /> <item android:offset=".28" android:color="#FFE6B296" />
<item android:offset="1" android:color="#FFECE6FF" /> <item android:offset=".32" android:color="#FFF8D8C3" />
<item android:offset=".37" android:color="#FFBB7C5A" />
<item android:offset=".56" android:color="#FF8A4D36" />
<item android:offset=".69" android:color="#FFD69B77" />
<item android:offset=".75" android:color="#FFF2C9AA" />
<item android:offset=".81" android:color="#FFB87956" />
<item android:offset="1" android:color="#FF713F30" />
</gradient> </gradient>
</aapt:attr> </aapt:attr>
</path> </path>
</group> </group>
<path android:pathData="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" android:fillType="nonZero" android:fillAlpha="1" android:strokeColor="#FF5936B7" android:strokeWidth=".9" android:strokeAlpha="1" android:strokeLineJoin="round">
<aapt:attr name="android:fillColor">
<gradient android:type="linear" android:startX="36" android:startY="212" android:endX="220" android:endY="54">
<item android:offset="0" android:color="#FF6240DA" />
<item android:offset=".52" android:color="#FF8056EF" />
<item android:offset="1" android:color="#FFD58BDF" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M44 69V52C44 42 54 36 63 41L217 119" android:fillType="nonZero" android:fillColor="#00000000" android:fillAlpha="1" android:strokeColor="#FFF3DDF9" android:strokeWidth="1.5" android:strokeAlpha="0.55" android:strokeLineCap="round" />
</group> </group>
</vector> </vector>
@@ -1,12 +1,10 @@
<!-- The foreground's glyph as one flat shape, for themed launcher icons. --> <?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" <!-- Generated by scripts/render-branding.py; edit images/logo.svg. -->
android:width="108dp" android:height="108dp" <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="108dp" android:height="108dp" android:viewportWidth="108" android:viewportHeight="108">
android:viewportWidth="108" android:viewportHeight="108"> <group android:scaleX="0.25" android:scaleY="0.25" android:translateX="22.0" android:translateY="22.0">
<group <group android:translateX="6" android:translateY="-6">
android:pivotX="70" android:pivotY="62" <path android:pathData="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" android:fillType="nonZero" android:fillColor="#FFFFFFFF" />
android:scaleX="0.6923" android:scaleY="0.6923" </group>
android:translateX="-16" android:translateY="-8"> <path android:pathData="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" android:fillType="nonZero" android:fillColor="#FFFFFFFF" />
<clip-path android:pathData="M0,0h63v128h-63zM68.5,0h10v128h-10zM84,0h44v128h-44z" />
<path android:fillColor="#FFFFFFFF" android:pathData="M50,41.5v41a6,6 0,0 0,9.1 5.1l34.2,-20.5a6,6 0,0 0,0 -10.3L59.1,36.4A6,6 0,0 0,50 41.5z" />
</group> </group>
</vector> </vector>
@@ -1,16 +1,10 @@
<!-- <?xml version="1.0" encoding="utf-8"?>
The status-bar glyph. Android tints small icons to a single colour and drops <!-- Generated by scripts/render-branding.py; edit images/logo.svg. -->
everything that is not opaque, so this is the launcher's sliced play mark as <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
one white silhouette, scaled from the SVG's 128-unit space onto 24dp. <group android:scaleX="0.09375" android:scaleY="0.09375" android:translateX="0.0" android:translateY="0.0">
--> <group android:translateX="6" android:translateY="-6">
<vector xmlns:android="http://schemas.android.com/apk/res/android" <path android:pathData="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" android:fillType="nonZero" android:fillColor="#FFFFFFFF" />
android:width="24dp" android:height="24dp" </group>
android:viewportWidth="24" android:viewportHeight="24"> <path android:pathData="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" android:fillType="nonZero" android:fillColor="#FFFFFFFF" />
<group
android:pivotX="70" android:pivotY="62"
android:scaleX="0.37" android:scaleY="0.37"
android:translateX="-58" android:translateY="-50">
<clip-path android:pathData="M0,0h63v128h-63zM68.5,0h10v128h-10zM84,0h44v128h-44z" />
<path android:fillColor="#FFFFFFFF" android:pathData="M50,41.5v41a6,6 0,0 0,9.1 5.1l34.2,-20.5a6,6 0,0 0,0 -10.3L59.1,36.4A6,6 0,0 0,50 41.5z" />
</group> </group>
</vector> </vector>
+1 -6
View File
@@ -1,9 +1,4 @@
<resources> <resources>
<!-- Settings, recents, notifications and the share sheet: room for the full name. --> <!-- One product name for the launcher, settings, recents and share sheet. -->
<string name="app_name">Proton Stream</string> <string name="app_name">Proton Stream</string>
<!--
Under the launcher icon, where about ten characters fit before the
launcher cuts the label off; "proton-stream" showed as "proton-st…".
-->
<string name="launcher_name">Stream</string>
</resources> </resources>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 16 KiB

+5
View File
@@ -7,6 +7,11 @@ screens, while UniFFI exposes the existing catalog, share, streaming, watch-stat
and offline logic. Keep reusable behavior in the Rust crates rather than and offline logic. Keep reusable behavior in the Rust crates rather than
reimplementing it in Kotlin. reimplementing it in Kotlin.
The application and launcher activity both use **Proton Stream** from `app_name`;
keep the full name on phones, tablets and TV. The adaptive color and
monochrome icons and TV banner are generated from `images/logo.svg` with
`python scripts/render-branding.py` (`--check` verifies generated assets).
## Android TV ## Android TV
The same build installs on Android TV: it is listed in the TV launcher The same build installs on Android TV: it is listed in the TV launcher
+4 -3
View File
@@ -54,9 +54,10 @@ every push to `main` and every pull request that touches the iOS sources or the
crates under them. `release.yml` calls it too, and publishes the `.ipa` next to the crates under them. `release.yml` calls it too, and publishes the `.ipa` next to the
other artifacts. other artifacts.
`scripts/render-ios-icon.sh` renders `ios/ProtonStream/Resources/AppIcon.svg`, which `python scripts/render-branding.py` generates the platform icons from the canonical
is Android's adaptive launcher icon with both layers on one canvas, into the asset `images/logo.svg`, including the opaque 1024 px iOS icon and its full-bleed source
catalog. `ios/ProtonStream/Resources/AppIcon.svg`. `scripts/render-ios-icon.sh` delegates to
the same generator. Use `--check` to verify that all generated assets are current.
## Where iOS differs ## Where iOS differs
+5
View File
@@ -4,6 +4,11 @@ The Android and iOS apps share the desktop app's engine, so a library, its watch
settings behave the same everywhere. This page covers what is different on a phone, a tablet and settings behave the same everywhere. This page covers what is different on a phone, a tablet and
a TV. [Installation](INSTALL.md) explains how to install each one. a TV. [Installation](INSTALL.md) explains how to install each one.
The Android launcher, app settings and share sheet use the full name **Proton Stream**.
Its violet–pink play prism with metallic copper depth belongs to the same icon family as Drive
and Gallery. Android launchers that support themed icons can also display its
monochrome play mark.
<table> <table>
<tr> <tr>
<td><img src="../images/android-home.png" alt="Home" width="200"></td> <td><img src="../images/android-home.png" alt="Home" width="200"></td>
+6
View File
@@ -3,6 +3,10 @@
This page describes the desktop app. The Android and iOS apps have the same pages as tabs at the This page describes the desktop app. The Android and iOS apps have the same pages as tabs at the
bottom of the screen; [Android and iOS](MOBILE.md) covers what is different there. bottom of the screen; [Android and iOS](MOBILE.md) covers what is different there.
The app uses a violet–pink play prism with a narrow metallic copper edge. The same
mark appears in the launcher and desktop notifications, with a white silhouette
for Android status-bar notifications and themed launcher icons.
The app has five pages, in the bar at the top: **Library**, **History**, **Shares**, The app has five pages, in the bar at the top: **Library**, **History**, **Shares**,
**Downloads** and **Settings**. **Ctrl+1** to **Ctrl+5** open them. **Downloads** and **Settings**. **Ctrl+1** to **Ctrl+5** open them.
@@ -89,6 +93,8 @@ containers.
## A title's page ## A title's page
<img src="../images/desktop-title.png" alt="A title's page" width="820">
Click a title to open its page. **Esc** goes back. On a phone, the picture at the top slides Click a title to open its page. **Esc** goes back. On a phone, the picture at the top slides
away more slowly than the page, and once it has gone a bar with the title's name stays at the away more slowly than the page, and once it has gone a bar with the title's name stays at the
top. top.
+38
View File
@@ -0,0 +1,38 @@
# Violet / Copper vector branding
Drive, Stream, and Gallery share frontal violet–pink faces, shallow metallic copper backing, and narrow edge highlights. The icons are editable vector artwork with no embedded images or raster effects.
| App | Mark |
| --- | --- |
| Proton Drive for Linux | Open folder with lilac documents |
| Proton Stream | Rounded play prism |
| Proton Gallery | Stacked photo plates, mountains, and a copper sun |
## Master artwork
Edit `images/logo.svg`. It uses a 256-unit grid with transparent margins, a `mark` group, and reusable linear gradients. The copper backing extends six units up and right. SVG paths, rounded rectangles, circles, strokes, translation, and the photo clip are retained when exporting Android VectorDrawables. Unsupported SVG features cause generation to fail rather than silently change the artwork.
Earlier artwork is preserved in `images/branding-archive/`. The new assets replace the active branding without removing previous designs.
## Regeneration
```sh
python scripts/render-branding.py
python scripts/render-branding.py --check
```
Requires Python 3, librsvg (`rsvg-convert`), and ImageMagick (`magick`). Stream's TV banner also requires fontconfig and DejaVu Sans. Keep the generator identical across the three repositories; every checkout renders independently and requires no sibling checkout. Edit the canonical master rather than generated platform assets.
## Platform treatment
- Desktop SVGs and PNGs retain transparent margins and the exact approved geometry. The same colored artwork works on light and dark surfaces.
- Android adaptive icons use a pale lavender full-bleed background and a separate foreground containing the complete object. The 256-unit canvas maps to the central 64dp of the 108dp adaptive canvas; the painted geometry stays within the central safe circle. Android supplies the outer mask.
- Themed launcher icons and Stream's status-bar notification icon use a white silhouette without colored bevel highlights.
- iOS uses the same play prism over an opaque pale lavender square, exported at 1024px. The system supplies the corner mask.
- The Android TV banner pairs the play prism with the full Proton Stream name.
Keep full product names in launcher metadata. Application UI typography and photo-content icons are independent of this branding.
## Outputs
Generated outputs include the packaged desktop SVG, the desktop/window/notification PNG, Windows ICO (16, 24, 32, 48, 64, 128, and 256px), Android adaptive and monochrome layers, status-bar notification mark, Android TV banner, iOS source SVG, and opaque 1024px iOS icon. The compatibility entry points `render-ios-icon.sh` and `render-tv-banner.sh` invoke this same generator.
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128"
role="img" aria-label="Proton Stream" data-app="stream">
<title>Proton Stream</title>
<desc>A forward play mark with three motion trails, in violet warming to copper at its tip.</desc>
<!-- Canonical artwork. Regenerate platform assets with scripts/render-branding.py. -->
<defs>
<linearGradient id="face" x1="18" y1="12" x2="112" y2="116" gradientUnits="userSpaceOnUse">
<stop stop-color="#F6F2FC"/>
<stop offset="1" stop-color="#E5DDEE"/>
</linearGradient>
<linearGradient id="material" x1="32" y1="40" x2="105" y2="75" gradientUnits="userSpaceOnUse">
<stop stop-color="#9170E2"/>
<stop offset=".38" stop-color="#6D4AFF"/>
<stop offset=".6" stop-color="#7044D1"/>
<stop offset=".82" stop-color="#A66598"/>
<stop offset="1" stop-color="#B56D51"/>
</linearGradient>
</defs>
<rect x="12" y="12" width="104" height="104" rx="27" fill="url(#face)"/>
<rect x="12.75" y="12.75" width="102.5" height="102.5" rx="26.25"
fill="none" stroke="#A18CB7" stroke-width="1.5"/>
<g id="mark">
<path d="M52 38C52 34.2 56.1 31.8 59.4 33.8L97.6 57C101.4 59.3 101.4 64.8 97.6 67.1L59.4 90.3C56.1 92.3 52 89.9 52 86.1Z" fill="url(#material)" fill-rule="nonzero"/>
<path d="M33 42H40A4 4 0 0 1 40 50H33A4 4 0 0 1 33 42Z M28 58H40A4 4 0 0 1 40 66H28A4 4 0 0 1 28 58Z M33 74H40A4 4 0 0 1 40 82H33A4 4 0 0 1 33 74Z" fill="url(#material)" fill-rule="nonzero"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

+39 -38
View File
@@ -1,39 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256" data-app="stream" role="img" aria-labelledby="stream-title stream-desc">
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="proton-stream"> <title id="stream-title">Proton Stream</title>
<defs> <desc id="stream-desc">Frontal violet and pink vector icon with shallow metallic copper backing.</desc>
<linearGradient id="ps-face" x1="12" y1="12" x2="116" y2="112" gradientUnits="userSpaceOnUse"> <defs>
<stop offset="0" stop-color="#A48BFF"/> <linearGradient id="stream-face" x1="36" y1="212" x2="220" y2="54" gradientUnits="userSpaceOnUse">
<stop offset="0.55" stop-color="#7552FF"/> <stop stop-color="#6240DA"/><stop offset=".52" stop-color="#8056EF"/><stop offset="1" stop-color="#D58BDF"/>
<stop offset="1" stop-color="#5B36F2"/> </linearGradient>
</linearGradient> <linearGradient id="stream-rear" x1="26" y1="42" x2="218" y2="220" gradientUnits="userSpaceOnUse">
<linearGradient id="ps-glyph" x1="0" y1="36" x2="0" y2="88" gradientUnits="userSpaceOnUse"> <stop stop-color="#8C68EE"/><stop offset="1" stop-color="#5533B5"/>
<stop offset="0" stop-color="#FFFFFF"/> </linearGradient>
<stop offset="1" stop-color="#ECE6FF"/> <linearGradient id="stream-paper" x1="60" y1="80" x2="180" y2="162" gradientUnits="userSpaceOnUse">
</linearGradient> <stop stop-color="#E7DFFA"/><stop offset="1" stop-color="#BDA5EF"/>
<!-- The play mark, cut into the blocks a revision is fetched in: each one </linearGradient>
decrypts on its own, which is the whole reason this app can seek. --> <linearGradient id="stream-copper" x1="32" y1="32" x2="232" y2="224" gradientUnits="userSpaceOnUse">
<mask id="ps-cut" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="128"> <stop stop-color="#703E30"/><stop offset=".16" stop-color="#B47456"/>
<path d="M50 41.5v41a6 6 0 0 0 9.1 5.1l34.2-20.5a6 6 0 0 0 0-10.3L59.1 36.4A6 6 0 0 0 50 41.5z" fill="#FFFFFF"/> <stop offset=".28" stop-color="#E6B296"/><stop offset=".32" stop-color="#F8D8C3"/>
<g fill="#000000"> <stop offset=".37" stop-color="#BB7C5A"/><stop offset=".56" stop-color="#8A4D36"/>
<rect x="63" y="0" width="5.5" height="128"/> <stop offset=".69" stop-color="#D69B77"/><stop offset=".75" stop-color="#F2C9AA"/>
<rect x="78.5" y="0" width="5.5" height="128"/> <stop offset=".81" stop-color="#B87956"/><stop offset="1" stop-color="#713F30"/>
</g> </linearGradient>
</mask> <linearGradient id="stream-sun" x1="172" y1="82" x2="201" y2="112" gradientUnits="userSpaceOnUse">
</defs> <stop stop-color="#8D513A"/><stop offset=".33" stop-color="#DDA581"/>
<stop offset=".47" stop-color="#F7D8B8"/><stop offset=".53" stop-color="#D69B74"/>
<!-- base: a rounded tile with a darker lower edge for depth --> <stop offset="1" stop-color="#925439"/>
<rect x="12" y="16" width="104" height="100" rx="26" fill="#4424C0"/> </linearGradient>
<rect x="12" y="12" width="104" height="100" rx="26" fill="url(#ps-face)"/> <linearGradient id="stream-mountain" x1="44" y1="148" x2="186" y2="218" gradientUnits="userSpaceOnUse">
<rect x="12.5" y="12.5" width="103" height="99" rx="25.5" stroke="#FFFFFF" stroke-opacity="0.2"/> <stop stop-color="#D9C9FA"/><stop offset="1" stop-color="#A582E9"/>
</linearGradient>
<!-- glyph shadow, then the glyph itself. The mark's box centres on x=73 and <linearGradient id="stream-far-mountain" x1="142" y1="152" x2="211" y2="216" gradientUnits="userSpaceOnUse">
its centroid on x=66; it sits at 70 -> 64, between the two, because the <stop stop-color="#E8B4EB"/><stop offset="1" stop-color="#BB7BD7"/>
box centre reads as too far left and the centroid as too far right. The </linearGradient>
Android and iOS icons centre it the same way. --> <clipPath id="stream-photo-clip"><rect x="28" y="54" width="194" height="172" rx="24"/></clipPath>
<g transform="translate(-6 0)"> </defs>
<g transform="translate(0 3)"> <!-- Canonical vector artwork; regenerate platform assets with scripts/render-branding.py. -->
<rect width="128" height="128" fill="#2E1596" fill-opacity="0.3" mask="url(#ps-cut)"/> <g id="mark">
</g> <path d="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" fill="url(#stream-copper)" transform="translate(6 -6)" stroke="#7D4936" stroke-width=".8" stroke-linejoin="round"/>
<rect width="128" height="128" fill="url(#ps-glyph)" mask="url(#ps-cut)"/> <path d="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" fill="url(#stream-face)" stroke="#5936B7" stroke-width=".9" stroke-linejoin="round"/>
</g> <path d="M44 69V52C44 42 54 36 63 41L217 119" fill="none" stroke="#F3DDF9" stroke-opacity=".55" stroke-width="1.5" stroke-linecap="round"/>
</g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

+42 -36
View File
@@ -1,37 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!-- Generated by scripts/render-branding.py; edit images/logo.svg. -->
The iOS app icon: Android's adaptive launcher icon, both layers on the full <svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 256 256">
108-unit canvas, since iOS cuts its own shape out of a square just as a <defs xmlns="http://www.w3.org/2000/svg">
launcher does. Layer sources: android/app/src/main/res/drawable/ <linearGradient id="stream-face" x1="36" y1="212" x2="220" y2="54" gradientUnits="userSpaceOnUse">
ic_launcher_background.xml and ic_launcher_foreground.xml. The glyph is <stop stop-color="#6240DA" /><stop offset=".52" stop-color="#8056EF" /><stop offset="1" stop-color="#D58BDF" />
scaled up by 108/72: a launcher shows only the middle 72 units of the layer, </linearGradient>
and iOS's mask takes far less off the edges. <linearGradient id="stream-rear" x1="26" y1="42" x2="218" y2="220" gradientUnits="userSpaceOnUse">
Render with scripts/render-ios-icon.sh. <stop stop-color="#8C68EE" /><stop offset="1" stop-color="#5533B5" />
--> </linearGradient>
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 108 108"> <linearGradient id="stream-paper" x1="60" y1="80" x2="180" y2="162" gradientUnits="userSpaceOnUse">
<defs> <stop stop-color="#E7DFFA" /><stop offset="1" stop-color="#BDA5EF" />
<linearGradient id="face" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="108" y2="108"> </linearGradient>
<stop offset="0" stop-color="#A48BFF"/> <linearGradient id="stream-copper" x1="32" y1="32" x2="232" y2="224" gradientUnits="userSpaceOnUse">
<stop offset="0.55" stop-color="#7552FF"/> <stop stop-color="#703E30" /><stop offset=".16" stop-color="#B47456" />
<stop offset="1" stop-color="#5B36F2"/> <stop offset=".28" stop-color="#E6B296" /><stop offset=".32" stop-color="#F8D8C3" />
</linearGradient> <stop offset=".37" stop-color="#BB7C5A" /><stop offset=".56" stop-color="#8A4D36" />
<linearGradient id="glyph" gradientUnits="userSpaceOnUse" x1="0" y1="36" x2="0" y2="88"> <stop offset=".69" stop-color="#D69B77" /><stop offset=".75" stop-color="#F2C9AA" />
<stop offset="0" stop-color="#FFFFFF"/> <stop offset=".81" stop-color="#B87956" /><stop offset="1" stop-color="#713F30" />
<stop offset="1" stop-color="#ECE6FF"/> </linearGradient>
</linearGradient> <linearGradient id="stream-sun" x1="172" y1="82" x2="201" y2="112" gradientUnits="userSpaceOnUse">
<clipPath id="blocks"> <stop stop-color="#8D513A" /><stop offset=".33" stop-color="#DDA581" />
<path d="M0,0h63v128h-63zM68.5,0h10v128h-10zM84,0h44v128h-44z"/> <stop offset=".47" stop-color="#F7D8B8" /><stop offset=".53" stop-color="#D69B74" />
</clipPath> <stop offset="1" stop-color="#925439" />
</defs> </linearGradient>
<rect width="108" height="108" fill="url(#face)"/> <linearGradient id="stream-mountain" x1="44" y1="148" x2="186" y2="218" gradientUnits="userSpaceOnUse">
<g transform="translate(54 54) scale(1.5) translate(-54 -54)"> <stop stop-color="#D9C9FA" /><stop offset="1" stop-color="#A582E9" />
<g transform="translate(-16 -8) translate(70 62) scale(0.6923) translate(-70 -62)"> </linearGradient>
<g transform="translate(0 3)" clip-path="url(#blocks)"> <linearGradient id="stream-far-mountain" x1="142" y1="152" x2="211" y2="216" gradientUnits="userSpaceOnUse">
<path fill="#2E1596" fill-opacity="0.302" d="M50,41.5v41a6,6 0,0 0,9.1 5.1l34.2,-20.5a6,6 0,0 0,0 -10.3L59.1,36.4A6,6 0,0 0,50 41.5z"/> <stop stop-color="#E8B4EB" /><stop offset="1" stop-color="#BB7BD7" />
</g> </linearGradient>
<g clip-path="url(#blocks)"> <clipPath id="stream-photo-clip"><rect x="28" y="54" width="194" height="172" rx="24" /></clipPath>
<path fill="url(#glyph)" d="M50,41.5v41a6,6 0,0 0,9.1 5.1l34.2,-20.5a6,6 0,0 0,0 -10.3L59.1,36.4A6,6 0,0 0,50 41.5z"/> </defs>
</g>
</g>
</g> <rect width="256" height="256" fill="#F4F0FA"/>
<g xmlns="http://www.w3.org/2000/svg" id="mark">
<path d="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" fill="url(#stream-copper)" transform="translate(6 -6)" stroke="#7D4936" stroke-width=".8" stroke-linejoin="round" />
<path d="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" fill="url(#stream-face)" stroke="#5936B7" stroke-width=".9" stroke-linejoin="round" />
<path d="M44 69V52C44 42 54 36 63 41L217 119" fill="none" stroke="#F3DDF9" stroke-opacity=".55" stroke-width="1.5" stroke-linecap="round" />
</g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 84 KiB

+1 -1
View File
@@ -14,7 +14,7 @@
# builds from the registry alone. # builds from the registry alone.
pkgname=proton-stream pkgname=proton-stream
pkgver=2.0.1 pkgver=2.1.0
pkgrel=1 pkgrel=1
pkgdesc="Netflix-style desktop client for Proton Drive public links: browse and stream a share" pkgdesc="Netflix-style desktop client for Proton Drive public links: browse and stream a share"
arch=('x86_64') arch=('x86_64')
+39 -38
View File
@@ -1,39 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256" data-app="stream" role="img" aria-labelledby="stream-title stream-desc">
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="proton-stream"> <title id="stream-title">Proton Stream</title>
<defs> <desc id="stream-desc">Frontal violet and pink vector icon with shallow metallic copper backing.</desc>
<linearGradient id="ps-face" x1="12" y1="12" x2="116" y2="112" gradientUnits="userSpaceOnUse"> <defs>
<stop offset="0" stop-color="#A48BFF"/> <linearGradient id="stream-face" x1="36" y1="212" x2="220" y2="54" gradientUnits="userSpaceOnUse">
<stop offset="0.55" stop-color="#7552FF"/> <stop stop-color="#6240DA"/><stop offset=".52" stop-color="#8056EF"/><stop offset="1" stop-color="#D58BDF"/>
<stop offset="1" stop-color="#5B36F2"/> </linearGradient>
</linearGradient> <linearGradient id="stream-rear" x1="26" y1="42" x2="218" y2="220" gradientUnits="userSpaceOnUse">
<linearGradient id="ps-glyph" x1="0" y1="36" x2="0" y2="88" gradientUnits="userSpaceOnUse"> <stop stop-color="#8C68EE"/><stop offset="1" stop-color="#5533B5"/>
<stop offset="0" stop-color="#FFFFFF"/> </linearGradient>
<stop offset="1" stop-color="#ECE6FF"/> <linearGradient id="stream-paper" x1="60" y1="80" x2="180" y2="162" gradientUnits="userSpaceOnUse">
</linearGradient> <stop stop-color="#E7DFFA"/><stop offset="1" stop-color="#BDA5EF"/>
<!-- The play mark, cut into the blocks a revision is fetched in: each one </linearGradient>
decrypts on its own, which is the whole reason this app can seek. --> <linearGradient id="stream-copper" x1="32" y1="32" x2="232" y2="224" gradientUnits="userSpaceOnUse">
<mask id="ps-cut" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="128"> <stop stop-color="#703E30"/><stop offset=".16" stop-color="#B47456"/>
<path d="M50 41.5v41a6 6 0 0 0 9.1 5.1l34.2-20.5a6 6 0 0 0 0-10.3L59.1 36.4A6 6 0 0 0 50 41.5z" fill="#FFFFFF"/> <stop offset=".28" stop-color="#E6B296"/><stop offset=".32" stop-color="#F8D8C3"/>
<g fill="#000000"> <stop offset=".37" stop-color="#BB7C5A"/><stop offset=".56" stop-color="#8A4D36"/>
<rect x="63" y="0" width="5.5" height="128"/> <stop offset=".69" stop-color="#D69B77"/><stop offset=".75" stop-color="#F2C9AA"/>
<rect x="78.5" y="0" width="5.5" height="128"/> <stop offset=".81" stop-color="#B87956"/><stop offset="1" stop-color="#713F30"/>
</g> </linearGradient>
</mask> <linearGradient id="stream-sun" x1="172" y1="82" x2="201" y2="112" gradientUnits="userSpaceOnUse">
</defs> <stop stop-color="#8D513A"/><stop offset=".33" stop-color="#DDA581"/>
<stop offset=".47" stop-color="#F7D8B8"/><stop offset=".53" stop-color="#D69B74"/>
<!-- base: a rounded tile with a darker lower edge for depth --> <stop offset="1" stop-color="#925439"/>
<rect x="12" y="16" width="104" height="100" rx="26" fill="#4424C0"/> </linearGradient>
<rect x="12" y="12" width="104" height="100" rx="26" fill="url(#ps-face)"/> <linearGradient id="stream-mountain" x1="44" y1="148" x2="186" y2="218" gradientUnits="userSpaceOnUse">
<rect x="12.5" y="12.5" width="103" height="99" rx="25.5" stroke="#FFFFFF" stroke-opacity="0.2"/> <stop stop-color="#D9C9FA"/><stop offset="1" stop-color="#A582E9"/>
</linearGradient>
<!-- glyph shadow, then the glyph itself. The mark's box centres on x=73 and <linearGradient id="stream-far-mountain" x1="142" y1="152" x2="211" y2="216" gradientUnits="userSpaceOnUse">
its centroid on x=66; it sits at 70 -> 64, between the two, because the <stop stop-color="#E8B4EB"/><stop offset="1" stop-color="#BB7BD7"/>
box centre reads as too far left and the centroid as too far right. The </linearGradient>
Android and iOS icons centre it the same way. --> <clipPath id="stream-photo-clip"><rect x="28" y="54" width="194" height="172" rx="24"/></clipPath>
<g transform="translate(-6 0)"> </defs>
<g transform="translate(0 3)"> <!-- Canonical vector artwork; regenerate platform assets with scripts/render-branding.py. -->
<rect width="128" height="128" fill="#2E1596" fill-opacity="0.3" mask="url(#ps-cut)"/> <g id="mark">
</g> <path d="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" fill="url(#stream-copper)" transform="translate(6 -6)" stroke="#7D4936" stroke-width=".8" stroke-linejoin="round"/>
<rect width="128" height="128" fill="url(#ps-glyph)" mask="url(#ps-cut)"/> <path d="M65 37C54 31 40 39 40 52V212C40 225 54 233 65 227L219 141C230 135 230 121 219 115Z" fill="url(#stream-face)" stroke="#5936B7" stroke-width=".9" stroke-linejoin="round"/>
</g> <path d="M44 69V52C44 42 54 36 63 41L217 119" fill="none" stroke="#F3DDF9" stroke-opacity=".55" stroke-width="1.5" stroke-linecap="round"/>
</g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 KiB

After

Width:  |  Height:  |  Size: 361 KiB

+273
View File
@@ -0,0 +1,273 @@
#!/usr/bin/env python3
"""Render the vector branding into desktop, Android, iOS and Windows assets.
Kept identical across the suite; each checkout renders independently.
"""
import argparse
from pathlib import Path
import re
import shutil
import subprocess
import tempfile
import xml.etree.ElementTree as ET
SVG = "{http://www.w3.org/2000/svg}"
ANDROID = "{http://schemas.android.com/apk/res/android}"
AAPT = "{http://schemas.android.com/aapt}"
ET.register_namespace("", SVG[1:-1])
ET.register_namespace("android", ANDROID[1:-1])
ET.register_namespace("aapt", AAPT[1:-1])
HEADER = '<?xml version="1.0" encoding="utf-8"?>\n'
GENERATED = '<!-- Generated by scripts/render-branding.py; edit images/logo.svg. -->\n'
ROOT = Path(__file__).resolve().parent.parent
BACKGROUND = "#F4F0FA"
def run(*args, data=None):
return subprocess.run(args, input=data, stdout=subprocess.PIPE, check=True).stdout
def render(svg, size, *, opaque=False):
png = run("rsvg-convert", "-w", str(size), data=svg.encode())
options = ["-background", BACKGROUND, "-alpha", "remove", "-alpha", "off"] if opaque else []
return run("magick", "-", *options, "-strip", "PNG:-", data=png)
def shape_path(node):
"""Use the same paths on Android, including rounded rectangles and circles."""
tag = node.tag.removeprefix(SVG)
a = node.attrib
if tag == "path":
return a["d"]
if tag == "circle":
x, y, r = (float(a[k]) for k in ("cx", "cy", "r"))
return f"M{x-r:g} {y:g}a{r:g} {r:g} 0 1 0 {2*r:g} 0a{r:g} {r:g} 0 1 0 {-2*r:g} 0Z"
if tag == "rect":
x, y = float(a.get("x", 0)), float(a.get("y", 0))
w, h = float(a["width"]), float(a["height"])
rx = min(float(a.get("rx", a.get("ry", 0))), w / 2)
ry = min(float(a.get("ry", a.get("rx", 0))), h / 2)
if not rx or not ry:
return f"M{x:g} {y:g}h{w:g}v{h:g}h{-w:g}Z"
return (f"M{x+rx:g} {y:g}H{x+w-rx:g}a{rx:g} {ry:g} 0 0 1 {rx:g} {ry:g}"
f"V{y+h-ry:g}a{rx:g} {ry:g} 0 0 1 {-rx:g} {ry:g}"
f"H{x+rx:g}a{rx:g} {ry:g} 0 0 1 {-rx:g} {-ry:g}"
f"V{y+ry:g}a{rx:g} {ry:g} 0 0 1 {rx:g} {-ry:g}Z")
raise ValueError(f"Unsupported SVG shape: {tag}")
def color(value):
if value == "none":
return "#00000000"
if re.fullmatch(r"#[0-9a-fA-F]{6}", value):
return "#FF" + value[1:]
raise ValueError(f"Unsupported SVG color: {value}")
def xml(element):
ET.indent(element, space=" ")
return HEADER + GENERATED + ET.tostring(element, encoding="unicode") + "\n"
class Artwork:
def __init__(self, master):
if master.attrib.get("viewBox") != "0 0 256 256":
raise ValueError("The master must use the 256-unit vector grid")
self.defs = master.find(f"{SVG}defs")
self.mark = master.find(f"{SVG}g[@id='mark']")
if self.defs is None or self.mark is None or not list(self.mark):
raise ValueError("The master needs defs and a nonempty mark group")
self.gradients = {g.attrib["id"]: g for g in self.defs.findall(f"{SVG}linearGradient")}
self.clips = {g.attrib["id"]: g for g in self.defs.findall(f"{SVG}clipPath")}
self.svg_defs = ET.tostring(self.defs, encoding="unicode")
self.svg_mark = ET.tostring(self.mark, encoding="unicode")
def paint(self, node, name, value):
if not value.startswith("url(#"):
node.set(ANDROID + name, color(value))
return
gradient = self.gradients[value[5:-1]]
if gradient.attrib.get("gradientUnits") != "userSpaceOnUse":
raise ValueError("Android gradients must use userSpaceOnUse")
attr = ET.SubElement(node, AAPT + "attr", {"name": "android:" + name})
out = ET.SubElement(attr, "gradient", {
ANDROID + "type": "linear",
**{ANDROID + dst: gradient.attrib[src] for src, dst in
(("x1", "startX"), ("y1", "startY"), ("x2", "endX"), ("y2", "endY"))},
})
for stop in gradient:
ET.SubElement(out, "item", {
ANDROID + "offset": stop.attrib.get("offset", "0"),
ANDROID + "color": color(stop.attrib["stop-color"]),
})
def android_node(self, source, parent, monochrome):
tag = source.tag.removeprefix(SVG)
a = source.attrib
if tag not in {"g", "path", "rect", "circle"}:
raise ValueError(f"Unsupported artwork element: {tag}")
supported = {"id", "transform", "clip-path"}
if tag != "g":
supported |= {"d", "x", "y", "width", "height", "rx", "ry", "cx", "cy", "r",
"fill", "fill-rule", "fill-opacity", "opacity", "stroke", "stroke-width",
"stroke-opacity", "stroke-linecap", "stroke-linejoin"}
if set(a) - supported:
raise ValueError(f"Unsupported {tag} attributes: {set(a) - supported}")
if "transform" in a:
match = re.fullmatch(r"translate\(\s*([-\d.]+)[ ,]+([-\d.]+)\s*\)", a["transform"])
if not match:
raise ValueError("Only explicit x/y translation is supported")
parent = ET.SubElement(parent, "group", {
ANDROID + "translateX": match[1], ANDROID + "translateY": match[2],
})
if "clip-path" in a:
clip = self.clips[a["clip-path"][5:-1]]
parent = ET.SubElement(parent, "group")
ET.SubElement(parent, "clip-path", {
ANDROID + "pathData": " ".join(shape_path(s) for s in clip),
})
if tag == "g":
for child in source:
self.android_node(child, parent, monochrome)
return
fill = a.get("fill", "#000000")
if monochrome and fill == "none":
return # Bevel highlights do not belong in the themed silhouette.
node = ET.SubElement(parent, "path", {
ANDROID + "pathData": shape_path(source),
ANDROID + "fillType": "evenOdd" if a.get("fill-rule") == "evenodd" else "nonZero",
})
self.paint(node, "fillColor", "#FFFFFF" if monochrome else fill)
if monochrome:
return
opacity = float(a.get("opacity", 1))
node.set(ANDROID + "fillAlpha", f'{opacity * float(a.get("fill-opacity", 1)):g}')
if "stroke" in a:
self.paint(node, "strokeColor", a["stroke"])
node.set(ANDROID + "strokeWidth", a.get("stroke-width", "1"))
node.set(ANDROID + "strokeAlpha", f'{opacity * float(a.get("stroke-opacity", 1)):g}')
for src, dst in (("stroke-linecap", "strokeLineCap"), ("stroke-linejoin", "strokeLineJoin")):
if src in a:
node.set(ANDROID + dst, a[src])
def vector(self, size=108, scale=.25, *, monochrome=False):
# The 256-unit canvas maps to 64dp; all painted corners stay inside
# the adaptive icon's central safe circle, including the copper rim.
root = ET.Element("vector", {
ANDROID + "width": f"{size}dp", ANDROID + "height": f"{size}dp",
ANDROID + "viewportWidth": str(size), ANDROID + "viewportHeight": str(size),
})
shift = size / 2 - 128 * scale
group = ET.SubElement(root, "group", {
ANDROID + "scaleX": str(scale), ANDROID + "scaleY": str(scale),
ANDROID + "translateX": str(shift), ANDROID + "translateY": str(shift),
})
self.android_node(self.mark, group, monochrome)
return xml(root).encode()
def ios(self):
return HEADER + GENERATED + f'''<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 256 256">
{self.svg_defs}
<rect width="256" height="256" fill="{BACKGROUND}"/>
{self.svg_mark}
</svg>
'''
def banner(self):
return HEADER + GENERATED + f'''<svg xmlns="http://www.w3.org/2000/svg" width="640" height="360" viewBox="0 0 320 180">
{self.svg_defs}
<rect width="320" height="180" fill="{BACKGROUND}"/>
<g transform="translate(8 24) scale(.5)">{self.svg_mark}</g>
<g fill="#35245D" font-family="DejaVu Sans">
<text x="140" y="82" font-size="22">Proton</text>
<text x="138" y="115" font-size="30" font-weight="bold">Stream</text>
</g>
</svg>
'''
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--check", action="store_true", help="Verify outputs without writing files")
args = parser.parse_args()
for command in ("rsvg-convert", "magick"):
if not shutil.which(command):
parser.error(f"{command} is required")
source = ROOT / "images/logo.svg"
master = ET.parse(source).getroot()
app = master.attrib["data-app"]
if app not in {"drive", "stream", "gallery"}:
parser.error("Unknown data-app in images/logo.svg")
art = Artwork(master)
desktop = source.read_bytes()
outputs = {}
if app in {"drive", "stream"}:
slug = "proton-drive-linux" if app == "drive" else "proton-stream"
outputs[f"packaging/io.narl.{slug}.svg"] = desktop
if app == "drive":
cover = ET.parse(ROOT / "images/cover.svg").getroot()
slot = cover.find(f"{SVG}g[@id='app-logo']")
if slot is None:
raise ValueError("The cover needs an app-logo group")
for child in list(slot):
slot.remove(child)
slot.append(ET.fromstring(art.svg_defs))
slot.append(ET.fromstring(art.svg_mark))
cover_svg = xml(cover)
outputs["images/cover.svg"] = cover_svg.encode()
outputs["images/cover.png"] = render(cover_svg, 1920)
if app in {"stream", "gallery"}:
res = "android/app/src/main/res/drawable/"
outputs[res + "ic_launcher_foreground.xml"] = art.vector()
outputs[res + "ic_launcher_monochrome.xml"] = art.vector(monochrome=True)
# A full-bleed neutral surface keeps the violet object legible under
# every launcher mask. The foreground retains its own copper depth.
background = ET.Element("vector", {
ANDROID + "width": "108dp", ANDROID + "height": "108dp",
ANDROID + "viewportWidth": "108", ANDROID + "viewportHeight": "108",
})
ET.SubElement(background, "path", {
ANDROID + "fillColor": color(BACKGROUND), ANDROID + "pathData": "M0 0H108V108H0Z",
})
outputs[res + "ic_launcher_background.xml"] = xml(background).encode()
if app == "gallery":
outputs["images/icon-512.png"] = render(desktop.decode(), 512)
outputs["android/app/src/main/res/drawable/ic_gallery.xml"] = art.vector(256, 1)
if app == "stream":
outputs["android/app/src/main/res/drawable/ic_notification_stream.xml"] = art.vector(24, 24/256, monochrome=True)
outputs["crates/pstr-app/assets/icon-256.png"] = render(desktop.decode(), 256)
ios = art.ios()
outputs["ios/ProtonStream/Resources/AppIcon.svg"] = ios.encode()
outputs["ios/ProtonStream/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png"] = render(ios, 1024, opaque=True)
with tempfile.TemporaryDirectory(prefix="proton-icons-") as temp:
files = []
for size in (16, 24, 32, 48, 64, 128, 256):
path = Path(temp) / f"{size}.png"
path.write_bytes(render(desktop.decode(), size))
files.append(str(path))
outputs["packaging/windows/proton-stream.ico"] = run("magick", *files, "-strip", "ICO:-")
if not shutil.which("fc-match"):
parser.error("fontconfig is required to render the Android TV banner")
if "DejaVu Sans" not in run("fc-match", "-f", "%{family}", "DejaVu Sans").decode():
parser.error("DejaVu Sans is required to render the Android TV banner")
outputs["android/app/src/main/res/drawable-nodpi/tv_banner.png"] = render(art.banner(), 640, opaque=True)
stale = []
for relative, data in outputs.items():
target = ROOT / relative
if target.exists() and target.read_bytes() == data:
continue
if args.check:
stale.append(relative)
else:
target.parent.mkdir(parents=True, exist_ok=True)
target.write_bytes(data)
print(f"wrote {relative}")
if stale:
parser.exit(1, "Branding assets need regeneration:\n" + "\n".join(stale) + "\n")
print(f"{'Verified' if args.check else 'Rendered'} {len(outputs)} assets from images/logo.svg")
if __name__ == "__main__":
main()
+2 -9
View File
@@ -1,13 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Render ios/ProtonStream/Resources/AppIcon.svg into the asset catalog's one # Compatibility entry point: all platform icons share images/logo.svg.
# 1024 px icon. iOS wants it opaque, so the alpha channel is dropped.
set -euo pipefail set -euo pipefail
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
resources="$script_dir/../ios/ProtonStream/Resources" exec python3 "$script_dir/render-branding.py" "$@"
out="$resources/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png"
command -v rsvg-convert >/dev/null || { echo "rsvg-convert is required (librsvg)" >&2; exit 1; }
command -v magick >/dev/null || { echo "magick is required (ImageMagick)" >&2; exit 1; }
rsvg-convert -w 1024 -h 1024 "$resources/AppIcon.svg" | magick - -alpha off -strip "$out"
echo "wrote $out"
+2 -17
View File
@@ -1,21 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Render the Android TV launcher banner, 320 by 180 dp, from the iOS icon: its # Compatibility entry point: all platform icons share images/logo.svg.
# canvas widened to 16:9 with the face gradient run across the whole width,
# and the play mark a little smaller, since a banner is shown as is rather
# than cut down by a mask. Twice the size, in drawable-nodpi: one file for
# every screen, which the launcher scales to its slot, sharp on a 4K one.
set -euo pipefail set -euo pipefail
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
icon="$script_dir/../ios/ProtonStream/Resources/AppIcon.svg" exec python3 "$script_dir/render-branding.py" "$@"
out="$script_dir/../android/app/src/main/res/drawable-nodpi/tv_banner.png"
command -v rsvg-convert >/dev/null || { echo "rsvg-convert is required (librsvg)" >&2; exit 1; }
command -v magick >/dev/null || { echo "magick is required (ImageMagick)" >&2; exit 1; }
mkdir -p "$(dirname "$out")"
sed -e 's/width="1024" height="1024" viewBox="0 0 108 108"/width="320" height="180" viewBox="-42 0 192 108"/' \
-e 's/<rect width="108" height="108"/<rect x="-42" width="192" height="108"/' \
-e 's/x1="0" y1="0" x2="108" y2="108"/x1="-42" y1="0" x2="150" y2="108"/' \
-e 's/scale(1.5)/scale(1.15)/' \
"$icon" | rsvg-convert -w 640 -h 360 | magick - -alpha off -strip "$out"
echo "wrote $out"