diff --git a/.gitignore b/.gitignore index 10292d6..871260e 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ pages/ releases/ release-archives/ snapshot/assets/ +snapshot/index.css # Generated scripts .buildglyphs.all.patel diff --git a/glyphs/autobuilds.ptl b/glyphs/autobuilds.ptl index 45fd725..10d55d2 100644 --- a/glyphs/autobuilds.ptl +++ b/glyphs/autobuilds.ptl @@ -1063,7 +1063,7 @@ if [not recursive] : begin if [not lookups.(ligationLookupName)] : set lookups.(ligationLookupName) .type 'gsub_chaining' .subtables : list - chain-rule {less} {arrowStick 'arrowStickLC'} {arrowStick 'arrowStickCR'} {greater} + chain-rule {less} {arrowStick 'arrowStickLC'} {arrowStick 'arrowStickCR'} {greater} # <--> <==> chain-rule {less} {arrowStick 'arrowStickLR'} {greater} # <->, <=> chain-rule {less} {arrowStick 'arrowStickLJ'} {less} # <-<, <=< chain-rule {less} {arrowStick 'arrowStickLC'} {arrowStick 'arrowStickCF'} # <--, <== @@ -1076,7 +1076,7 @@ if [not recursive] : begin chain-rule {arrowStick 'arrowStickFC'} {arrowStick 'arrowStickCR'} {greater} # -->, ==> only {'hask'} : chain-rule {arrowStick 'arrowStickFR1'} {greater 'greaterShift1'} {greater} # ->>, =>> chain-rule {arrowStick 'arrowStickFR'} {greater} # ->, => - chain-rule {arrowStick 'arrowStickFJ1'} {less 'lessShiftN1'} {less} # -<<, =<< + only {'hask'} : chain-rule {arrowStick 'arrowStickFJ1'} {less 'lessShiftN1'} {less} # -<<, =<< only {'hask'} : chain-rule {arrowStick 'arrowStickFJ'} {less} # -<, =< #opbd diff --git a/images/download-options.png b/images/download-options.png index 573c8bc..5d77436 100644 Binary files a/images/download-options.png and b/images/download-options.png differ diff --git a/images/family.png b/images/family.png index 5a54825..f51d5da 100644 Binary files a/images/family.png and b/images/family.png differ diff --git a/images/languages.png b/images/languages.png index af1ca08..6673158 100644 Binary files a/images/languages.png and b/images/languages.png differ diff --git a/images/ligations.png b/images/ligations.png new file mode 100644 index 0000000..8377408 Binary files /dev/null and b/images/ligations.png differ diff --git a/images/matrix.png b/images/matrix.png index eddaede..2aeaf9c 100644 Binary files a/images/matrix.png and b/images/matrix.png differ diff --git a/images/opentype.png b/images/opentype.png index 8e05437..1260c37 100644 Binary files a/images/opentype.png and b/images/opentype.png differ diff --git a/images/preview-all.png b/images/preview-all.png index 68c5227..45f0a42 100644 Binary files a/images/preview-all.png and b/images/preview-all.png differ diff --git a/images/variants.png b/images/variants.png index 0b92b17..71536b9 100644 Binary files a/images/variants.png and b/images/variants.png differ diff --git a/images/weights.png b/images/weights.png index 2224e12..90864b0 100644 Binary files a/images/weights.png and b/images/weights.png differ diff --git a/makefile b/makefile index 497c2d9..406ac4e 100644 --- a/makefile +++ b/makefile @@ -157,6 +157,7 @@ d-webfonts : webfont-pkg-d-sans webfont-pkg-d-slab d-snapshot : x-snapshot-d-sans x-snapshot-d-slab electronsnaps1: d-snapshot + cd snapshot && stylus index.styl -c cd snapshot && electron getsnap.js --dir ../images images/opentype.png: electronsnaps1 optipng $@ diff --git a/snapshot/getsnap.js b/snapshot/getsnap.js index eadd9fc..26fd6b1 100644 --- a/snapshot/getsnap.js +++ b/snapshot/getsnap.js @@ -1,5 +1,4 @@ -var app = require('app'); -var BrowserWindow = require('browser-window'); +const {app, BrowserWindow} = require('electron'); var argv = require('yargs').argv; var fs = require('fs'); var cp = require('child_process'); @@ -9,20 +8,20 @@ var allWindowClosed = false; var pendingTasks = 0; var zoom = 2 -function checkQuit(){ - if(allWindowClosed && pendingTasks == 0) app.quit(); +function checkQuit() { + if (allWindowClosed && pendingTasks == 0) app.quit(); } -app.on('window-all-closed', function() { +app.on('window-all-closed', function () { allWindowClosed = true; checkQuit() }); -function combineImages(images, outfile, width, height, doubleTrim){ +function combineImages(images, outfile, width, height, doubleTrim) { var command = 'convert ' + images.join(' ') + ' -append -crop ' + width + 'x' + height + '+0+0 +repage -bordercolor #008000 -fuzz 5% -trim ' + (doubleTrim ? '-bordercolor ' + doubleTrim + ' -trim ' : '') + outfile; console.log(command); - cp.exec(command, function(err, stdout, stderr){ - images.forEach(function(file){ + cp.exec(command, function (err, stdout, stderr) { + images.forEach(function (file) { fs.unlinkSync(file); }); pendingTasks -= 1; @@ -31,36 +30,36 @@ function combineImages(images, outfile, width, height, doubleTrim){ }; var ipc = require('electron').ipcMain; -function GOTO(phase){ currentPhase = phase }; +function GOTO(phase) { currentPhase = phase }; var phases = { - prepare : function(event, arg){ + prepare: function (event, arg) { console.log(arg); GOTO(phases['receive-rect']); }, - 'receive-rect' : function(event, rect){ + 'receive-rect': function (event, rect) { pendingTasks += 1 rect = JSON.parse(JSON.stringify(rect)); var file = argv.dir + '/' + rect.name + '.png'; var j = 0; var totalFiles = Math.ceil(rect.height / rect.windowHeight); var pendingFiles = totalFiles; - function doneFileWrite(){ + function doneFileWrite() { pendingFiles -= 1; - if(pendingFiles <= 0) { + if (pendingFiles <= 0) { var images = []; - for(var k = 0; k < j; k++){ + for (var k = 0; k < j; k++) { images.push(argv.dir + '/' + rect.name + '.' + k + '.png') } combineImages(images, file, rect.windowWidth * rect.dpi, rect.height * rect.dpi, rect.doubleTrim); } } - function step(){ + function step() { event.sender.send('scroll', rect.y + j * rect.windowHeight); - GOTO(function(event){ - mainWindow.capturePage(function(image){ + GOTO(function (event) { + mainWindow.capturePage(function (image) { fs.writeFile(argv.dir + '/' + rect.name + '.' + j + '.png', image.toPng(), doneFileWrite); j += 1; - if(j >= totalFiles) { // Move to next image + if (j >= totalFiles) { // Move to next image event.sender.send('complete', file); GOTO(phases['receive-rect']); } else { @@ -73,18 +72,20 @@ var phases = { } }; var currentPhase = phases['prepare']; -ipc.on('snapshot', function(){ +ipc.on('snapshot', function () { currentPhase.apply(this, arguments) }); -ipc.on('log', function(event, arg){ +ipc.on('log', function (event, arg) { console.log(arg); }) -app.on('ready', function() { +app.on('ready', function () { mainWindow = new BrowserWindow({ width: 64 * 16 * zoom, height: 1024 * zoom, x: 5000, y: 5000, - zoomFactor: zoom, + webPreferences: { + zoomFactor: zoom + }, show: false }); mainWindow.showInactive(); diff --git a/snapshot/index.html b/snapshot/index.html index 35cdc67..43199fc 100644 --- a/snapshot/index.html +++ b/snapshot/index.html @@ -1,286 +1,8 @@ + - + +

