fix windows naming issue, bump to version 142

This commit is contained in:
Eigil Mandrup Nikolajsen 2023-11-18 13:05:27 +01:00
parent 83be8d5052
commit 9da322eb1e
95 changed files with 22 additions and 30 deletions

View File

@ -1,4 +1,4 @@
<!doctype html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
@ -19,7 +19,7 @@
<style> <style>
@font-face { @font-face {
font-family: "CommitMono"; font-family: "CommitMono";
src: url("/src/fonts/fontlab/CommitMonoV141-VF.woff2"); src: url("/src/fonts/fontlab/CommitMonoV142-VF.woff2");
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
font-display: swap; font-display: swap;

View File

@ -1,4 +1,4 @@
<!doctype html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
@ -1190,7 +1190,7 @@
<div tabindex="0" id="block_tab_end"></div> <div tabindex="0" id="block_tab_end"></div>
</div> </div>
<script> <script>
const versionOfCommitMono = "V141" const versionOfCommitMono = "V142"
let fontsLoaded = false let fontsLoaded = false
const commitMono = new FontFace( const commitMono = new FontFace(
"CommitMono", "CommitMono",
@ -1198,7 +1198,7 @@
{ {
style: "normal", style: "normal",
weight: "400", weight: "400",
}, }
) )
// Add to the document.fonts (FontFaceSet) // Add to the document.fonts (FontFaceSet)
document.fonts.add(commitMono) document.fonts.add(commitMono)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -45,7 +45,7 @@ async function updateCodeFont() {
.load( .load(
`/src/fonts/fontlab/CommitMono${versionOfCommitMono}-${websiteData.weight}${ `/src/fonts/fontlab/CommitMono${versionOfCommitMono}-${websiteData.weight}${
websiteData.italic ? "Italic" : "Regular" websiteData.italic ? "Italic" : "Regular"
}.otf`, }.otf`
) )
.then((font) => { .then((font) => {
// // console.log(font) // // console.log(font)
@ -54,7 +54,7 @@ async function updateCodeFont() {
}) })
.catch((err) => console.log(err)) .catch((err) => console.log(err))
// opentype // opentype
// .load("src/fonts/fontlab/CommitMonoV141-500Regular.otf") // .load("src/fonts/fontlab/CommitMonoV142-500Regular.otf")
// .then((font) => { // .then((font) => {
// console.log(font) // console.log(font)
// console.log(font.toTables()) // console.log(font.toTables())
@ -81,7 +81,7 @@ function updateCode(event, form) {
displayName = character.name displayName = character.name
const ps = document.querySelectorAll(".code_char") const ps = document.querySelectorAll(".code_char")
ps.forEach((p) => ps.forEach((p) =>
p.dataset.char == character.name ? (p.style.display = "block") : (p.style.display = "none"), p.dataset.char == character.name ? (p.style.display = "block") : (p.style.display = "none")
) )
} }
}) })

View File

