-
Notifications
You must be signed in to change notification settings - Fork 2k
Please make the diagrams with open source tools #1158
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
Comments
We know this. If you happen to know somebody who has this application and can export the pictures to SVG for instance, please proceed. |
Searched and found some free alternatives (gratis, unfortunately not open source) which can open Sketch files and export SVGs: I can at least confirm they each imported and rendered, but I didn't do much beyond that. Only issue I saw was that it tries to use the Menlo-Regular and Menlo-Bold fonts, which seem to be Mac-only. |
I tried Figma and Lunacy. They does not fully support Sketch file. For example: After using Lunacy, I realized the reason why using Sketch file is there are some components are common in use, I mean the Symbols feature . That could be a huge reason. And all figures using it will be able to benefit from it. So, I am not sure it is good to use SVG?
True. And I replace the font with Bitstream Vera Sans Mono. (cf. #605 (comment)) |
Note: Lunacy 3.14 |
Why are we not crafting SVGs?
…On Wed, Mar 13, 2019, 06:18 Yue Lin Ho ***@***.***> wrote:
Note: Lunacy 3.14
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1158 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHTnkfHwzruFsEwHwtOVB74p6lx3nTfkks5vWIo9gaJpZM4Z7q3w>
.
|
Factorization of common attributes is perfectly doable in SVG. But, there are great chances that the extracted SVGs would be "flattened" (i.e. every element embeds all its attributes) and we would loose the ability to change the styling. @YueLinHo could you provide the output svg so that we can check its structure? |
Nice! ^__^
OK. Will try it later. :-) |
@YueLinHo If you're looking for a free font that is similar to the one in the Sketchbook file and whose license also allows free commercial use, you'll find some alternatives e.g.: https://www.fontspace.com/vincenzo-vuono/gravity or https://www.fontspace.com/kineticplasma-fonts/falling-sky. @jnavila The initiator of the issue has suggested to use open source software to create the images. From my point of view Inkscape (https://inkscape.org/) would be suitable for this task, it is available for OSX, Windows and Linux. It is also vector-based and you can create your own symbol library, so that a unified design of the images is possible. A small "HowTo" should be enough to explain the workflow to the various authors. |
@max123kl the files included in both media are png (the way they were extracted from Sketch), and they were heavily compressed. Inkscape manipulates SVG files, so this would be great. The problem is that up to now, the exports from Sketch were very lousy. Please go ahead with some sample, and if it can be integrated, you could even better provide a full conversion of the images. 👍 |
It does not make sense to reconstruct existing images by duplicating the work. In addition, the check for content errors must be carried out again afterwards. I suggest that we first analyze where the error hides in the workflow and then focus on eliminating it. In Sketch's online manual, the section "File Formats" (https://www.sketch.com/docs/exporting/file-formats/) explains that data export to PNG, but also to SVG and EPS is possible. It would be very helpful if you could save two images ("local" and "branch-and-history") and the symbol part in SVG and EPS formats respectively. I especially hope for a lot from the EPS format, as it is universally used in professional image processing. Regardless of what I said before, I immediately noticed when looking at the progit.sketch file that the constructed diagrams on the individual pages are no longer in vector format, but in bitmap format. Images in vector format can be enlarged losslessly, the quality of the bitmap format decreases, which is particularly noticeable in typefaces. Another question about the symbols and the symbol library in the Sketch file: |
@jnavila You see two columns, on the left side I have stayed as close as possible to the original. In the right column I made some small changes. So I lightened or darkened the text a bit to increase the contrast, which improves the readability. In the first row I placed two small color fields behind the graphics in the middle to simulate the background color on the website and the Sketch program. |
OK, I've finally been able to load up the source file in the Sketch editor – I had tried a while ago, and it kept crashing on me. Here's what I understand as the desired outcome:
Does that sound correct? |
The first part of this will be accomplished in #1285. |
I'm interested in the SVG export. If it's flattened, then it's not really useful for future changes, but if they export a structured file (with styles and reused groups) it could be used as our primary source for images. |
#1285 now covers the first two. |
Sadly it doesn't seem to include links back to anything like Sketch "symbols". It looks like we'll have to start from zero if we want that, and I'm not sure what tool would be best for it. Maybe we could use a trial to import into Gravit? |
The rendering is good. There's no style, but the resulting size is still lower. Even in this state, it should bring better images. |
@ben
Inkscape can define symbols and combine and save them in a library. Since I mainly use the Adobe Design programs in my job, I can't make a more precise statement now. @jnavila
I don't really understand your workflow yet. Which functions/options are essential for a smooth workflow? |
I can't understand the reason why it has to be a monospaced font in the diagrams. A proportional font is much easier to read —> Roboto (not Mono) |
When you work with files, you usually define custom styles (colors, width, color gradients, fonts...) for shapes and texts that you can refer to in all your designs. This allows to enforce a single look&feel. These styles are usually saved in you design file in native format, but when you export to another format, the styles are most of the time "applied" to each shape. Then if you wish to modify the style, on the exported files, you have to modify each part individually, because they no longer refer to a unique shared style definition. Additionally, adding new elements requires to copy/paste the style from another part instead of applying the common style. Here, from what I see, in the SVG, The shapes no longer refer to a single style (see it as a pyramid with all shapes pointing at the style above them). Here each shape has it's own definitions. That's what I call "flattened", because there's no longer any entity above them. |
@jnavila |
Over in #1285 I've done the SVG export from Sketch. Is this what you'd consider a "good" SVG? If so, I'll merge that PR and we can go from there, but we don't need to necessarily accomplish all of these goals in a single PR.
Most of the text in the diagrams is things like SHA-1 hashes, ref names, and the content of blobs, so a monospace font makes sense there. I'd be open to switching the descriptive labels to a proportional font in the future, but the goal right now is to remove the dependencies on Menlo and Sketch. |
@ben |
OK, if these SVGs seem like a good starting point, I'm going to merge that PR. Then we'll be free to experiment with fixing things wholesale before we start using SVGs for the diagrams in ebook builds. |
OK, fine I found a nice, illustrated tutorial here. Unfortunately only in German, but not much text and very simply written, so that an automatic translator should have no problem with it. It also describes how a symbol library can be created, edited and passed on to others. BTW: |
I just looked at the first file. Do you really want to use an outline of 1px with a font of only 9pt? This almost damages the font more than the old setting. Much more important is to change the color of the filling from black (000000ff) to gray (979797ff), the outline color. Then the ugly black spots disappear in the font. The best unit of measurement for fonts is Point (pt). You can see how to do this in the screenshot. Note the active, lighter tabs. Change the font weight from Regular to Bold. Then, I recommend a maximum outline of 0.3 pt for a font size like this of 9 pt (note the lowercase "a"). Edit: |
That was just a raw export from Sketch. I’m happy to review a PR that
removes the `stroke` from all the text elements in the SVGs.
On Mon, Aug 5, 2019 at 3:57 PM Dieter Ziller ***@***.***> wrote:
I just looked at the first file. Do you really want to use an outline of
1px with a font of only 9pt? This almost damages the font more than the old
setting.
Much more important is to change the color of the filling from black
(000000ff) to gray (979797ff), the outline color. Then the ugly black spots
disappear in the font. The best unit of measurement for fonts is Point
(pt). You can see how to do this in the screenshot
<https://github.com/max123kl/progit2-de/blob/Figures/diagram-source/tests/Font_weight.svg>.
Note the active, lighter tabs.
I recommend a maximum outline of 0.5 pt for a font size like this of 9 pt
(note the lowercase "a").
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1158?email_source=notifications&email_token=AAAJXXWX3MT5465MACBQGFDQDCV4LA5CNFSM4GPOVXYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3TKH3A#issuecomment-518431724>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAJXXUS6V4YV7GSEUCPEZDQDCV4LANCNFSM4GPOVXYA>
.
--
– Ben
|
Can you tell me files that contain this "stroke"? I can't find any. I would like to bring in my thoughts about the choice of fonts and their modifications. The principle Form Follows Function was originally developed in architecture and industrial design. Today, however, it should also be applied in communication science. In simple words: According to Marshall McLuhan, in communication everyone is both sender and receiver of information. In order to transfer my thoughts to this project, it would mean choosing fonts and techniques that are helpful for the intended goal. I understand that the numerous fonts make it difficult for anyone who is confronted with them to make a good decision. I would like to take back my previous statement (see quote).
For reasons of readability and aesthetics, fonts smaller than 36 pt should not be used with any outline larger than 0 pt. Because there are so many fonts, it is possible to find a more suitable alternative that meets your personal needs. I have modified the file advance-master.svg again and placed it in the /diagram-source/tests folder so that it can be compared with the latest version. I have included some different fonts that I think are suitable to be used here. I made sure that the license says: I would prefer an OTF font, because it offers better features, as I wrote before. I made my selection from the this search query |
Sure, here's one of the text nodes from the SVG file I linked to above: <text id="master" stroke="#979797" stroke-width="1" font-family="RobotoMono-Regular, Roboto Mono" font-size="12" font-weight="normal" fill="#000000">
<tspan x="24.9970703" y="21">34ac2</tspan>
</text> Note the <text
id="master"
font-size="12"
font-weight="normal"
style="font-weight:normal;font-size:12px;font-family:RobotoMono-Regular, 'Roboto Mono';fill:#000000;stroke:#979797;stroke-width:0.4;stroke-miterlimit:4;stroke-dasharray:none">
<tspan
style="stroke-width:0.4;stroke-miterlimit:4;stroke-dasharray:none;-inkscape-font-specification:'Roboto Mono, Bold';font-family:'Roboto Mono';font-weight:bold;font-style:normal;font-stretch:normal;font-variant:normal;font-size:12px;text-anchor:start;text-align:start;writing-mode:lr;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;fill:#979797;fill-opacity:1"
x="24.994141"
y="21"
id="tspan11">f30ab</tspan>
</text> Here the outline is coming from the |
Oh, and regarding the choice of font for the diagrams: if Roboto Mono is not acceptable, I'm completely happy with Source Code Pro. |
If needed, a good sed filtering could tidy the "stroke" properties if needed. |
OK, I see, you were talking about the inside code, and I was just looking at the visible image. I'm not very familiar with analyzing XML code. What I know is that different design programs can generate very different code for the same type of artwork. For example, Inkscape can create 3 different uncompressed and 2 compressed SVG files (see the "save as" dialog in the pull down menu). As far as I can see, the 'stroke' attribute is responsible for the outline of an object. For vector based drawings everything is defined by outlines and fills. I imagine it will be extremely difficult to remove or change some strokes through a filter. |
Your export is quite interesting, because we can see that the letters are in fact mostly made up of the stroke part ; if I zoom on The fill part is black and is only appearing at the internal limit of all strokes. If in Inkscape, I remove the stroke, here's what's left: Whereas when the fill matches the stroke: @max123kl , contrary to your belief, mechanizing the filtering of XML-SVG is really not a big deal ( the experiments above are easily doable by script). The relevant question is what kind of transformation we want to apply. |
@jnavila My
It is very important that Ben has agreed to switch from "Roboto Mono" to "Source Code Pro". So I uploaded the file
The different formatting could be due to the fact that the "Source Code Pro" font is in OTF format and its extended options.
|
@max123kl Sorry, I hadn't followed your previous conversation about the fonts issue. The later example is only with fill at So, to be clear, I should take the exports that @ben did and apply the styling you just advised, right? If so, I'll do it tonight at home and will push on a dedicated branch for inspection. |
It's worth a try. For this I need the previous Sketch symbols as SVG file(s) so that I don't have to rebuild everything. Edit:
|
I exported the symbols page from Sketch in #1287. It's probable they have the same problems as the other exports. |
I downloaded the symbols.svg file. It is fully editable. I was looking for English tutorials that I could use for the promised Mini HowTo and spotted a small tool to optimize the SVG code. Personally, I'm not that experienced in coding, but maybe it's useful to you. |
I just pushed the filtered SVGs to the branch filtered_svg. It's not so bad, have a look, please.
|
It's a good starting point. Want to spin up a PR so we can move this discussion over there? |
Sure: #1288 |
Can this issue be close? |
The source file for the diagrams requires a commercial/non-free application that is only available on OSX.
The text was updated successfully, but these errors were encountered: