VivaRado / SYFF

Think of it as CSS for fonts.
GNU General Public License v3.0
8 stars 0 forks source link

Design Decisions #7

Open VivaRado opened 2 years ago

VivaRado commented 2 years ago

@ctrlcctrlv of MFEK pointed out, the similarities of SYFF with MetaFont and MetaPost, that able through a specially designed syntax of drawing and creating graphics using PostScript, PostScript to MetaPost compared to CSS to SYFF means we will have to come up with the things we would like to see SYFF be able to do.

Keep in mind that SYFF has to be embeddable in font editors that already exist, just like Xpresso in C4D or like Grasshopper in Rhino, but keeping things non intrusive against the font editor (more on that later), or even able to leverage the font editors API.

For the time being we are keeping things as simple as possible, the example bellow draws a circle-plus


Here's an example from file /usr/share/texlive/texmf-dist/fonts/source/public/cm/sym.mf on my system:

iff known o_plus: cmchar "Circle-plus operator";
beginarithchar(o_plus); pickup light_rule.nib; autorounded;
lft x6=hround u; x2=w-x6; y2=math_axis; top y8=h;
circle_points; draw_circle;  % circle
draw z2--z6; draw z4--z8;  % bar and stem
labels(1,2,3,4,5,6,7,8); endchar;

If I run...

mpost '&mfplain' "\\mode:=localfont; mag := 20.0; outputtemplate := \"%j-%c.svg\"; outputformat := \"svg\"; input /usr/share/texlive/texmf-dist/fonts/source/public/cm/cmsy10.mf;"

cmsy10-8.svg

cmsy10-8

Originally posted by @ctrlcctrlv in https://github.com/VivaRado/SYFF/issues/6#issuecomment-1279892195


Here is how PostScript would draw a circle

     4 5 3 0 360 arc closepath
     stroke

/* place at (4,5) with a radius of 3, draw arc 360*/

In CSS syntax, ehm... SYFF syntax...

Ο {
     pivot: 4 5;
     radius: 3;
     arc: 0 360;
}

/* place at (4,5) with a radius of 3, draw arc from 0 to 360 (0 redundant) */

image Circle A

Here is what we can see from drawing a circle with CSS.

.circle {
     height: 50px;
     width: 50px;
     border-radius: 50%;
}

That we draw a square, and then we make it rounded.

image Circle B

Then we can add more points to the circle and keep the ability to round them?

Ο {
     pivot: 4 5;
     radius: 3;
     arc: 0 360;
     segment: 4;
     border-radius: 80%;
     /* Imagine if we said constraint: false = wonky circle just in case */
}

/* place at (4,5) with a radius of 3, draw arc from 0 to 360 (0 redundant) with 4 segments, essentially a square in terms of points, but with 100% rounded */

image Circle C

With parallel constraint ( call them cubic constrained IDK ) we get to draw circles with less points, 4 anchors instead of 8 and if we remove the inner controls, an equal amount of controls, so why have more points but the same shape, well beats me...

But lets go on and ask for 3 points...

image Circle D

and two points...

image Circle E

and one point. image Circle F 🤣

Then control points to infinity are equal to parallel constraint, don't ask me in what space. Because pivot pulls the line in, based on border-radius value.

How many points do I need on a circle, not how many points the machine needs to designate a circle.

image got em!

VivaRado commented 2 years ago

What if constraints could accept formulas?

image Formula A

VivaRado commented 2 years ago

What if parallel constraint was not boolean?

image Circle G

VivaRado commented 2 years ago

We clearly understand strokes, for the controlled shape they are sub par as they are a precursor. We know for a fact there are many corrections needed to resolve stroke deliberations.

Everything (sometimes) starts with paths and outlines, but at some point designers start flattening and using the shapes. That part of the process is too fuzzy, unless you literally come up with a different representation of path editing, that meets consensus.

Additionally to this there are techniques like masking the stroke path extensions, adding end shapes and assuming all that blends well at the seams because variable fonts need homogeneity in path order, so you can also forget wild stuff like brush looking letters for now.

But most of the things needed for font design, are not design. They are plumbing, components, letter repetitions and THAT is what takes years. So THAT we want to solve with SYFF, because it's the easy problem and the biggest burden to the type designer at the same time.

If we end up solving design issues and come up with a different path representation that takes care of careful seam joining and path management. Take a look at Solidworks and parametric design in general. They accompany the shapes with dimensions and measurements.

You change the dimension it changes the underlying shape. This is how strokes should work, and they should take care of all the baggage they come with. That's why we need outside the box thinking and not be stuck at recreating components of proprietary software.

But anyone who worked with parametric knows that it needs careful setup or a lot of things just don't work or fail to compute like applying bevels to complicated boolean seams. But we are 1D less, and a lot can be fixed when you don't worry about one more dimension.

For SYFF at the moment, we will stick at doing the plumbing and solve the 3 out of 4 years it takes to design a font and assume you already know your ABCs and how to draw shapes, then maybe we will be nosy and bother you with telling you how to draw your shapes...

ctrlcctrlv commented 2 years ago

The first principle is wrong so the rest of what follows is too; at no point do the largest and best free software variable fonts (quæ sunt METAFONT fonts) go from strokes to filled paths, as if they were to do so, and apply discrete changes to those resulting paths, the changes could not be applied across the family as a whole.

VivaRado commented 2 years ago

The stroke to fill goes for the design process, some designers implement, I am speaking about "outline stroke" command. In the mean time we have a concept solution of stroke management that gives decent control for variation of thickness, and allows for variation of sherif design and placement. In addition to that we have a concept for stroke parametric design without discrete coordinates that handles curvilinear and straight line interceptions in one algorithm. All that conceptual but pretty much ended up by gradual simple mechanical functions.

VivaRado commented 2 years ago

A preview of SYFF Profiler. Not a priority. SYFF_node_editor_001_003