@ -100,8 +100,7 @@ function initializeDownload(button, blob) {
downloadStarted = false downloadStarted = false
button.classList.remove("loading") button.classList.remove("loading")
button.classList.add("loaded") button.classList.add("loaded")
// downloadFile(blob) saveFile(blob, `${websiteData.fontName}${versionOfCommitMono}.zip`)
saveFile(blob, `${websiteData.fontName}.zip`)
} }
function catchError(button, error) { function catchError(button, error) {
downloadStarted = false downloadStarted = false
@ -110,7 +109,7 @@ function catchError(button, error) {
console.log(error) console.log(error)
} }
function makeCustomFont(settings) { async function makeCustomFont(settings) {
const fontBaseURL = "/src/fonts/fontlab/" const fontBaseURL = "/src/fonts/fontlab/"
const fontName = "CommitMono" + versionOfCommitMono const fontName = "CommitMono" + versionOfCommitMono
const fontWeight = settings.weight const fontWeight = settings.weight
@ -302,7 +301,6 @@ function makeCustomFont(settings) {
font.names.windows.uniqueID.en = `${font.names.windows.version.en};;${websiteData.fontName}-${settings.style font.names.windows.uniqueID.en = `${font.names.windows.version.en};;${websiteData.fontName}-${settings.style
.split(" ") .split(" ")
.join("")};2023;FL820` .join("")};2023;FL820`
delete font.names.windows.preferredFamily
font.tables.cff.topDict.familyName = fontFamily font.tables.cff.topDict.familyName = fontFamily
font.tables.cff.topDict.fullName = fullName font.tables.cff.topDict.fullName = fullName
@ -360,12 +358,6 @@ async function getZipFileBlob(kindOfDownload, fonts) {
return zipFileBlob return zipFileBlob
} }
function downloadFile(blob) {
const a = document.createElement("a")
a.download = `${websiteData.fontName}.zip`
a.href = URL.createObjectURL(blob)
a.click()
}
function saveFile(blob, filename) { function saveFile(blob, filename) {
if (window.navigator.msSaveOrOpenBlob) { if (window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(blob, filename) window.navigator.msSaveOrOpenBlob(blob, filename)

View File

@ -235,7 +235,7 @@ function simulateTab(e) {
.forEach((el) => el.classList.remove("shake", "shake_left", "shake_right", "shake_up", "shake_down")) .forEach((el) => el.classList.remove("shake", "shake_left", "shake_right", "shake_up", "shake_down"))
const allTabbable = document.querySelectorAll( const allTabbable = document.querySelectorAll(
"#nav_form input:checked, section.visible input:checked, section.visible [tabindex='0']", "#nav_form input:checked, section.visible input:checked, section.visible [tabindex='0']"
) )
let addShake = false let addShake = false
let indexOfActive = 0 let indexOfActive = 0
@ -402,7 +402,7 @@ function onFocusIn(e) {
const paddingOffsetBottom = 200 const paddingOffsetBottom = 200
if (bounds.top > window.innerHeight - paddingOffsetBottom) { if (bounds.top > window.innerHeight - paddingOffsetBottom) {
const numberOfMoves = Math.floor( const numberOfMoves = Math.floor(
(bounds.top - (window.innerHeight - paddingOffsetBottom)) / websiteData.pushPage.distance, (bounds.top - (window.innerHeight - paddingOffsetBottom)) / websiteData.pushPage.distance
) )
for (let i = 0; i < numberOfMoves; i++) { for (let i = 0; i < numberOfMoves; i++) {
pushPage("KeyS") pushPage("KeyS")
@ -412,7 +412,7 @@ function onFocusIn(e) {
if (!document.activeElement.className.includes("nav")) { if (!document.activeElement.className.includes("nav")) {
if (bounds.top < paddingOffsetTop) { if (bounds.top < paddingOffsetTop) {
const numberOfMoves = Math.ceil( const numberOfMoves = Math.ceil(
Math.abs(bounds.top - paddingOffsetTop - 32) / websiteData.pushPage.distance, Math.abs(bounds.top - paddingOffsetTop - 32) / websiteData.pushPage.distance
) )
// console.log("num of moves:", numberOfMoves, "bounds.top:", bounds.top) // console.log("num of moves:", numberOfMoves, "bounds.top:", bounds.top)
for (let i = 0; i < numberOfMoves; i++) { for (let i = 0; i < numberOfMoves; i++) {
@ -476,8 +476,8 @@ function checkTutorialKeys(e) {
tutorialFinished = true tutorialFinished = true
const tutorialContainer = document.querySelector("#tutorial_complete") const tutorialContainer = document.querySelector("#tutorial_complete")
tutorialContainer.innerHTML = `<p>Tutorial complete! Your present is the variable version of Commit Mono:</p> tutorialContainer.innerHTML = `<p>Tutorial complete! Your present is the variable version of Commit Mono:</p>
<p><a href="/src/fonts/fontlab/CommitMonoV141-VF.ttf" tabindex="0">Download CommitMono-VF.ttf</a></p> <p><a href="/src/fonts/fontlab/CommitMonoV142-VF.ttf" tabindex="0">Download CommitMono-VF.ttf</a></p>
<p><a href="/src/fonts/fontlab/CommitMonoV141-VF.woff2" tabindex="0">Download CommitMono-VF.woff2</a></p> <p><a href="/src/fonts/fontlab/CommitMonoV142-VF.woff2" tabindex="0">Download CommitMono-VF.woff2</a></p>
<br />` <br />`
} }
} }

View File

@ -3,9 +3,9 @@
# step 3: run this from the root directory # step 3: run this from the root directory
rm src/fonts/*.zip rm src/fonts/*.zip
mkdir src/fonts/CommitMono-1.141 mkdir src/fonts/CommitMono-1.142
mv src/fonts/website-export/CommitMono.zip src/fonts/CommitMono-1.141/CommitMono.zip mv src/fonts/website-export/CommitMono.zip src/fonts/CommitMono-1.142/CommitMono.zip
cd src/fonts/CommitMono-1.141 cd src/fonts/CommitMono-1.142
unzip CommitMono.zip unzip CommitMono.zip
rm CommitMono.zip rm CommitMono.zip
mkdir ttfautohint mkdir ttfautohint
@ -22,8 +22,8 @@ rm CommitMono-400-Italic-unhinted.ttf
rm CommitMono-700-Regular-unhinted.ttf rm CommitMono-700-Regular-unhinted.ttf
rm CommitMono-700-Italic-unhinted.ttf rm CommitMono-700-Italic-unhinted.ttf
cd .. cd ..
zip -vr CommitMono-1.141.zip CommitMono-1.141/ -x "*.DS_Store" zip -vr CommitMono-1.142.zip CommitMono-1.142/ -x "*.DS_Store"
rm -R CommitMono-1.141 rm -R CommitMono-1.142
cd .. cd ..
cd .. cd ..

View File

@ -1,4 +1,4 @@
#1 Rename variable font to "CommitMonoV141-VF.ttf" #1 Rename variable font to "CommitMonoV142-VF.ttf"
#2 Navigate to /Developer/woff2 #2 Navigate to /Developer/woff2
#3 #3
~/Developer/woff2/woff2_compress ~/Library/CloudStorage/Dropbox/Privat/Eigils\ ting/projects/typography/Font\ Projects/code-mono-font/commit-mono/export/CommitMonoV141/CommitMonoV141-VF.ttf ~/Developer/woff2/woff2_compress ~/Library/CloudStorage/Dropbox/Privat/Eigils\ ting/projects/typography/Font\ Projects/code-mono-font/commit-mono/export/CommitMonoV142/CommitMonoV142-VF.ttf