-
Notifications
You must be signed in to change notification settings - Fork 138
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
Disable Elliptical Arcs ? #8
Comments
Are you using the 'maker' project for the ellipse arc, looks very impressive. I can implement ellipse arc I had one in justTriangles or ellipse atleast, and I have arc already, but I was worried it would mess up a fill engines but perhaps I should give it a go tomorrow, likely changing this in your project is not easy and not worth it. Will close. PS If you need any remote developers on Maker would love to try to help out looking for work even if only on demos but I might be inclined to port it to Haxe :). |
I do believe that using straight opentype.js will be the best in your scenario. You will not have to deal with arcs (elliptical or circular 😉) This google-font-to-svg-path repo is primarily just here for the web page UI. |
danmarshall I noticed that svg allows you to reduce script sizes by removing letters that repeat if your aim is to reduce file sizes you could implement that, I added recursion to my number storing class, so it was not so hard to implement parsing missing letters in my justPath package. Ellipse Arc is really nasty overhead to implement, I ported one but needs tweaking some more before it works properly. But it seems like it's heavy and complex to process. So on consideration - my initial request was reasonable, I do think it would be worth providing an option for developers that don't want that overhead and complexity of processing Arcs, it's a kind of messy aspect of SVG I think FXG probably have separate Ellipse for this reason? I did render the font from your 'web page UI' , my code just skipped over the Ellipse commands ( not the 7 segment but the text below and above ). I should look to contribute to Maker.js, would look good on my CV as it would prove I could do Typescript, and interesting as visual related code, but reluctant to use Typescript, I have to be honest I looked a few times at Typescript and it's not as nice as Haxe. :( But maybe will take a look it's better using ts than js atleast. |
Hi @nanjizal - to reduce SVG Path data size, I would go with the awesome https://github.com/svg/svgo library. There is also a GUI versionof svgo: https://jakearchibald.github.io/svgomg/ Also, to remove arcs, you can call the unarc function of the https://github.com/fontello/svgpath library. These are both great libraries, so I didn't want to duplicate their work :) |
In the end came up with ellipse implementation that works, some converted from perl, but a lot is my original code. Visual tests show correct rendering: |
Hey Dan, above you state
Does the screenshot below illustrate what you're talking about? We are looking to convert all text to outline prior to approving artwork and sending it off for print production. Having the image print as shown below would be unacceptable, i.e. the orange inner section of the "a" needs to be black like the rest of the path. Thanks! |
Hi @dboggs85 , the union works between one character and another. In your screenshot it seems that the character outline intersects with itself. So this would not be handled. My opinion is that this is a bug within the font itself, but that probably won’t get fixed. I don’t have any code for this “self union” . Perhaps you can try to call combineUnion passing this same object for each model parameter? Let me know if that works, I’d be surprised. |
Thanks @danmarshall. Fixing this is a little ways down our queue right now but I'll post more when we get to it. |
@dboggs85 can you contact the font author? |
Thanks @danmarshall. Our solution needs to programmatically solve this issue across all fonts. I believe (haven't confirmed) this will be a widespread problem within the context of our application so contacting every author whose font exhibits this overlap is not scalable. I wonder if the issue has to do with ellipical arcs or perhaps quadratic Bézier curves vs cubic Bézier curves. I did note that the path makeup ("Q"s and "A"s) of the small "a" outline is different from the path makeup (all "C"s) of the large "a" outline. See below. I converted both text characters using Google font to svg path with the only input difference being font size and weight. Any reason why one would be converted to all cubic Bézier curves and the other converted to elliptical arcs and quadratic Bézier curves?
|
@dboggs85 - can you share the font and the parameters you used to create a test case? |
@danmarshall, sure thing. I selected Comfortaa as the font along with the size and weight stated in the file name, typed in "coalesce" and converted, then "artstream™" and converted. Attached, resulting svg files. coalesce_comfortaa_300fs_700wt_ToHalfPixel_TextFile.txt |
@danmarshall, I must have done something in Inkscape that ultimately changed the large "a" outline from the "coalesce" file above, i.e., changed the path data to somehow make all the nodes cubic Bézier curves. I'm trying to recreate my steps but so far I have no clue what I did. Don't want to waste your time so please don't feel like you need to respond unless you think there may be something to my assumption that cubic Bézier curves seem to work while quadratic Bézier curves and/or elliptical arcs don't. Meanwhile, I'll post again if I discover how I inadvertently converted the nodes. |
I've got it backwards above @danmarshall. Think it's the cubic Bézier curves that are causing the problem. The first path data below with the original exported node types from your website and the second path data for the "a" outline where I somehow changed node types to cubic Bézier curves.
|
I am able to delete nodes and connect them in the right spot to get rid of the overlay in the cubic Bézier curve path above which makes it display properly. Still have no idea how I changed the original path data to cubic Bézier curves to begin with however.
|
The inner path direction was the culprit. Selecting "Break Apart" from the Path menu, then highlighting the inner path and selecting "Reverse" from the Path menu, then highlighting the two paths and selecting "Combine" from the Path menu, did the trick. |
Dan, hi is it possible to add an option to NOT optimise for elilptical Arcs. could not seem to see the relevant code, or point me towards how you do that! Probably simplest for me to try the original opentype.js ! :) Cheers, and thanks for getting back to me on the other repo so quick.
The text was updated successfully, but these errors were encountered: