Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

Draw landscapes instead of DiceBear's Shapes style

2a8c7fbf4b2670a386ab2c203db20bb90489263a · Keenan Nemetz · 8d ago · parent 97f77001

Draw landscapes instead of DiceBear's Shapes style

DiceBear ships no landscape style, so the bundle now carries one written
against its core API. The engine that matters is still DiceBear's — the
seeded PRNG, the option handling, the 100×100 box and the circular mask
— while the style is part of Vole and carries this project's licence.
That drops the Shapes licence file and leaves DiceBear's own MIT notice.

The art is one idea: the account's tone is the sky, two or three hills
are the same colour a step darker, and the sun is drawn from Everforest's
cream, yellow or sunset orange. Each hill is a circle whose centre sits
below the box, so only its ridge shows; drawing them back to front with
one step of shade between them is what gives the depth at 17px without
an outline. The sun is placed above the highest ridge, so it is never
lost behind a hill, and a low ridge can swallow its foot like a sunset.

The bundle is now 10KB (4KB gzipped) and an avatar is about 470 bytes
of SVG, down from 18KB and 800 because Shapes was the bigger style. The
server's half is unchanged: the initial on the account's ground is drawn
first and stays if the script never runs.

server/web/avatar_test.go +2−9

@@ -121,10 +121,10 @@ func TestAvatarAssetsAreEmbedded(t *testing.T) {
121 121 if err != nil {
122 122 t.Fatalf("the avatar bundle is not embedded: %v", err)
123 123 }
124 if len(bundle) < 10_000 {
124 if len(bundle) < 4_000 {
125 125 t.Fatalf("the avatar bundle is %d bytes, which cannot be DiceBear", len(bundle))
126 126 }
127 for _, want := range []string{"VoleAvatars", "DiceBear"} {
127 for _, want := range []string{"VoleAvatars", "DiceBear", "Landscape"} {
128 128 if !strings.Contains(string(bundle), want) {
129 129 t.Fatalf("the avatar bundle does not mention %q", want)
130 130 }
@@ -137,11 +137,4 @@ func TestAvatarAssetsAreEmbedded(t *testing.T) {
137 137 if !strings.Contains(string(core), "MIT License") {
138 138 t.Fatalf("dicebear.LICENSE does not read as MIT:\n%s", core)
139 139 }
140 style, err := staticFS.ReadFile("static/dicebear-shapes.LICENSE")
141 if err != nil {
142 t.Fatalf("the Shapes licence is not embedded: %v", err)
143 }
144 if !strings.Contains(string(style), "CC0 1.0") {
145 t.Fatalf("dicebear-shapes.LICENSE does not name CC0:\n%s", style)
146 }
147 140 }