Skip to content

Conversation

@RandyMcMillan
Copy link
Contributor

@RandyMcMillan RandyMcMillan commented Oct 27, 2019

After reading the librsvg documentation I realized that the svg settings were confusing the library.
In this case it is best to set view box dimensions.

The documentation states:

If there are no width or height attributes in the toplevel - librsvg looks for the viewBox attribute. If present, this defines the aspect ratio and a "natural" size in pixels.

https://developer.gnome.org/rsvg/stable/ch02.html#id-1.2.4.2.6

LINE:4 Buy omitting the width and height attribs - we allow the librsvg to do its own interpretation in context.

LINE:26-32 By nesting the vector elements - we wrap the arrow into the text box. This keeps the arrow's coordinates relative to the text element.

LINE:29 Make the arrow grey to match the text.

Screen Shot 2019-10-27 at 9 27 20 AM

Thanks for your patience while I researched this and found a proper fix!

RM

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

Should just replace width and height attributes with viewBox?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@promag - according to documentation the scaling/aspect ratio is taken care of in the
preserveAspectRatio flag in

LINE:4

<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="1000pt" height="640pt" viewBox="0 0 1000 640" preserveAspectRatio="xMidYMid meet">

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio

Meet or slice reference
The meet or slice reference is optional and, if provided, must be one of the following keywords:
meet (the default) - Scale the graphic such that:
aspect ratio is preserved
the entire viewBox is visible within the viewport
the viewBox is scaled up as much as possible, while still meeting the other criteria

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@RandyMcMillan RandyMcMillan Oct 27, 2019

Choose a reason for hiding this comment

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

Why this change?

Here is the result with the previous scale settings

Screen Shot 2019-10-27 at 4 53 02 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@promag - now that I have a better understanding of how to configure this - it is now more of an aesthetic choice than dealing with a kerning issue. In fact I plan to rework the whole presentation in a later PR - I just want to fix the glaring issue now - then focus on a better presentation later.

@fanquake fanquake added the macOS label Oct 27, 2019
@fanquake fanquake changed the title build:proper fix for the kerning issue in macOS build fixes #16836 build: proper fix for the kerning issue in macOS build fixes #16836 Oct 28, 2019
Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

Can you avoid the indentation change?

@laanwj
Copy link
Member

laanwj commented Oct 28, 2019

I just want to fix the glaring issue now

Yes, let's do the minimal change to fix the issue. This shouldn't need to go through multiple iterations and bikeshedding PRs. 😄

@RandyMcMillan
Copy link
Contributor Author

RandyMcMillan commented Oct 28, 2019

Part of the issue with this is - the previous version of this file isn't valid svg.

Anyway here is the result of the PR rebuilt and minimized diffs.

Screen Shot 2019-10-28 at 1 06 42 PM

@laanwj @promag - I pushed a diff minimized commit.

NOTE: https://travis-ci.org/RandyMcMillan/bitcoin/jobs/604022209

My original PR was passing. That is part of the problem I am trying to fix.
https://travis-ci.org/RandyMcMillan/bitcoin/builds/603520733

@RandyMcMillan RandyMcMillan reopened this Oct 28, 2019
@laanwj
Copy link
Member

laanwj commented Oct 28, 2019

Hmm, I think the whitespace lint is over-eager here, it should probably ignore image files.

@bitcoin bitcoin locked and limited conversation to collaborators Aug 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants