diff --git a/GlyphConstruction.roboFontExt/html/index.html b/GlyphConstruction.roboFontExt/html/index.html index 1011219..c2a2730 100644 --- a/GlyphConstruction.roboFontExt/html/index.html +++ b/GlyphConstruction.roboFontExt/html/index.html @@ -8,7 +8,7 @@ -

Glyph Construction

+

Glyph Construction

Glyph Construction is a simple, powerful, human-readable language for describing how glyph shapes are built.

Glyph Construction can be used to create new glyphs from components. It is specially useful for creating accented glyphs.

Collections of Glyph Construction rules can be saved as *.glyphConstruction files, and can be shared between fonts.

@@ -69,112 +69,96 @@

Table of Contents

Glyph Construction language

Assigning a construction to a glyph

Build <destGlyphName> out of one or more components.

-
<destGlyphName> = <glyphName> + <glyphName>
-Aacute = A + acute
-
- +
<destGlyphName> = <glyphName> + <glyphName>
+Aacute = A + acute
+

Optionally, a suffix can be provided. If a glyph with the given suffix does not exist in the font, the suffix is ignored.

-
Aacute = A + acute.cap
-
- +
Aacute = A + acute.cap
+

Comments

A line starting with (or anything after) a # is a comment and will not be used during execution.

-
# this is a comment
-Aacute = A + acute
-Agrave = A + grave # this is a note
-
- +
# this is a comment
+Aacute = A + acute
+Agrave = A + grave # this is a note
+

Notes

A comment # at the end of a glyph construction is a note.

-
<destGlyphName> = <glyphName> + <glyphName> # <note>
-Aacute = A + acute # this is a note
-
- +
<destGlyphName> = <glyphName> + <glyphName> # <note>
+Aacute = A + acute # this is a note
+

Unicodes

Unicodes in hexidecimal notation. Multiple Unicodes accepted, separated by commas. Glyph Builder: If Unicodes are provided, they will be used even if "AutoUnicodes: True" is set.

-
<destGlyphName> = <glyphName> + <glyphName> | <unicode>, <unicodes>*
-Aacute = A + acute | 00C1
-Tcommaaccent = T + commaaccent @ bottom | 021A, 0162
-
- +
<destGlyphName> = <glyphName> + <glyphName> | <unicode>, <unicodes>*
+Aacute = A + acute | 00C1
+Tcommaaccent = T + commaaccent @ bottom | 021A, 0162
+

Mark Color

-
<destGlyphName> = <glyphName> + <glyphName> ! <rgba>
-Aacute = A + acute ! 1, 0, 0, 1
-
- +
<destGlyphName> = <glyphName> + <glyphName> ! <rgba>
+Aacute = A + acute ! 1, 0, 0, 1
+

Metrics

-

Width

-
<destGlyphName> = <glyphName> + <glyphName> ^ <width>
-Aacute = A + acute ^ 400
-
- - -

Left and Right Margins

-
<destGlyphName> = <glyphName> + <glyphName> ^ <leftmargin>, <rightMargin>
-Aacute = A + acute ^ 30, 30
-
+

Width

+
<destGlyphName> = <glyphName> + <glyphName> ^ <width>
+Aacute = A + acute ^ 400
+
+

Left and Right Margins

+
<destGlyphName> = <glyphName> + <glyphName> ^ <leftmargin>, <rightMargin>
+Aacute = A + acute ^ 30, 30
+

Width and margin values can also be defined using basic maths and references to width, leftMargin or rightMargin of other glyphs.

-
# width is equal to twice the width of A
-Aacute = A + acute ^ A * 2
-
-# left margin is equal to one third of the left margin of A
-# right margin is equal to twice the right margin of B
-Aacute = A + acute ^ A / 3, B * 2
-
+
# width is equal to twice the width of A
+Aacute = A + acute ^ A * 2
 
+# left margin is equal to one third of the left margin of A
+# right margin is equal to twice the right margin of B
+Aacute = A + acute ^ A / 3, B * 2
+

Use a ' to flip to the opposite side of given glyph margin.

-
# left margin is used for the right margin of the generate d.alt
-d.alt = d ^ d', d'
-
- +
# left margin is used for the right margin of the generate d.alt
+d.alt = d ^ d', d'
+

Decompose glyph

Add * before a glyph construction rule to explicitly tell the constructor to decompose the final result.

-
*agrave = a + grave
-
- +
*agrave = a + grave
+

Add Source Glyph

Add > before a glyph construction rule to include the source font glyph name in the final result.