This page is used for taking snapshots of Iosevka only.

- +
+ + + + + +
Feature TagsDesigned ForSample
No Ligation 
-<< -< <-- <<- <- -> ->> --> >- >>- <-> <--> <!--
+=<< =< <== <<= <= => =>> ==> >= >>= <=> <==>
caltDefault setting in editors
-<< -< <-- <<- <- -> ->> --> >- >>- <-> <--> <!--
+=<< =< <== <<= <= => =>> ==> >= >>= <=> <==>
XHS_, XPTLHaskell, PatEL
-<< -< <-- <<- <- -> ->> --> >- >>- <-> <--> <!--
+=<< =< <== <<= <= => =>> ==> >= >>= <=> <==>
+
+ + \ No newline at end of file diff --git a/snapshot/index.js b/snapshot/index.js new file mode 100644 index 0000000..71a06c6 --- /dev/null +++ b/snapshot/index.js @@ -0,0 +1,98 @@ +if(window && window.process && window.process.type && process.versions['electron']) (function(){ + console.log('I AN IN ELECTRON'); + var windowWidth = window.innerWidth; + var windowHeight = window.innerHeight; + var dpi = window.devicePixelRatio; + var ipc = require('electron').ipcRenderer; + + var onScroll = function(){}; + ipc.on('scroll', function(){ + onScroll.apply(this, arguments); + setTimeout(function(){ ipc.send('snapshot', 'scroll-done') }, 500); + }); + var onComplete = function(){}; + ipc.on('complete', function(){ onComplete.apply(this, arguments) }); + + function captureElement(options, callback){ + window.scroll(0, 0); + setTimeout(function(){ + var rect = options.el.getBoundingClientRect(); + onScroll = function(event, arg){ + window.scrollTo(0, arg); + }; + onComplete = function(){ + if(callback) callback(); + onComplete = function(){}; + }; + ipc.send('snapshot', { + name: options.name, + windowWidth: windowWidth, + windowHeight: windowHeight, + doubleTrim: options.doubleTrim, + dpi: dpi, + x: rect.left | 0, + y: rect.top | 0, + width: rect.width | 0, + height: rect.height | 0 + }); + }, 10); + } + + window.onload = function(){ + var snapshotTasks = [ + { + el: document.querySelector('#downloadoptions'), + name: 'download-options', + doubleTrim: 'white' + }, + { + el: document.querySelector('#languages'), + name: 'languages' + }, + { + el: document.querySelector('#variants'), + name: 'variants' + }, + { + el: document.querySelector('#opentype'), + name: 'opentype' + }, + { + el: document.querySelector('#matrix'), + name: 'matrix' + }, + { + el: document.querySelector('#family'), + name: 'family' + }, + { + el: document.querySelector('#previews'), + name: 'preview-all' + }, + { + el: document.querySelector('#weights'), + name: 'weights' + }, + { + el: document.querySelector('#ligations'), + name: 'ligations', + doubleTrim: 'white' + } + ]; + current = 0; + var step = function(){ + var doit = function(){ + captureElement(snapshotTasks[current], function(){ + current += 1; + if(current >= snapshotTasks.length) window.close() + else setTimeout(step, 100) + }) + }; + if(snapshotTasks[current].prepare) snapshotTasks[current].prepare(doit); + else setTimeout(doit, 100) + }; + ipc.send('snapshot', 'i am ready'); + console.log('I AM READY'); + setTimeout(step, 2000); + } +})() \ No newline at end of file diff --git a/snapshot/index.styl b/snapshot/index.styl new file mode 100644 index 0000000..280ea47 --- /dev/null +++ b/snapshot/index.styl @@ -0,0 +1,258 @@ +@import url(iosevka.css) +@import url(iosevka-slab.css) + +.thin { font-weight: 100 } +.extralight { font-weight: 200 } +.light { font-weight: 300 } +.medium { font-weight: 500 } +.bold { font-weight: 700 } +.extrabold { font-weight: 800 } +.heavy { font-weight: 900 } +.italic { font-style: italic } +.oblique { font-style: oblique } +.slab { font-family: "Iosevka Slab", monospace } + +html,body{ + margin: 0 + padding:0 +} +body { + font-family: "Iosevka" + background: #008000 + padding-bottom: 60em + font-size: 15px +} +pre, code { font-family: "Iosevka"; } + +::-webkit-scrollbar {display: none;} + +body > section { + margin: 3em auto + width: 900px + background: white +} + +/* hljs */ +section.preview { + text-align: center + font-size: 80% +} +section.preview pre { + display: inline-block + text-align: left + margin: 1.2rem 0 + line-height: 1.5 +} +section.color-light { + background-color: hsl(39, 6%, 95%) + color: #333 +} +.color-light .keyword, .color-light .class, .color-light .tag, .color-light .pseudo, .color-light .attr_selector, .color-light .constant, .color-light .xml .title { + color: #446fbd +} +.color-light .comment { + color: hsl(0, 0%, 62%) +} +.color-light .title, .color-light .attribute, .color-light .params, .color-light .built_in { + color: #8757ad +} +.color-light .string, .color-light .pi, .color-light .language-less .keyword, .color-light .xml .value { + color: #e88501 +} +.color-light .number, .color-light .xml .attribute { + color: #6d8600 +} +.color-light .operator { + color: #c33500 +} +section.color-dark { + background-color: hsl(39, 6%, 12%) + color: #cfcfcf +} +.color-dark .keyword, .color-dark .class, .color-dark .tag, .color-dark .pseudo, .color-dark .attr_selector, .color-dark .constant, .color-dark .xml .title { + color: #6c9ef8 +} +.color-dark .comment { + color: #767676 +} +.color-dark .title, .color-dark .attribute, .color-dark .params, .color-dark .built_in { + color: #b77fdb +} +.color-dark .string, .color-dark .pi, .color-dark .language-less .keyword, .color-dark .xml .value { + color: #D89333 +} +.color-dark .number, .color-dark .xml .attribute { + color: #85a300 +} +.color-dark .operator { + color: #c34564 +} + +section#matrix + height: 480px + position: relative + > div + position: absolute + font-size: 90px + left: 50% + margin-left: -3.75em + top: 50% + margin-top: -1.95em + > row + display: block + text-align: center + line-height: 0.8em + > span + font-size: 0.4em + padding: 0 0.5em + &.slab + margin-left: -3.25em + margin-top: -1.44em + +section#matrix > div > row > span { + font-size: 0.4em + padding: 0 0.5em +} + +section#opentype + width: 34.5em + padding: 0 3em + > h2 { display: none } + > div.hr + font-size: 80% + text-transform: uppercase + letter-spacing: 0.2em + margin: 3rem auto + text-align: center + display: block + &:before, &:after + content: '' + display: inline-block + border-bottom: 1px solid #ddd + width: 4em + margin: 0 1em + vertical-align: 0.3em + > div + display: flex + margin-bottom: 1em + align-items: center + > span + display: block + line-height: 1.5em + height: 4.5em + padding: 0.25em + border: 1px solid transparent + + span.normal-example + padding: 0.25em + text-align: right + width: 5rem + span.arrow + line-height: 4.5em + margin: 0 0.5rem 0 0.25em + span.feature-example + border-color: #ccc + border-radius: 0.25rem + margin-right: 0.5rem + padding: 0.25em 0.5em + width: 5em + span.lhs + display: block + font-size: 75% + border-bottom: 1px solid #ddd + span.rhs.sub + color: #989898 + b + font-weight: normal + color: black + + +#family + background: white + font-size: 0.9em + .group { display: flex } + .group a + display: block + padding: 0.5rem + flex: 1 + text-shadow: none + color: black + text-decoration: none + &.italic, &.oblique { flex: 1.3 } + &.slab { flex: 1.2 } + &.slab.italic, &.slab.oblique { flex: 1.7 } + +#downloadoptions + display: flex + justify-content: center + > div + flex: none + width: 12em + border: 3px solid #ddd + border-radius: 1em + margin: 0.5em + > h3 + margin: 0 + padding: 1rem 0 1rem 0 + text-align: center + font-weight: bold + font-size: 1em + > ul + display: flex + list-style: none + margin: 0 + padding: 0 + justify-content: center + > li + margin: 0 + padding: 0 + height: 3.5em + position: relative + padding: 0 0.5em 1em + > div + font-size: 0.8em + height: 2em + width: 2em + line-height: 2em + text-align: center + padding: 0.5em + border: 1px solid #ddd + border-radius: 0.5em + > h4 + position: absolute + left: 0 + right: 0 + bottom: 1.25em + margin: 0 + font-size: 0.6em + text-align: center + font-weight: normal + .missing + color: rgba(0, 0, 0, 0.25) + span + outline: 1px solid rgba(0, 0, 0, 0.2) + .fwm + padding-left: 0.25em + padding-right: 0.25em + margin-right: 0.25em + margin-left: -0.125em + .fwl + padding-right: 0.5em + +#ligations > table + border-spacing 0 + border-top 2px solid black + border-bottom 2px solid black + margin 1em + pre + margin 0 + th, td + padding: 0.4em 1em + text-align: justify + tr.first th + border-bottom: 1px solid black + s, .nolig + text-decoration: none + opacity: 0.25 + .nolig + font-feature-settings: "calt" 0; \ No newline at end of file