Skip to content

Commit ed27c84

Browse files
fix problem with cv10
1 parent 3f7f188 commit ed27c84

File tree

62 files changed

+63
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+63
-41
lines changed

404.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
@@ -19,7 +19,7 @@
1919
<style>
2020
@font-face {
2121
font-family: "CommitMono";
22-
src: url("/src/fonts/fontlab/CommitMonoV140-VF.woff2");
22+
src: url("/src/fonts/fontlab/CommitMonoV141-VF.woff2");
2323
font-style: normal;
2424
font-weight: 400;
2525
font-display: swap;

index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
@@ -1190,15 +1190,15 @@ <h2>Programs used</h2>
11901190
<div tabindex="0" id="block_tab_end"></div>
11911191
</div>
11921192
<script>
1193-
const versionOfCommitMono = "V140"
1193+
const versionOfCommitMono = "V141"
11941194
let fontsLoaded = false
11951195
const commitMono = new FontFace(
11961196
"CommitMono",
11971197
`url(/src/fonts/fontlab/CommitMono${versionOfCommitMono}-VF.woff2)`,
11981198
{
11991199
style: "normal",
12001200
weight: "400",
1201-
}
1201+
},
12021202
)
12031203
// Add to the document.fonts (FontFaceSet)
12041204
document.fonts.add(commitMono)

src/css/style.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ a:focus,
123123

124124
i {
125125
font-style: normal;
126-
font-variation-settings: "wght" 400, "ital" 1;
126+
font-variation-settings:
127+
"wght" 400,
128+
"ital" 1;
127129
}
128130

129131
h1 {
-83.7 KB
Binary file not shown.
83.5 KB
Binary file not shown.

src/js/code_section.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function updateCodeFont() {
4545
.load(
4646
`/src/fonts/fontlab/CommitMono${versionOfCommitMono}-${websiteData.weight}${
4747
websiteData.italic ? "Italic" : "Regular"
48-
}.otf`
48+
}.otf`,
4949
)
5050
.then((font) => {
5151
// // console.log(font)
@@ -54,7 +54,7 @@ async function updateCodeFont() {
5454
})
5555
.catch((err) => console.log(err))
5656
// opentype
57-
// .load("src/fonts/fontlab/CommitMonoV140-500Regular.otf")
57+
// .load("src/fonts/fontlab/CommitMonoV141-500Regular.otf")
5858
// .then((font) => {
5959
// console.log(font)
6060
// console.log(font.toTables())
@@ -81,7 +81,7 @@ function updateCode(event, form) {
8181
displayName = character.name
8282
const ps = document.querySelectorAll(".code_char")
8383
ps.forEach((p) =>
84-
p.dataset.char == character.name ? (p.style.display = "block") : (p.style.display = "none")
84+
p.dataset.char == character.name ? (p.style.display = "block") : (p.style.display = "none"),
8585
)
8686
}
8787
})

src/js/distinct_section.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function nextQuestion(correct, answer, wrongAnswer, pointerType) {
159159
question.classList.add("active_question")
160160
const rightButton = question.querySelector(`.button_container .question_button:nth-child(${answer + 1})`)
161161
const wrongButton = question.querySelector(
162-
`.button_container .question_button:nth-child(${wrongAnswer + 1})`
162+
`.button_container .question_button:nth-child(${wrongAnswer + 1})`,
163163
)
164164
correct ? rightButton.classList.add("button_choice") : wrongButton.classList.add("button_choice")
165165
!correct ? rightButton.classList.add("button_choicent") : wrongButton.classList.add("button_choicent")

src/js/docs_section.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function buildDocs() {
3333
? `<span class="span_on${
3434
feature.on ? " active_feature" : ""
3535
}" onclick="changeFeatureDocs('enable')">[${l}]</span>`
36-
: l
36+
: l,
3737
)
3838
.join("")
3939
h2.innerHTML = featureDescriptionWithSpan

src/js/download_wizard.js

