build: macOS fix background.svg #17311

pull RandyMcMillan wants to merge 1 commits into bitcoin:master from RandyMcMillan:fix-background-svg changing 5 files +80 −41
  1. RandyMcMillan commented at 7:25 am on October 30, 2019: contributor

    FIXES: #16836

    • Valid SVG & this config doesn’t require scaling.
    • New presentation - added copyright and version info to the background image.
    • Dynamic year in the copyright notice - dynamic version number as well.
    • The result (IMO) is a good presentation that is easy to maintain and improve upon in a future version.
    • High Res background image working.

    Normal Res Screen Shot 2019-11-07 at 4 54 34 AM Hi Res

    Screen Shot 2019-11-08 at 1 53 56 PM Screen Shot 2019-11-08 at 1 54 04 PM

    The svg files are valid markup. If the linter ignores these files - maybe we can re-add svg files back to the linter?

  2. DrahtBot added the label Build system on Oct 30, 2019
  3. DrahtBot added the label Scripts and tools on Oct 30, 2019
  4. laanwj commented at 8:07 am on October 30, 2019: member
    Concept ACK. But please update the existing PR instead of creating a new one every time! (#17143, #17273)
  5. luke-jr commented at 4:49 pm on November 4, 2019: member
    Please add a copyright notice.
  6. RandyMcMillan commented at 3:38 am on November 5, 2019: contributor

    Before I push a new commit - Is there anything you think should change about the presentation?

    NOTE: The year and version number are dynamic.

    Screen Shot 2019-11-04 at 11 32 15 PM

  7. in contrib/macdeploy/background.svg:8 in 867c1d985d outdated
    0@@ -1,34 +1,26 @@
    1-<?xml version="1.0" standalone="no"?>
    2-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
    3- "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
    4-<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="1000pt" height="640pt" viewBox="0 0 1000 640" preserveAspectRatio="xMidYMid meet">
    5-	<!-- kate: space-indent off;
    6-	Copyright (c) 2015 The Bitcoin Core developers
    7-	Distributed under the MIT software license, see the accompanying
    8-	file COPYING or http://www.opensource.org/licenses/mit-license.php.
    


    luke-jr commented at 5:32 am on November 5, 2019:
    What I meant was a copyright for the SVG itself, like you see here

    RandyMcMillan commented at 6:46 am on November 5, 2019:

    ok - I will include the copyright header in the background.svg file. I am pretesting my next commit

    https://travis-ci.com/RandyMcMillan/bitcoin/builds/135097633


    RandyMcMillan commented at 7:27 am on November 5, 2019:
    0<!-- kate: space-indent off;   ... -->
    

    Is this an artifact from an old linting tool - or does this need to stay?


    luke-jr commented at 2:51 pm on November 5, 2019:

    It tells the Kate text editor to use tabs instead of spaces for indentation.

    Unless you are switching the file to use spaces, I would prefer if it stays.

  8. RandyMcMillan requested review from luke-jr on Nov 6, 2019
  9. RandyMcMillan commented at 3:13 am on November 6, 2019: contributor

    Please add a copyright notice.

    I did add the copyright notice to the background.svg file as well! https://github.com/bitcoin/bitcoin/pull/17311/commits/8a68941b70c95ef33e2f65865a96745da5721a44#diff-8552c751b30ae0c0bbb7a7994e13a986R3

  10. in Makefile.am:102 in 8a68941b70 outdated
     98@@ -99,7 +99,7 @@ $(OSX_APP)/Contents/PkgInfo:
     99 
    100 $(OSX_APP)/Contents/Resources/empty.lproj:
    101 	$(MKDIR_P) $(@D)
    102-	@touch $@ 
    


    luke-jr commented at 3:44 am on November 6, 2019:
    Please don’t touch unmodified lines.

    RandyMcMillan commented at 7:39 am on November 6, 2019:
    I will correct this in the next commit.

    RandyMcMillan commented at 6:49 pm on November 8, 2019:
    Cleaned up diff junk.
  11. in Makefile.am:132 in 8a68941b70 outdated
    128@@ -129,9 +129,9 @@ $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_BACKGROUND_IMAGE)
    129 	$(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 -volname $(OSX_VOLNAME)
    130 
    131 $(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
    132-	sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@
    133+	sed -e 's/PACKAGE_NAME/$(PACKAGE_NAME)/' -e 's/PACKAGE_VERSION/$(PACKAGE_VERSION)/' -e 's/PACKAGE_YEAR/$(PACKAGE_YEAR)/' -e 's/COPYRIGHT_YEAR/$(COPYRIGHT_YEAR)/' -e 's/COPYRIGHT_HOLDERS_FINAL/$(COPYRIGHT_HOLDERS_FINAL)/' contrib/macdeploy/$(OSX_BACKGROUND_SVG) < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@
    


    luke-jr commented at 3:46 am on November 6, 2019:
    Is sed -e or multiple arguments portable? (Alternatives are semicolons in a single argument, or multiple sed pipes)

    RandyMcMillan commented at 7:10 am on November 6, 2019:
    The semicolon syntax didn’t play well with the $(RSVG_CONVERT) piping - But I will take another look at it.

    RandyMcMillan commented at 7:17 am on November 6, 2019:
    As far as I know the -e substitution syntax is more portable than the semicolon syntax because it treats every substitution as a separate “session”. Then the final state of the file is piped to the rsvg-convert library.

    RandyMcMillan commented at 6:51 pm on November 8, 2019:
    Cleaned up this code block so it is readable - but kept the multiple -e substitutions for clarity and easier changes in the future. I looked. into it and the -e substitution syntax is widely supported.
  12. in contrib/macdeploy/background.svg:2 in 8a68941b70 outdated
    0@@ -1,34 +1,32 @@
    1-<?xml version="1.0" standalone="no"?>
    2-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
    3- "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
    4-<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="1000pt" height="640pt" viewBox="0 0 1000 640" preserveAspectRatio="xMidYMid meet">
    5+<?xml version="1.0" encoding="utf-8"?>
    6 	<!-- kate: space-indent off;
    


    luke-jr commented at 3:47 am on November 6, 2019:
    Does XML allow comments outside the root element? (I don’t know)
  13. in contrib/macdeploy/background.svg:19 in 8a68941b70 outdated
    45+</style>
    46+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="-1245.668" y1="163.2625" x2="-1245.168" y2="163.2625" gradientTransform="matrix(1000 0 0 640 1245668 -104328)">
    47+	<stop  offset="0" style="stop-color:#EFEFEF"/>
    48+	<stop  offset="0.33" style="stop-color:#EFEFEF"/>
    49+	<stop  offset="0.8" style="stop-color:#CDCDCD"/>
    50+	<stop  offset="1" style="stop-color:#CCCCCC"/>
    


    luke-jr commented at 3:48 am on November 6, 2019:
    Are these actually being changed?

    RandyMcMillan commented at 7:06 pm on November 8, 2019:
    I kept the same values but technically the gradient is different.

    RandyMcMillan commented at 7:10 pm on November 8, 2019:
    The goal is to keep this configuration simple. You may notice that in all of the transformations - I have intentionally made them whole numbers. It is easier to read and maintain but basically creates the same effect. Future maintainers may not have the same tools I used so I am trying to consider future maintainability in this commit.

    RandyMcMillan commented at 7:17 pm on November 8, 2019:
    NOTE: I thought I was done - I added the copyright notice but left out the MIT license notice.
  14. jonasschnelli commented at 3:49 am on November 6, 2019: contributor
    Why does this still use the “Tuffy” font family? Tuffy is not a cross platform font (and its under GPL).
  15. luke-jr commented at 3:54 am on November 6, 2019: member

    What’s not cross-platform about it? And no, it isn’t GPL… it’s public domain with a catchall PD-equivalent license.

    From http://tulrich.com/fonts/

    I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.

    In case this is not legally possible,

    I grant any entity the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

  16. jonasschnelli commented at 3:58 am on November 6, 2019: contributor

    @luke-jr: Oh. My bad. You’r right, it’s PD.

    Cross platform: you need to install the font in order to render the SVG correctly. There are a handful of fonts that are available on almost all platforms.

    IMO if we are going to use Tuffy, we should probably make sure its either covered/downloaded by the depends build or detected via configure.

  17. luke-jr commented at 4:15 am on November 6, 2019: member

    IIRC I chose Tuffy primarily because it looked similar to the prior bitmap image’s font.

    I don’t know any free font available on all platforms (and the non-free ones obviously aren’t available on free-only platforms).

    Tuffy is the current font. Any addition to the build system IMO should be a separate PR - no need to go through it here.

  18. jonasschnelli commented at 4:23 am on November 6, 2019: contributor

    Tested 8a68941b70c95ef33e2f65865a96745da5721a44 on macOS 10.15.

    • The generated image (background.tiff) does not contain a correct retina/HIDPI image (only 144dpi but same pixel size) (see 8a68941b70c95ef33e2f65865a96745da5721a44_background.tiff.zip)
    • The copyright line is not visible

    Uploading 8a68941b70c95ef33e2f65865a96745da5721a44_background.tiff.zip…

  19. jonasschnelli added the label macOS on Nov 6, 2019
  20. RandyMcMillan commented at 6:54 pm on November 6, 2019: contributor

    @jonasschnelli

    I think I found the issue.

  21. RandyMcMillan commented at 7:02 pm on November 6, 2019: contributor

    @luke-jr

    In a previous attempt at this fix I concluded that fonts-liberation may be a good alternative if (or when) it comes necessary. Now that I have a better understanding of the issue - we don’t need to consider a new font right now.

    Adding this link for future reference: #17143 (comment)

    NOTE: fonts-liberation is actually a superior option long term - it should be considered if a branding refresh is ever on the table because we can use it across the board for software deployment as well as web font (it offers an entire array of variations including monospace).

  22. luke-jr commented at 2:25 am on November 7, 2019: member

    Liberation is OFL, which despite popular misconception is a non-free license.

    I don’t see what’s wrong with continuing to use Tuffy…

  23. RandyMcMillan commented at 9:19 am on November 7, 2019: contributor

    @jonasschnelli, @luke-jr

    Hi-Res working. It was a bit of a work around to fix the kerning issue. Doing my pretests before pushing a new commit.

    Prelim test passed:

    https://travis-ci.org/RandyMcMillan/bitcoin/builds/608624226

  24. RandyMcMillan requested review from luke-jr on Nov 7, 2019
  25. jonasschnelli commented at 10:06 pm on November 8, 2019: contributor

    make deploy on macOS 10.15:

    Background Image

    But the copyright line is missing when building with Gitian (though why?): https://bitcoin.jonasschnelli.ch/build/1292

  26. in contrib/macdeploy/background.svg:2 in 14ff5db454 outdated
    30-	<g transform="translate(0.000000,640.000000) scale(0.100000,-0.100000)"
    31-	fill="#000000" stroke="none">
    32-		<path d="M4995 3705 c-24 -23 -25 -29 -25 -165 l0 -140 -306 0 -306 0 -29 -29 c-29 -29 -29 -31 -29 -141 0 -110 0 -112 29 -141 l29 -29 306 0 306 0 0 -140 c0 -136 1 -142 25 -165 16 -17 35 -25 57 -25 29 0 72 32 306 226 180 149 274 233 278 250 13 53 -2 70 -278 299 -235 194 -277 225 -306 225 -22 0 -41 -8 -57 -25z" fixlter="url(#glow)"/>
    33-	</g>
    34+<?xml version="1.0" encoding="utf-8"?>
    35+<!-- Copyright (c) 2013-2019 The Bitcoin Core developers -->
    


    luke-jr commented at 9:57 pm on November 9, 2019:
    This is missing the MIT license lines…

    RandyMcMillan commented at 11:19 pm on November 9, 2019:
    It is in my next commit - The editor I use keeps over writing the copy right header. Kinda obtrusive. Thanks for the feedback.
  27. RandyMcMillan requested review from luke-jr on Nov 11, 2019
  28. MarcoFalke commented at 2:00 pm on November 13, 2019: member

    I don’t know any free font available on all platforms (and the non-free ones obviously aren’t available on free-only platforms).

    Instead of hoping to pick a font that happens to be free and on all platfroms, what about picking a free font that looks best and then tracing the letters into paths, so that it works on all platforms?

    I know that this makes it harder to build Bitcoin Knots, because strings can no longer be simply replaced, but at some point we’d have to make trade-offs?

  29. MarcoFalke added the label Needs gitian build on Nov 13, 2019
  30. MarcoFalke commented at 2:10 pm on November 13, 2019: member
    Or maybe add the font only as a build dependency, not run-time dependency, and then have the build system trace it into a path.
  31. luke-jr commented at 2:12 pm on November 13, 2019: member
    That sounds like an unreasonable trade-off. We already have Tuffy as a working build dependency… We can replace it with another similarly free font, but the method itself is working fine.
  32. RandyMcMillan commented at 7:17 pm on November 13, 2019: contributor
    The font discussion was centered around the idea of using a monospaced font to work around the kerning issue. This change eliminates the need to use a monospaced font - and Tuffy should be ok. No need to add a platform specific font dependency.
  33. DrahtBot commented at 8:11 am on November 14, 2019: member

    Gitian builds

    File commit cd6cb9745e13a62e130b11f78a13bcc1d424b05e(master) commit 9e7fe2f5773a13708ec0de722efe0b43a1a489e0(master and this pull)
    bitcoin-0.19.99-aarch64-linux-gnu-debug.tar.gz b25191cf773b0bf8... a2363c59d80d4aa3...
    bitcoin-0.19.99-aarch64-linux-gnu.tar.gz 66cddf99c1e08dde... 27addf669869ef08...
    bitcoin-0.19.99-arm-linux-gnueabihf-debug.tar.gz 301fa28e49a64bbb... f9703edc81bc61f1...
    bitcoin-0.19.99-arm-linux-gnueabihf.tar.gz b52d82ea2fed7f13... ae7f2aef3c290826...
    bitcoin-0.19.99-i686-pc-linux-gnu-debug.tar.gz bd623b4dc3cf5a9a... b2fe8f3976947b82...
    bitcoin-0.19.99-i686-pc-linux-gnu.tar.gz 5de2375b033565f1... cffe8c9d64e5a3f2...
    bitcoin-0.19.99-osx-unsigned.dmg 694ef5744d2f6904... df91174c02955b9a...
    bitcoin-0.19.99-osx64.tar.gz 0114ae780385b137... 51d912d768f1b005...
    bitcoin-0.19.99-riscv64-linux-gnu-debug.tar.gz 294011ae38c5d280... d8fe5794cfa244e3...
    bitcoin-0.19.99-riscv64-linux-gnu.tar.gz dbe88f197d552d41... bf65a028c4b35b8c...
    bitcoin-0.19.99-win64-debug.zip 936007bb2ebddd0d... 7e9ca6e475a8085c...
    bitcoin-0.19.99-win64-setup-unsigned.exe b3c867b01b2d44ec... 57a649f72a7c7fbe...
    bitcoin-0.19.99-win64.zip 1b2d78df9702a910... 6cb676bb1901ee19...
    bitcoin-0.19.99-x86_64-linux-gnu-debug.tar.gz bfb1d4efbb97a704... 66ff0f451cbceccc...
    bitcoin-0.19.99-x86_64-linux-gnu.tar.gz 3511c219e80118c4... 85d421ac81ef2efb...
    bitcoin-0.19.99.tar.gz 65d3c95876c7164a... a90c389d2bf2b57f...
    bitcoin-core-linux-0.20-res.yml 5bff5ce92c230821... 654882f47b4f93a3...
    bitcoin-core-osx-0.20-res.yml 650bf46df67ba2ff... dcc2d6e08aa01482...
    bitcoin-core-win-0.20-res.yml 0a1e31be7a54ff9b... 00ccad7f94509df7...
    linux-build.log 8e7bb3e54025c401... 24f7ebf3e8ff84d4...
    osx-build.log 4e705989b74b32a9... 8768295a6adaab64...
    win-build.log 24b7cda24344151a... 4db17563c61708ea...
    bitcoin-core-linux-0.20-res.yml.diff 44253e969ebb269e...
    bitcoin-core-osx-0.20-res.yml.diff 0a7b46d84b217191...
    bitcoin-core-win-0.20-res.yml.diff 13d9ece39b905ba0...
    linux-build.log.diff f6dc2eaf1addd0ff...
    osx-build.log.diff 10dabac8e9e42fc6...
    win-build.log.diff 29f7fa6472ae9d17...
  34. DrahtBot removed the label Needs gitian build on Nov 14, 2019
  35. RandyMcMillan commented at 8:36 pm on March 25, 2020: contributor
    @luke-jr - I am not sure what else needs to be done or if this PR should be closed.
  36. MarkLTZ referenced this in commit 8d700055a6 on Apr 19, 2020
  37. build: macOS fix background.svg
    fixes a text scaling issue with rsvg_convert in darwin build
    6f06168459
  38. DrahtBot commented at 0:43 am on May 28, 2020: member

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

    Conflicts

    No conflicts as of last run.

  39. Sjors commented at 8:36 am on May 28, 2020: member
    This looks much nicer, but note that #19068 might remove the background altogether.
  40. fanquake commented at 6:24 am on August 14, 2020: member

    Thanks for having a look here, but I’m going to close this. As mentioned, ideally this is something we just wont have to worry about in the future. #16836 also only applies to local builds, which means that there is nearly no-one affected by this. The gitian built images still look fine, and as far as I can tell, are already high-res? i.e this is the appearance of the 0.20.1 release on my machine:

    high-res

  41. fanquake closed this on Aug 14, 2020

  42. DrahtBot locked this on Feb 15, 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: 2024-12-25 09:12 UTC

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