vivarado / syff Goto Github PK
View Code? Open in Web Editor NEWThink of it as CSS for fonts.
License: GNU General Public License v3.0
Think of it as CSS for fonts.
License: GNU General Public License v3.0
@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
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) */
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.
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 */
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...
and two points...
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.
partial get is not supported.
BUMP
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");
}
}
BUMP
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:
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.
mirrorX and mirrorY are letter only, partial mirroring is not supported.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.