build, qt: Add SVG support, and replace bitcoin PNG image with SVG one #19780

pull hebasto wants to merge 6 commits into bitcoin:master from hebasto:200822-svg changing 19 files +259 −102
  1. hebasto commented at 4:23 PM on August 22, 2020: member

    This PR adds SVG support, and replaces bitcoin.png with bitcoin.svg. Here are the benefits:

    • no more icon scaling issues on Linux desktops (fixes #14992, an alternative to #14990)
    • ability to drop PNG support, after replacement of all icons (as possible alternative to #19751)

    Fedora 32: Screenshot from 2020-08-22 19-44-45

    Ubuntu Focal 20.04: DeepinScreenshot_select-area_20200822224245

    "About Bitcoin Core" dialog with this PR: Screenshot from 2020-08-22 22-47-19


    https://github.com/bitcoin-core/packaging/pull/27#issuecomment-519515227:

    I slighly remember that the png I made where slighly different then the SVG (optimized shadows, etc.). But not sure if this is still the case and if it matters. Just something to dbl-check.

    With Qt 5.9.8 (our gitian builds) difference in shadows is observed. No differences with newer Qt versions.

  2. MarcoFalke commented at 4:41 PM on August 22, 2020: member

    I slighly remember that the png I made where slighly different then the SVG (optimized shadows, etc.). But not sure if this is still the case and if it matters. Just something to dbl-check.

    Source: https://github.com/bitcoin-core/packaging/pull/27#issuecomment-519515227

  3. hebasto force-pushed on Aug 22, 2020
  4. DrahtBot added the label Build system on Aug 22, 2020
  5. DrahtBot added the label GUI on Aug 22, 2020
  6. DrahtBot added the label Tests on Aug 22, 2020
  7. luke-jr commented at 5:41 PM on August 22, 2020: member

    Isn't SVG rendering a lot of complexity to add? What's the benefit?

    If we want to use SVGs in the source code, we could adopt Knots's build system changes that render SVG to PNG at dist-time.

  8. build: Add Qt SVG support 3bab23f514
  9. gui: Use SVG application icons 91f9926aba
  10. qt, refactor: Unify NetworkStyle icon getters 06bc6041c8
  11. refactor: Improve NetworkStyle class style
    Added const, and renaming.
    c3611be5ce
  12. gui: Use black styled SVG logo in About window fb173585e7
  13. gui: Drop unused bitcoin.png 9728dd2f11
  14. hebasto force-pushed on Aug 22, 2020
  15. hebasto marked this as ready for review on Aug 22, 2020
  16. hebasto commented at 8:07 PM on August 22, 2020: member

    @luke-jr

    Isn't SVG rendering a lot of complexity to add?

    How does SVG rendering complexity differ from QIcon complexity with multiple pixmaps, icon engines and rescaling?

    What's the benefit?

    Unconditional visual quality.

  17. hebasto commented at 8:10 PM on August 22, 2020: member

    @jonasschnelli

    As you're a designer of bitcoin.svg, mind looking at this PR? :palm_tree:

  18. luke-jr commented at 8:11 PM on August 22, 2020: member

    How does SVG rendering complexity differ from QIcon complexity with multiple pixmaps, icon engines and rescaling?

    Choosing an image is absolutely trivial in comparison to rendering a vector image...

    Why would we ever be rescaling?

    What's the benefit?

    Unconditional visual quality.

    You get the same quality no matter what stage you render.

  19. hebasto commented at 8:45 PM on August 22, 2020: member

    Choosing an image is absolutely trivial in comparison to rendering a vector image...

    Isn't rendering a vector image hidden by qtsvg for us?

    Why would we ever be rescaling?

    In cases when a requested pixmap size does not coincide with one of stored by QIcon.

    You get the same quality no matter what stage you render.

    The difference in quality is obvious on screenshots though.

  20. DrahtBot commented at 9:17 PM on August 22, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #19761 (build: improve sed robustness by not using sed by fanquake)
    • #19716 (build: Qt 5.15.x by fanquake)
    • #19689 (build: Add Qt version checking by hebasto)
    • #19245 ([WIP DONOTMERGE] Replace boost::filesystem with std::filesystem (in c++17) by kiminuo)
    • #19077 (wallet: Add sqlite as an alternative wallet database and use it for new descriptor wallets by achow101)
    • #18298 (build: Fix Qt processing of configure script for depends with DEBUG=1 by hebasto)
    • #18267 (BIP-325: Signet [consensus] by kallewoof)
    • #18077 (net: Add NAT-PMP port forwarding support by hebasto)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  21. luke-jr commented at 9:35 PM on August 22, 2020: member

    Isn't rendering a vector image hidden by qtsvg for us?

    Yes, the concern is importing something complex like qtsvg into the overall codebase/runtime process... Any vulnerability compromises the entire program.

    I cases when a requested pixmap size does not coincide with one of stored by QIcon.

    I don't know of any cases where that should happen.

    The difference in quality is obvious on screenshots though.

    Most of the screenshots here are the DE, not Bitcoin Core...? Providing SVGs for that purpose seems fine and aside from using SVGs inside Core itself.

    If we're getting scaling artefacts inside Core, we obviously aren't rendering to the size we're using. That's fixed by adjusting what sizes we render.

  22. hebasto marked this as a draft on Aug 22, 2020
  23. practicalswift commented at 5:44 AM on August 23, 2020: contributor

    Is the GUI repo the appropriate home for a PR like this? :)

  24. hebasto commented at 8:14 AM on August 23, 2020: member

    @luke-jr

    Most of the screenshots here are the DE, not Bitcoin Core...? Providing SVGs for that purpose seems fine and aside from using SVGs inside Core itself.

    Correct. https://github.com/bitcoin-core/gui/pull/38 or #15068 should be used instead. @practicalswift

    Is the GUI repo the appropriate home for a PR like this? :)

    https://github.com/bitcoin-core/gui is for changes within src/qt only. But this PR touches build-aux/m4/bitcoin_qt.m4, depends/packages/qt.mk, and src/Makefile.qt.include.

    Closing.

  25. hebasto closed this on Aug 23, 2020

  26. NicolasDorier commented at 8:53 AM on August 26, 2020: contributor

    Given SVG files are auditable (it's only text), and we don't accept SVG from any untrusted source, I don't think this is a good concern @luke-jr

  27. MarcoFalke commented at 8:57 AM on August 26, 2020: member

    Concept ACK if this worked out of the box without the build system changes.

  28. hebasto commented at 9:00 AM on August 26, 2020: member

    Concept ACK if this worked out of the box without the build system changes.

    The build system changes are required for static builds.

  29. DrahtBot locked this on Oct 30, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me