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

clipPath svg not supported #1276

Open
marijnkampf opened this issue Mar 7, 2014 · 14 comments
Open

clipPath svg not supported #1276

marijnkampf opened this issue Mar 7, 2014 · 14 comments
Assignees
Milestone

Comments

@marijnkampf
Copy link

It seems that the SVG import doesn't support clipPath's, is this a bug or simply not implemented yet?

The sample below is taken from https://developer.mozilla.org/en-US/docs/Web/SVG/Element/clipPath.
When importing the svg for a glyph it should be imported as two circles, but the clipPath is ignored and the rect is imported.

<?xml version="1.0"?>
<svg width="120" height="120" 
     viewPort="0 0 120 120" version="1.1"
     xmlns="http://www.w3.org/2000/svg">

    <defs>
        <clipPath id="myClip">
            <circle cx="30" cy="30" r="20"/>
            <circle cx="70" cy="70" r="20"/>
        </clipPath>
    </defs>

    <rect x="10" y="10" width="100" height="100"
          clip-path="url(#myClip)"/>

</svg>
@davelab6
Copy link
Member

@jtanx @tshinnic any thoughts on how hard this will be to implement? :)

@jtanx
Copy link
Contributor

jtanx commented Jun 30, 2014

Not sure - I'd have to learn SVG spec first :P

@davelab6
Copy link
Member

@marijnkampf I think this is a bit complex for fontforge, and it would be better to 'decompose' this in Inkscape to a single path and then import that for use in a font.

@adrientetar
Copy link
Member

It doesn't hurt to let this open if you ask me, that's the point of an issue tracker.

@davelab6 davelab6 reopened this Jun 30, 2014
@davelab6 davelab6 added this to the Someday Maybe milestone Jun 30, 2014
@davelab6
Copy link
Member

Fair :) Allocating to 'Someday Maybe' milestone

@kuribas
Copy link

kuribas commented Jun 30, 2014

It would be possible using lib2geom intersection. If I am correct, lib2geom can
import an svg as a path directly. That could then be used for the font.

@davelab6
Copy link
Member

@kuribas so, lib2geom is LGPL v2.1 only, and FF is GPLv3, so unless @mental and all the other lib2geom folks will upgrade their license to v2.1-or-later, we can't use it.

@adrientetar
Copy link
Member

LGPL includes permission to relicense under GPLv3, as the FSF says:
http://gplv3.fsf.org/dd3-faq#compat-matrix-footnote-8

@adrientetar
Copy link
Member

That's because LGPL is a less restrictive variant of GPL. So you can upgrade to GPL if your project needs it.

@davelab6
Copy link
Member

Ah wow, awesome! Then yes, I think including lib2geom is a great idea, as
it will give us a quick boost on the remove overlap front, and better SVG
import (and export?).

Would the newly described remove overlap code go upstream to lib2geom?

@kuribas
Copy link

kuribas commented Jun 30, 2014

I don't think that is needed. And the algorithm used in inkscape looks similar to mine. I'd say it's better to use lib2geom now, and work together with the inkscape guys when there are bugs, rather than start all over.

@davelab6
Copy link
Member

davelab6 commented Jul 1, 2014

Okay great! Frank is going to work on lib2geom integration this week
On 30 Jun 2014 19:17, "Kristof Bastiaensen" notifications@github.com
wrote:

I don't think that is needed. And the algorithm used in inkscape looks
similar to mine. I'd say it's better to use lib2geom now, and work together
with the inkscape guys when there are bugs, rather than start all over.


Reply to this email directly or view it on GitHub
#1276 (comment)
.

@skef skef self-assigned this Apr 12, 2021
@vprus
Copy link

vprus commented Dec 18, 2023

Hi,
is there any chance this will get implemented? Any workaround in the meantime?

@iorsh
Copy link
Contributor

iorsh commented Dec 18, 2023

Well, SVG parser is aware of this tag - see https://github.com/fontforge/fontforge/blob/master/fontforge/svg.c#L2683, but I couldn't figure right away what it does. Some debugging is probably needed to understand it.

If you replace <clipPath> with <g> just to make it a group of objects and then perform clipping manually in FontForge, will it work?

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

No branches or pull requests

8 participants