Skip to content

Commit

Permalink
fix recordid widths
Browse files Browse the repository at this point in the history
  • Loading branch information
gilphilbert committed Nov 12, 2023
1 parent 248a8f4 commit 5830916
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><meta name="apple-mobile-web-app-title" content="Juke Studio"><meta name="application-name" content="Juke Studio"><meta name="msapplication-TileColor" content="#2d89ef"><meta name="theme-color" content="#b15339"><meta name="Description" content="A web app for creating title strips for jukeboxes"><title>JukeStudio</title><link rel="stylesheet" href="/juke.css"><link rel="stylesheet" href="/fonts/fonts.css"><script defer="defer" src="/js/chunk-vendors.d334ab62.js"></script><script defer="defer" src="/js/app.1e4c3caf.js"></script><link href="/css/app.869d7e9a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but jukestudio doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><meta name="apple-mobile-web-app-title" content="Juke Studio"><meta name="application-name" content="Juke Studio"><meta name="msapplication-TileColor" content="#2d89ef"><meta name="theme-color" content="#b15339"><meta name="Description" content="A web app for creating title strips for jukeboxes"><title>JukeStudio</title><link rel="stylesheet" href="/juke.css"><link rel="stylesheet" href="/fonts/fonts.css"><script defer="defer" src="/js/chunk-vendors.d334ab62.js"></script><script defer="defer" src="/js/app.aef302a6.js"></script><link href="/css/app.869d7e9a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but jukestudio doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
1 change: 0 additions & 1 deletion docs/js/app.1e4c3caf.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions docs/js/app.1e4c3caf.js → docs/js/app.aef302a6.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/js/app.aef302a6.js.map

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions src/assets/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ let Printer = {
var x = ((index < 10) ? xPos[spaced].left : xPos[spaced].right ) // set the x-axis offset (left or right). Spaced will need to set 80.5 and 306.5 (2mm space)
var y = (j * 72 + (j * tileYSpacing[spaced])) + pageTopMargin[spaced] // set the y axis, 22.5 is the page top margin. Spaced will need to reduce this by 10mm then add 2mm to each

const offset = Printer.measureText(title.recordID, title.font, title.idSize)

const offset = Printer.measureText(title.recordID, title.fontName, title.idSize)
recordIDs.push({
text: title.recordID,
font: title.font,
Expand Down Expand Up @@ -464,13 +463,12 @@ let Printer = {
}
},

measureText(str, font, fontSize) {
console.log(Math.ceil(font) + 'px ' + fontSize)
measureText(str, fontName, fontSize) {
let canvas = document.createElement('canvas')
canvas.width = "225"

let context = canvas.getContext('2d')
context.font = Math.ceil(fontSize) + 'px ' + font
context.font = Math.ceil(fontSize) + 'px ' + fontName
context.textBaseline = 'middle'

return context.measureText(str).width
Expand Down Expand Up @@ -580,6 +578,7 @@ let Printer = {

//add font details
formattedTitle.font = font.font
formattedTitle.fontName = font.name
formattedTitle.titleSize = font.titleSize
formattedTitle.artistSize = font.artistSize
formattedTitle.idSize = font.idSize
Expand Down

0 comments on commit 5830916

Please sign in to comment.