Skip to content
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

support minify #11

Merged
merged 1 commit into from
Oct 23, 2024
Merged

support minify #11

merged 1 commit into from
Oct 23, 2024

Conversation

ahaoboy
Copy link
Owner

@ahaoboy ahaoboy commented Oct 23, 2024

close: #10

-rw-r--r-- 1 ace None  77K Oct 23 17:04 win11.svg
-rw-r--r-- 1 ace None  35K Oct 23 17:04 nu-ls.svg
-rw-r--r-- 1 ace None  89K Oct 23 17:04 vitest.svg
-rw-r--r-- 1 ace None 8.5K Oct 23 17:13 win11.svg
-rw-r--r-- 1 ace None  15K Oct 23 17:13 nu-ls.svg
-rw-r--r-- 1 ace None  24K Oct 23 17:13 vitest.svg

image

 cr --features=cli --  -f=svg --font=https://fonts.cdnfonts.com/s/98875/JetBrainsMonoRegular.woff >  a.svg

image

@ahaoboy
Copy link
Owner Author

ahaoboy commented Oct 23, 2024

FiraCodeNerdFontMono-Regular.ttf

image

@ahaoboy ahaoboy merged commit 73348d9 into main Oct 23, 2024
14 checks passed
@ahaoboy ahaoboy deleted the min branch October 23, 2024 15:16
@fdncred
Copy link

fdncred commented Oct 23, 2024

Wow, this makes a huge difference. One small file went from 91.6kb to 38.3kb, then with -c went to 17.4kb. Nice work!

@ahaoboy
Copy link
Owner Author

ahaoboy commented Oct 24, 2024

Wow, this makes a huge difference. One small file went from 91.6kb to 38.3kb, then with -c went to 17.4kb. Nice work!

However, due to SVG font rendering issues, you may need to use the mono font, otherwise it will cause alignment issues. This problem has not been found on HTML yet.

@ahaoboy
Copy link
Owner Author

ahaoboy commented Oct 24, 2024

Wow, this makes a huge difference. One small file went from 91.6kb to 38.3kb, then with -c went to 17.4kb. Nice work!

If you are very concerned about the size, it is recommended to use html, which is much smaller than svg and will not have text rendering problems.

@fdncred
Copy link

fdncred commented Oct 24, 2024

What we're really trying to do is create a preview of all nushell themes and store them in a markdown file. I know md has limited html support, but I'll have to see what that is exactly. Our current idea is to put a svg in the markdown. I'm not sure how we'll get there from here because themes by their nature change all/most of the colors.

It looks like some of the optimizations could make html even smaller. There are a lot of css colors in that file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optimization of svg
2 participants