+31-11
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ function makeCustomFont(settings) {
119119
// "/src/fonts/fontlab/CommitMonoV132-400Italic.otf"
120120

121121
return fetch(fontFilePath)
122-
.then(file=>file.arrayBuffer())
123-
.then(font=>opentype.parse(font))
122+
.then((file) => file.arrayBuffer())
123+
.then((font) => opentype.parse(font))
124124
.then((font) => {
125125
// ######################
126126
// #1 change alternates by switching their paths
@@ -132,25 +132,45 @@ function makeCustomFont(settings) {
132132
//
133133
// filter for only the active ones
134134
if (!active) return
135-
// // console.log("alternate", alternate, "active", active)
135+
// console.log("alternate", alternate, "active", active)
136136

137137
// look at all the fonts features
138138
font.tables.gsub.features.forEach((feature) => {
139139
//
140140
// if the feature matches the alternate we're currently on
141141
if (feature.tag == alternate) {
142-
// // console.log("feature", feature)
142+
// console.log("feature", feature)
143143

144144
// then loop through the list of lookup indexes of that feature
145145
feature.feature.lookupListIndexes.forEach((lookupIndex) => {
146-
// // console.log("lookupIndex", lookupIndex)
146+
// console.log("lookupIndex", lookupIndex)
147147

148148
// loop through the subtable of each lookup at the lookup index
149149
font.tables.gsub.lookups[lookupIndex].subtables.forEach((subtable) => {
150-
// // console.log("subtable", subtable)
150+
// console.log("subtable", subtable)
151+
152+
// find the base glyphs
153+
let glyphs = []
154+
155+
// get glyphs from glyphs array
156+
if (subtable.coverage.format == 1) {
157+
glyphs = subtable.coverage.glyphs
158+
}
159+
160+
// get glyphs from ranges
161+
if (subtable.coverage.format == 2) {
162+
// [{start: 0, end: 4}, {start: 8, end: 8}] => [0, 1, 2, 3, 4, 8]
163+
glyphs = subtable.coverage.ranges
164+
.map((range) =>
165+
Array.from(Array(range.end - range.start + 1)).map(
166+
(_, index) => range.start + index
167+
)
168+
)
169+
.flat()
170+
}
151171

152172
// loop through the glyphs of the subtable
153-
subtable.coverage.glyphs.forEach((glyphIndexOriginal, index) => {
173+
glyphs.forEach((glyphIndexOriginal, index) => {
154174
//
155175
// glyphIndexOriginal is the index of the original glyph
156176
// glyphIndexSubstitute is the index of the glyph to substitute the original with
@@ -264,7 +284,7 @@ function makeCustomFont(settings) {
264284
// ######################
265285
// #3 change the names
266286
// give custom names to each member of the style group
267-
287+
268288
const fontFamily = websiteData.fontName
269289
const fullName = `${websiteData.fontName} ${settings.style}`
270290
const postScriptName = `${websiteData.fontName}-${settings.style.split(" ").join("")}`
@@ -274,7 +294,7 @@ function makeCustomFont(settings) {
274294
font.names.macintosh.fullName.en = fullName
275295
font.names.macintosh.postScriptName.en = postScriptName
276296
font.names.macintosh.preferredSubfamily = font.names.windows.preferredSubfamily
277-
297+
278298
font.names.windows.fontFamily.en = fontFamily
279299
font.names.windows.fontSubfamily.en = settings.style
280300
font.names.windows.fullName.en = fullName
@@ -284,7 +304,7 @@ function makeCustomFont(settings) {
284304
.join("")};2023;FL820`
285305
delete font.names.windows.preferredFamily
286306

287-
font.tables.cff.topDict.familyName = fontFamily
307+
font.tables.cff.topDict.familyName = fontFamily
288308
font.tables.cff.topDict.fullName = fullName
289309
font.tables.cff.topDict.weight = settings.weight == 700 ? "Bold" : "Regular"
290310

@@ -312,7 +332,7 @@ function makeCustomFont(settings) {
312332
}
313333

314334
async function getZipFileBlob(kindOfDownload, fonts) {
315-
console.log(fontFileBlobs, fonts)
335+
// console.log(fontFileBlobs, fonts)
316336

317337
const { BlobWriter, BlobReader, HttpReader, ZipWriter, TextReader } = zip
318338
const zipFileWriter = new BlobWriter()

src/js/nav.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ function simulateTab(e) {
235235
.forEach((el) => el.classList.remove("shake", "shake_left", "shake_right", "shake_up", "shake_down"))
236236

237237
const allTabbable = document.querySelectorAll(
238-
"#nav_form input:checked, section.visible input:checked, section.visible [tabindex='0']"
238+
"#nav_form input:checked, section.visible input:checked, section.visible [tabindex='0']",
239239
)
240240
let addShake = false
241241
let indexOfActive = 0
@@ -402,7 +402,7 @@ function onFocusIn(e) {
402402
const paddingOffsetBottom = 200
403403
if (bounds.top > window.innerHeight - paddingOffsetBottom) {
404404
const numberOfMoves = Math.floor(
405-
(bounds.top - (window.innerHeight - paddingOffsetBottom)) / websiteData.pushPage.distance
405+
(bounds.top - (window.innerHeight - paddingOffsetBottom)) / websiteData.pushPage.distance,
406406
)
407407
for (let i = 0; i < numberOfMoves; i++) {
408408
pushPage("KeyS")
@@ -412,7 +412,7 @@ function onFocusIn(e) {
412412
if (!document.activeElement.className.includes("nav")) {
413413
if (bounds.top < paddingOffsetTop) {
414414
const numberOfMoves = Math.ceil(
415-
Math.abs(bounds.top - paddingOffsetTop - 32) / websiteData.pushPage.distance
415+
Math.abs(bounds.top - paddingOffsetTop - 32) / websiteData.pushPage.distance,
416416
)
417417
// console.log("num of moves:", numberOfMoves, "bounds.top:", bounds.top)
418418
for (let i = 0; i < numberOfMoves; i++) {
@@ -476,8 +476,8 @@ function checkTutorialKeys(e) {
476476
tutorialFinished = true
477477
const tutorialContainer = document.querySelector("#tutorial_complete")
478478
tutorialContainer.innerHTML = `<p>Tutorial complete! Your present is the variable version of Commit Mono:</p>
479-
<p><a href="/src/fonts/fontlab/CommitMonoV140-VF.ttf" tabindex="0">Download CommitMono-VF.ttf</a></p>
480-
<p><a href="/src/fonts/fontlab/CommitMonoV140-VF.woff2" tabindex="0">Download CommitMono-VF.woff2</a></p>
479+
<p><a href="/src/fonts/fontlab/CommitMonoV141-VF.ttf" tabindex="0">Download CommitMono-VF.ttf</a></p>
480+
<p><a href="/src/fonts/fontlab/CommitMonoV141-VF.woff2" tabindex="0">Download CommitMono-VF.woff2</a></p>
481481
<br />`
482482
}
483483
}

src/language_examples/html.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
33
<head>
44
<meta charset="UTF-8" />

src/language_examples/javascript.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function lcs(arr1, arr2) {
1515
} else {
1616
matrix[rowIndex][columnIndex] = Math.max(
1717
matrix[rowIndex - 1][columnIndex],
18-
matrix[rowIndex][columnIndex - 1]
18+
matrix[rowIndex][columnIndex - 1],
1919
)
2020
}
2121
}

src/tests/braille.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

src/tests/classes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

src/tests/instances.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

src/tests/letter_group_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2911,6 +2911,6 @@ for (let i = 0; i < 50; i++) {
29112911
.split("")
29122912
// .map((l, i) => (i == 6 ? l.toUpperCase() : l))
29132913
.map((l, i) => (i == 0 ? " " + l : l))
2914-
.join("")
2914+
.join(""),
29152915
)
29162916
}

src/tests/tables.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en-us">
33
<head>
44
<meta charset="utf-8" />

src/txt/ttfautohint.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# step 3: run this from the root directory
44

55
rm src/fonts/*.zip
6-
mkdir src/fonts/CommitMono-1.140
7-
mv src/fonts/website-export/CommitMono.zip src/fonts/CommitMono-1.140/CommitMono.zip
8-
cd src/fonts/CommitMono-1.140
6+
mkdir src/fonts/CommitMono-1.141
7+
mv src/fonts/website-export/CommitMono.zip src/fonts/CommitMono-1.141/CommitMono.zip
8+
cd src/fonts/CommitMono-1.141
99
unzip CommitMono.zip
1010
rm CommitMono.zip
1111
mkdir ttfautohint
@@ -22,8 +22,8 @@ rm CommitMono-400-Italic-unhinted.ttf
2222
rm CommitMono-700-Regular-unhinted.ttf
2323
rm CommitMono-700-Italic-unhinted.ttf
2424
cd ..
25-
zip -vr CommitMono-1.140.zip CommitMono-1.140/ -x "*.DS_Store"
26-
rm -R CommitMono-1.140
25+
zip -vr CommitMono-1.141.zip CommitMono-1.141/ -x "*.DS_Store"
26+
rm -R CommitMono-1.141
2727
cd ..
2828
cd ..
2929

src/txt/woff2_conversion_guide.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#1 Place file in Downloads
1+
#1 Rename variable font to "CommitMonoV141-VF.ttf"
22
#2 Navigate to /Developer/woff2
33
#3
4-
~/Developer/woff2/woff2_compress ~/Library/CloudStorage/Dropbox/Privat/Eigils\ ting/projects/typography/Font\ Projects/code-mono-font/commit-mono/export/CommitMonoV140/CommitMonoV140-VF.ttf
4+
~/Developer/woff2/woff2_compress ~/Library/CloudStorage/Dropbox/Privat/Eigils\ ting/projects/typography/Font\ Projects/code-mono-font/commit-mono/export/CommitMonoV141/CommitMonoV141-VF.ttf

0 commit comments

Comments
 (0)