-
Notifications
You must be signed in to change notification settings - Fork 18
Reduce gaps between blocks in RedactRect #120
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
|
I was wondering what was causing that. |
|
@leo60228 any chance you could add a screenshot with "scp-[4 redacts]" to check it still feels like the right width? |
|
I added an emoji form, which should appear identically including respecting font color but go through a codepath less likely to have issues with this case (it's non-deterministic, but I haven't been able to reproduce the issue after this change). I've tested this in Firefox/Chromium/WebKit on Linux, but would appreciate testing on other platforms, since several aspects of font rendering is OS-specific. For reference, the SVG used is: <svg xmlns="http://www.w3.org/2000/svg">
<rect fill="currentColor" style="fill: context-fill;" x="-20" y="-2371" width="1800" height="2880"/>
</svg>(Firefox doesn't implement |
|
Windows 10, Firefox 144, 125% OS scaling: Current RedactRect has lots of lines (every 1-3 characters), new RedactRect has much fewer lines (every 24ish characters). Windows 10, Firefox 144, 100% OS scaling: Current RR has a line every 1-2 characters. New RR has a line about every 4 characters. Android, Firefox: No lines visible in either current or new RR (There are some lines visible in the screenshot but it's waaayyy bigger than my phone is, and they're not visible on screen at all. Except the ones in the non-RR bit) MacOS, Firefox 144: No lines visible in either current or new RR. Screenshot is of the built in retina screen. Same result on a standard 1440p screen at 100% and 125% scaling. MacOS, Safari: Exactly the same result as Firefox so I'm not going to bother screenshotting it, except that the pre-RR sample had tons of lines (every 2 characters). I could also test on Linux but I figure you already covered that. Overall review: new RR improves over current RR and does not introduce any regressions |






On some platforms, there are thin gaps between block characters, presumably due to rounding error. This adds slight negative kerning between blocks to heavily reduce it. It's not eliminated entirely (possibly due to glyph caching quirks?), annoyingly.
Before:


After:
This approach makes long strings of blocks slightly narrower. The width of individual blocks could be increased to compensate, but I wasn't sure this was really necessary.