-
# include the the drawing of the source font 'a' 
-# and set the spacing to 40 for the left margin and 50 on the right margin.
->a = ^ 40, 50
-
- +
# include the the drawing of the source font 'a' 
+# and set the spacing to 40 for the left margin and 50 on the right margin.
+>a = ^ 40, 50
+

Ignore existing glyphs

Add ? before a glyph construction rule to ignore this glyph if it already exists in the font.

-
?Aacute = A + acute
-
- +
?Aacute = A + acute
+

Positioning

The Glyph Construction language offers different ways to position the added components in relation to the current glyph.

-

By Numbers

-
Aacute = A + acute@100
-Aacute = A + acute@100,100
-
+

By Numbers

+
Aacute = A + acute@100
+Aacute = A + acute@100,100
+
+

By Percentages

+
Aacute = A + acute@50%,50%
+
-

By Percentages

-
Aacute = A + acute@50%,50%
-
- - -

By Reference

-
Aacute = A + acute@center,top
-
- +

By Reference

+
Aacute = A + acute@center,top
+

A reference could be (in this order):

-

By Transformation Matrix

+

By Transformation Matrix

@ followed by a transformation matrix: 6 values xx, xy, yx, yy, x, y

-
Aacute = A + acute@1, 0, 0, 1, 100, 100
-
+
Aacute = A + acute@1, 0, 0, 1, 100, 100
+
- -

Change the current glyph

+

Change the current glyph

The current glyph is always the last component added.

For example, Aacute = A + acute will:

Force the current glyph with @<glyphName>:<pos>:

-
Ocircumflexdotaccent =  O + circumflex@center,top + dotaccent@O:center,bottom
-
- +
Ocircumflexdotaccent =  O + circumflex@center,top + dotaccent@O:center,bottom
+

The forced glyphName can also be escapped with " in case the glyph name contains a :

-
Ocircumflexdotaccent =  O + circumflex@center,top + dotaccent@"O:latn":center,bottom
-
- +
Ocircumflexdotaccent =  O + circumflex@center,top + dotaccent@"O:latn":center,bottom
+
-

Flipping

+

Flipping

~ followed by a position will flip a component:

-
# flip horizontally
+
# flip horizontally
 Aacute = A + acute@~center,top
 
 # flip vertically
@@ -219,39 +200,33 @@ 

Flipping

# flip both horizontally and vertically Aacute = A + acute@~center,~top -
- +

Stacking Vertically

-
Aringacute = A + ring@center,top + acute@center,top
-
- +
Aringacute = A + ring@center,top + acute@center,top
+

Positioning formulas

-
Aringacute = A + ring@center,`top+10` + acute@center,`top-10`
-
- +
Aringacute = A + ring@center,`top+10` + acute@center,`top-10`
+

Stacking Horizontally

-
ffi = f & f & i
-
+
ffi = f & f & i
+
- -

Apply kerning while stacking horizontally

+

Apply kerning while stacking horizontally

Start a sub-glyphConstruction with a backslash to indicate kerning should be applied while stacking horizotally.

-
A_V = A &\ V
-
- +
A_V = A &\ V
+

Variables

Glyph Construction supports variables, which can be defined once at the top of the document and used multiple times.

-
$name = something # declaration
+
$name = something # declaration
 {name} # usage
 
 $myColorMark = 1, 0, 0, 1 # declaration
 agrave = a + grave@center,top ! {myColorMark} # usage
-
- +

Glyph Builder interface

@@ -304,10 +279,10 @@

Status bar

The status bar at the bottom of the window displays information about the currently selected glyph: glyph name, width, left and right margins, component names, unicode, mark color, and note.

Comment variables

Preset build checkboxes in the comments of the constructions.

-
# OverwriteExistingGlyphs: True/False
-# AutoUnicodes: True/False
-# MarkGlyphs: False/r, g, b, a
-
+
# OverwriteExistingGlyphs: True/False
+# AutoUnicodes: True/False
+# MarkGlyphs: False/r, g, b, a
+
\ No newline at end of file diff --git a/GlyphConstruction.roboFontExt/info.plist b/GlyphConstruction.roboFontExt/info.plist index bb2eb82..08a3118 100644 --- a/GlyphConstruction.roboFontExt/info.plist +++ b/GlyphConstruction.roboFontExt/info.plist @@ -30,8 +30,8 @@ requiresVersionMinor 5 timeStamp - 1646230902.0178139 + 1669815851.0749199 version - 0.11 + 0.12