Skip to content

Conversation

@DavZim
Copy link

@DavZim DavZim commented Jan 12, 2026

I am submitting

  • a new package
  • an update for a package

Description: Provides a single function #bsicon("airplane") to display Bootstrap Icons. The package ships all 2000 svg icons (all MIT licensed).

I have read and followed the submission guidelines and, in particular, I

  • selected a name that isn't the most obvious or canonical name for what the package does
  • added a typst.toml file with all required keys
  • added a README.md with documentation for my package
  • have chosen a license and added a LICENSE file or linked one in my README.md
  • tested my package locally on my system and it worked
  • excluded PDFs or README images, if any, but not the LICENSE

@typst-package-check typst-package-check bot added the new A new package submission. label Jan 12, 2026
@elegaanz elegaanz self-assigned this Jan 16, 2026
Copy link
Member

@elegaanz elegaanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a big fan of shipping all these icons. We try to limit the size of this repository to keep it relatively fast to download the whole package index and work on it locally, and more generally we prefer to limit the size of packages. If the icons are available as an icon font, it would be a better option in my opinion (in which case the user would be responsible for installing the font, you should not ship it with your package). Otherwise, I think we will have to reject this package, at least until we change the way our package index works (which is a long term goal, but not a priority).

Co-authored-by: Ana Gelez <ana+github@gelez.xyz>
@DavZim
Copy link
Author

DavZim commented Jan 16, 2026

Thank you very much for the feedback!
I completely understand the concern about package size and repository performance - I really like Typst choices regarding lightweight and speed and I appreciate that this is a guiding principle for the package index.

Unfortunately, the bootstrap icons are only available as svgs and not as a font itself.
The current setup makes it highly portable but has the disadvantage of size. I thought about compressing it and the decompressing the values at runtime, but I didnt see typst capabilities for this.

The motivation behind the package was practical: I repeatedly found myself manually copying Bootstrap SVGs between projects because the set of icons in #sym often wasn’t sufficient for UI‑like documents, diagrams, or presentations. At some point this became frustrating enough that a proper, reusable solution seemed worthwhile — both for myself, my colleagues, and other Typst users who need a broader icon collection without constant manual asset handling.

With your constraints in mind, do you see an alternative path for making a richer icon set broadly available to users?

@DavZim
Copy link
Author

DavZim commented Jan 18, 2026

Hi @elegaanz,

thank you again for the comments and motivation to keep things small and efficient. I had a thought about how we can make this package work while keeping its functionality.

Here is what I came up with (see also updated files):

  1. The raw icons (see raw-icons/ directory, containing the 2058 svg files are omitted from this PR (and thus the typst/packages repository), dramatically reducing the file count of this PR/package.
  2. Instead the svg content is included in one "big" bs-icons.typ file, with 2058 +2 lines of code, one for each icon, sitting at less than 1 MB. Comparing the first draft, we had 4.6M of data, now we are down to 983K bytes.
  3. To decrease filesize of the bs-icons.typ file, we only store the svg contents and not the meta <svg> tag and its information as they are filled at (PDF-) compile time by typst in #bsicon(). See updated bsicon function for details, this means only the minimum information is stored.

This way we reduced the filecount from 2k+ down to 8 (including toml, Readme, License, etc) and total filesize from 4+M down to 1M bytes (all values reported by du -sh).
What do you think, is this small enough to be considered as a package for typst? Or do you see any further potential for optimization?

Thanks,
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new A new package submission.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants