-
Notifications
You must be signed in to change notification settings - Fork 30
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
allow GLIF image to store an SVG file? #104
Comments
This means an implementation should be able to show a full length embedded movie. maybe "public.*" glyph.lib keys is something to look at but actually the data directory is build for this: http://unifiedfontobject.org/versions/ufo3/data/ |
Why? Implementations choose what to support. SVG has various profiles. No JS, no animation, no CSS, etc are all widely in use.... Ignore all Cosimo said about building color fonts. I think it makes sense to allow SVG where PNG is allowed, just for images. |
The image element stems from needing template images in the background, so the designer can trace them. While I don't agree that to allow SVG automatically implies that all clients must support all of SVG, I'm not convinced the image element is the right place for any SVG source images. What if you'd need an SVG source and a template image to trace? I would also suggest a combination of glyph.lib and the data folder. If this workflow becomes very popular, we can consider making it more native to the UFO format. |
That's what I said "ignore what Cosimo said about building color fonts". I'm suggesting that the template image can be in SVG. It's unreasonable limitation to specify in UFO spec that only PNG is accepted. |
We cannot not consider the use case... The current use case is for template images, which typically are scans. SVG makes no sense for that. (JPEG on the other hand...) |
We seem to have different approaches to what standards are or should do. You seem to prefer a policing approach. I prefer a expressiveness approach. |
The only use case for SVG in a glyph is for building a specific color font table. SVG support is not the same as support for plain image data, as it is specific to color fonts. A public data file name scheme is a good working solution for this specific problem. |
"image" felt like the most natural place for me. The spec currently only says that it should "always be considered to be behind the outline element", but doesn't explicitly say that these are meant as background images for tracing.
we could relax the requirement that only one Anyway, I don't want to push this too much, I can work with with data folder and glyph.lib for now. |
certainly one can already use the glif |
Btw. if the goal is to parse SVG and compile it to COLR/CPAL: why not import it as UFO layers? I think a COLR/CPAL compiler that takes UFO layers as input would be a useful thing. I am planning to look into the implications of adding such functionality to ufo2ft. If – big if – the intended SVG data should be expressible as color layers anyway, going back and forth from layers to SVG shouldn't be a huge deal. |
I just noticed that http://unifiedfontobject.org/roadmap/ has a section on SVG. I think we should just add that to the spec. I'm not entirely convinced of the requirement that there should be a layer named |
Let's proceed with that then.
Yea, I don't know what the use would be for a distinct layer. The glyphs from the default layers could just point directly to the svg file as stored in We also need to think how to allow multiple glyphs to point to the same svg document that may contain multiple glyph definitions. In the OT-SVG spec, these have an |
maybe this |
instead of |
Yes. Also: if TTX dumps of the SVG table could not use glyph IDs, that would be fantastic. +1 on |
If one wants to build bitmap color formats (sbix, CBLT/CBDT, OT-SVG with embdedded images), are we allowed to use the I believe so. The counter-argument "what if someone needs both a image source and a background image to trace" doesn't hold here. The default layer that specifies the glyph metrics, unicode value, black-and-white fallback outline, can have its own background image for tracing. But then additional layers will contain glyphs referencing the image sources (one layer per bitmap "strike", i.e. combiantion of PPEM and ppi). |
I disagree. I think we made a mistake by not documenting that To also use it as an SVG or PNG source makes for messy semantics.
Sure, these may be weak arguments, but I really think we need something different for image sources. And that something may be custom lib keys, public lib keys (which we can add without bumping the format version), or a spec upgrade. The latter is the most expensive option, and I really believe the existing lib + data folder machinery is flexible enough to enable such image-source workflows. |
Pity. It would be much easier to produce such fonts with the existing tools that already allow to drag-and-drop PNG images, position and stretch them, and store them inside the UFO. |
both could be handled with separate layers, each referencing different image sources. |
True.
True. |
Although I wonder if those existing tools really offer a pleasant experience for that particular task out of the box. For example, in RF you won't see such images in the space center, and I don't see any numerical controls for placement and transformation, so it's not an immediately obvious win there. I'm torn about this. I see your points, and we do indeed have a working piece of infrastructure. Still, the whole setup of images in UFO is so different from how glyph data is handled. For example, images can have arbitrary file names, and don't adhere to the layer hierarchy. I don't think the images folder allows subfolders. So, while the infrastructure can be used for image-source purposes, this intended functionality will be more or less tacked-on, and incidental, rather than be a well designed whole. And in this light I think it may be better to build something that is properly designed (with nice parallels to how outline data is handled), but using lib keys and the data folder, and then the actual usage will prove (or not) that this is a good workflow, and from that real experience we can better decide what changes in the UFO format would make this better. |
After a little break I revised my opinions:
In other words, I don't think the spec should be reworded to discourage this use case. Let's just see what happens. Now, I'm warming up slightly to the idea of opening up the format of images specified with
I think we are well on our way to agreeing that we need a general layer-based workflow to build color fonts (any format), but I now see that there is also a good use case for using SVG as sources. To me, the latter is for rather specialized tasks (such as building emoji fonts), and the former is more type-designer- and font-editor-friendly. However:
So far so good. If we indeed choose to allow SVG, how should positioning work? With PNG images, the reference point is the lower left corner of the image. SVG has flipped y coordinates, but I think the lower left corner of the media box should be used for positioning anyway. Would that match your expectations? A more complex question: if your workflow needs to support storing multiple glyphs in a single SVG file, how would that affect the |
Positioning should stay same. If URI syntax can be allowed, we can use something like "faces.svg#blushing" to reference part of an SVG document. |
Sorry to bump such an old thread, but as I've written over on the Norad bugtracker, it really doesn't matter what the spec intended…it's been long enough that My comment from there:
|
Copying my comment from that thread here. What @ctrlcctrlv brings up points to the need for UFO4 to do something about color fonts, as time goes on this will become more ambiguous, better to have a way to know what is for what in the spec.
|
I think if UFO explicitly wants to support being used as a source format for colour fonts, there needs to be an unambiguous decision made around how that use-case is represented in the data. Some assumptions I have:
Working from these assumptions, I can think of a few possible ways to disambiguate between an outline glyph with a background image for tracing, and a glyph with an image that is part of the glyph content:
... The first option feels bad because it would allow mixing colour/outline glyphs within a layer, which is a headache, and also because objectLib in general is fiddly. The second two options... feel maybe progressively better? I do think it is worth stepping back, though, and deciding if colour formats are really something that UFO wants to support explicitly or not. If the answer is 'no', which might be a very reasonable answer, then authors who really want to use UFO in this way can figure out their own set of lib keys to communicate what they need to communicate. finally, to touch on a much earlier thread in this discussion: I personally think it is fine for UFO to say that tracing images must be pngs. If a particular editing tool wants to support other formats, it can convert them. |
We're trying to design a workflow for generating color emoji or icon fonts from a set of SVG files.
I was thinking if we could re-purpose the current
<image>
element of the UFO GLIF spec so that it can contain SVGs in addition to the current PNG files.Currently the GLIF spec says
I suggest to rephrase this as
Doing this will make it easier to link together a GLIF to an SVG file that contains coloured vector outlines that can then be used to compile COLR/CPAL or OT-SVG fonts.
The text was updated successfully, but these errors were encountered: