Skip to content
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

Export SvgFont without converting lines to stroke outlines #146

Open
pixtur opened this issue Jan 3, 2023 · 5 comments
Open

Export SvgFont without converting lines to stroke outlines #146

pixtur opened this issue Jan 3, 2023 · 5 comments

Comments

@pixtur
Copy link

pixtur commented Jan 3, 2023

I think it could be very useful for BirdFont to export SVG without converting them to outline strokes.

In fact that use-case was one of the reasons I started to learn the software. I personally would use this to create line typography effects in Tooll3. But there are many other use cases like Single line fonts for using pen plotters. SvgFont is the goto format of this niche because it provides a defined format for glyph definitions with kerning information.

I already implemented the SvgFont parser using the Svg nuget packet. But I noticed that this is of not much use because of the outlined strokes. The work around would be to parse the buildfont.xml and convert the curve definitions manually. But this would but several days of work.

@johanmattssonm
Copy link
Owner

I am not sure if I understand. Have you seen the CNC export settings?

@pixtur
Copy link
Author

pixtur commented Jan 7, 2023

I have a font that is designed by single strokes:

image

When loading the svg font it looks like this:
image

However, I would like to keep the single line strokes in the SVG:
image

As comparison:

BirdFont:

<glyph unicode="A" horiz-adv-x="50" d="M8.16098 23.68591 C9.50063 23.68591 10.84027 23.68591 12.17992 23.68591 C13.25581 23.68591 14.3317 23.68591 15.40759 23.68591 C18.63527 23.68591 21.86294 23.68591 25.09062 23.68591 C29.79775 23.68591 34.50488 23.68591 39.21201 23.68591 L39.21201 16.30591 C37.73255 16.30591 36.2531 16.30591 34.77364 16.30591 C31.54597 16.30591 28.31829 16.30591 25.09062 16.30591 C21.86294 16.30591 18.63527 16.30591 15.40759 16.30591 C12.99205 16.30591 10.57652 16.30591 8.16098 16.30591 L8.16098 23.68591 zM22.32865 59.30351 C20.85518 53.3933 21.83612 57.1053 19.44806 48.15059 C17.14473 39.6553 14.6832 31.20541 12.40016 22.70468 C10.48687 15.20798 8.43766 7.74108 7.99317 -0.00965 C5.3265 -0.00963 2.65984 -0.00961 -0.00683 -0.00959 C0.05246 1.09155 0.07773 2.19504 0.17105 3.29382 C1.06147 10.56226 2.75424 17.61517 4.64801 24.68058 C7.03137 33.19575 9.44857 41.70003 11.7268 50.24395 C13.62271 57.48089 15.47158 64.72645 17.22354 72 C18.27386 72 19.32418 72 20.3745 72 C20.93581 72 21.49712 72 22.05842 72 C22.50535 72 22.95229 72 23.39922 72 C24.78573 72 26.17225 72 27.55877 72 C27.79678 70.96536 28.03479 69.93072 28.27281 68.89608 C31.01654 57.34403 33.90641 45.84564 36.97327 34.37527 C39.01405 26.78063 41.05395 19.23374 42.59816 11.52333 C43.28516 7.65082 43.8375 3.91442 44.01976 -0.00991 C41.35309 -0.00993 38.68643 -0.00995 36.01976 -0.00997 C35.98873 0.68486 35.9749 1.38067 35.92667 2.07451 C35.66284 4.69554 35.29177 7.26266 34.77546 9.84841 C33.1588 17.41031 31.2395 24.8478 29.24209 32.31884 C27.05945 40.52492 24.88248 48.72694 22.88071 56.97897 C22.69297 57.75292 22.51267 58.52866 22.32865 59.30351 z" />

Figma:

 <glyph horiz-adv-x="25" vert-origin-x="675" unicode="a" glyph-name="a" d="M677 23H687C690.314 23 693 25.6863 693 29V33M693 33V47H683C679.686 47 677 44.3137 677 41V39C677 35.6863 679.686 33 683 33H693" />

@johanmattssonm
Copy link
Owner

I think I need to add a button somewhere that makes this easier to find but here is how you create single stroke fonts.
Screen Recording 2023-01-08 at 00.48.13.webm

@pixtur
Copy link
Author

pixtur commented Jan 8, 2023

Oh wow. I would have never found this, because:

  • I only tried changing the stroke mode with "Move Control Points" instead of "Select and Move Parts"
  • I didn't expect CNC to be related to my problem (but I know see, why it is).
  • I wouldn't have understood, how "keeping paths open" is related to outlining strokes.

Some drawbacks of the current solution are:

  • It's pretty cumbersome to change the mode for all glyphs.
  • It's sad that you can no longer have a preview stroke width of designing the typeface in CEC-mode:
    image

I personally would prefer if there would be a 3rd SVG checkbox like"[ ] Outline open strokes" that is enabled by default.

@johanmattssonm
Copy link
Owner

Good idea. I think this should be in some kind of stroke settings dialog rather than the CNC settings tab and stroke width should be there as well.

You can change change the CNC stroke width in the settings tab:
Screenshot from 2023-01-08 01-44-12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants