-
Notifications
You must be signed in to change notification settings - Fork 2
redo svg filters, match font stack #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
hm, i was testing changes on chrome when starting out but assumed the later changes would be fine. it's all out of order now after all the rebasing. i should still be able to make chrome match firefox with some small tweaks. |
fits in better with snap block changes in later commits
fits in better with snap block changes in later commits
shadow edges aren't clipped twice. i don't think the old filter would blur in firefox but the general method used usually would. this new method uses patterns that shouldn't have that happen. this fits in better with snap block changes in later commits.
…scale previously filter bounds and particular effects (mostly feFlood) would cause some problems with element dimensions in firefox and make that element blurry and incorrectly positioned. many filters also had coordinates rounded differently between the browsers. this new svg filter act the same between browsers and is nicer and simpler in several ways
similar to the previous commit, the block bevel caused blur and misalignment in firefox. this new filter is also more accurate in general due to other tweaks. it looks slightly different between browsers but it's close enough.
they contain serious bugs, make inefficient output, usually cause blur on firefox, and aren't much more ergonomic than writing out the filter manually.
|
i adjusted the bevel edges to add a slight bit more blur for when zoomed in (i don't think i can get away with more without messing up normal sizes) and reordered the commits from least to most invasive changes. you should be able to pull up to the blurry text fix for now if the bevel edges are still an issue. i think the text change is the most important fix out of the set. |
|
i only made a very subtle change to the block's lighting. there's really not a lot of room for adjustment. maybe a convolution matrix could shift the text over by a physical pixel more reliably? it would probably be much simpler to just generate more svg nodes. give the text an id and <use> it for the shadow. i don't think more work on the svg filters is worth it. if/when you go down the route of making thousands of similar paths i'd recommend you just put each block once in <defs> and then reuse them as border images. i haven't checked if svg widely supports border images but if not you can simulate it manually with many <use>s and transforms. i've been using border images to render blocks with dead simple html for my own wip project. |














this fixes blur in firefox (especially on text), gives the regular snap style much more accurate block borders and text shadow, and removes quite a bit of bad code.
there's several unrelated changes in these commits so feel free to cherry pick if one of the commits is real bad
before:



snap:
after: