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">
<head>
<meta charset="UTF-8" />
@ -19,7 +19,7 @@
<style>
@font-face {
font-family: "CommitMono";
src: url("/src/fonts/fontlab/CommitMonoV141-VF.woff2");
src: url("/src/fonts/fontlab/CommitMonoV142-VF.woff2");
font-style: normal;
font-weight: 400;
font-display: swap;

View File

@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
@ -1190,7 +1190,7 @@
<div tabindex="0" id="block_tab_end"></div>
</div>
<script>
const versionOfCommitMono = "V141"
const versionOfCommitMono = "V142"
let fontsLoaded = false
const commitMono = new FontFace(
"CommitMono",
@ -1198,7 +1198,7 @@
{
style: "normal",
weight: "400",
},
}
)
// Add to the document.fonts (FontFaceSet)
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(
`/src/fonts/fontlab/CommitMono${versionOfCommitMono}-${websiteData.weight}${
websiteData.italic ? "Italic" : "Regular"
}.otf`,
}.otf`
)
.then((font) => {
// // console.log(font)
@ -54,7 +54,7 @@ async function updateCodeFont() {
})
.catch((err) => console.log(err))
// opentype
// .load("src/fonts/fontlab/CommitMonoV141-500Regular.otf")
// .load("src/fonts/fontlab/CommitMonoV142-500Regular.otf")
// .then((font) => {
// console.log(font)
// console.log(font.toTables())
@ -81,7 +81,7 @@ function updateCode(event, form) {
displayName = character.name
const ps = document.querySelectorAll(".code_char")
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
button.classList.remove("loading")
button.classList.add("loaded")
// downloadFile(blob)
saveFile(blob, `${websiteData.fontName}.zip`)
saveFile(blob, `${websiteData.fontName}${versionOfCommitMono}.zip`)
}
function catchError(button, error) {
downloadStarted = false
@ -110,7 +109,7 @@ function catchError(button, error) {
console.log(error)
}
function makeCustomFont(settings) {
async function makeCustomFont(settings) {
const fontBaseURL = "/src/fonts/fontlab/"
const fontName = "CommitMono" + versionOfCommitMono
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
.split(" ")
.join("")};2023;FL820`
delete font.names.windows.preferredFamily
font.tables.cff.topDict.familyName = fontFamily
font.tables.cff.topDict.fullName = fullName
@ -360,12 +358,6 @@ async function getZipFileBlob(kindOfDownload, fonts) {
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) {
if (window.navigator.msSaveOrOpenBlob) {
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"))
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 indexOfActive = 0
@ -402,7 +402,7 @@ function onFocusIn(e) {
const paddingOffsetBottom = 200
if (bounds.top > window.innerHeight - paddingOffsetBottom) {
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++) {
pushPage("KeyS")
@ -412,7 +412,7 @@ function onFocusIn(e) {
if (!document.activeElement.className.includes("nav")) {
if (bounds.top < paddingOffsetTop) {
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)
for (let i = 0; i < numberOfMoves; i++) {
@ -476,8 +476,8 @@ function checkTutorialKeys(e) {
tutorialFinished = true
const tutorialContainer = document.querySelector("#tutorial_complete")
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/CommitMonoV141-VF.woff2" tabindex="0">Download CommitMono-VF.woff2</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/CommitMonoV142-VF.woff2" tabindex="0">Download CommitMono-VF.woff2</a></p>
<br />`
}
}

View File

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