Code Monkey home page Code Monkey logo

syff's Issues

Design Decisions

@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 #6 (comment)


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!

Instance Queries are not supported.

We can parse but we do not recurse instance queries yet. For example here is an instance query for the bold weight.

@instance (bold) { 

	A [ B = "name, unicode" ] {

		partial: keep("partial_a", "partial_b");
		partial: remove("partial_b");
		partial: get("Π","partial_a","partial_a_rename");
		partial: copy("partial_a", "partial_b");

	}

}

Test SSTORE reconstruction.

@eliheuer @davelab6

The size of a font on SSTORE:

This is from FontRegistry codebase:

    // our font is 115KB
    // contract storage is < 24KB
    // we need to chunk our font into 5 partitions to store it fully

From the email, identified chunks:

  • SYFF instructions: 1 - 5 KB max
  • Initial Coordinates: 10 KB
  • Kerning: 20 KB (still needs compression but I got a few ideas like classes ontop of classes)

We get all that build the font on the client with Javascript like with fontkit and varLib models that exists in JS already with client-side code.

Or we provide an API service that builds the font with Python or whatnot, but this defeats the purpose cause KBs on the net, while it could be done on the client with no bandwidth. Hints at SYFF but in JS.

Cost $13.82/KB? Advise on GAS please.
The font would be about 35KB reconstructed a lot bigger but client side. 483.7$ per font. But keep in mind the alterations also cost in case we have to change the content.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.