mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 07:21:50 +08:00
Merge pull request #76 from LoveEevee/assets-update-font
Assets: Update font
This commit is contained in:
commit
3de0f4b741
@ -53,10 +53,12 @@
|
|||||||
degree: /[゚°]/,
|
degree: /[゚°]/,
|
||||||
brackets: /[\((\))「」『』]/,
|
brackets: /[\((\))「」『』]/,
|
||||||
tilde: /[\--~~〜]/,
|
tilde: /[\--~~〜]/,
|
||||||
tall: /[bbddffh-lh-ltt0-90-9♪]/,
|
tall: /[bbddffgghhj-lj-ltt♪]/,
|
||||||
|
i: /[ii]/,
|
||||||
uppercase: /[A-ZA-Z]/,
|
uppercase: /[A-ZA-Z]/,
|
||||||
lowercase: /[a-za-z・]/,
|
lowercase: /[a-za-z・]/,
|
||||||
latin: /[A-ZA-Za-za-z・]/,
|
latin: /[A-ZA-Za-za-z・]/,
|
||||||
|
numbers: /[0-90-9]/,
|
||||||
exclamation: /[!!\?? ]/,
|
exclamation: /[!!\?? ]/,
|
||||||
question: /[\??]/,
|
question: /[\??]/,
|
||||||
smallHiragana: /[ぁぃぅぇぉっゃゅょァィゥェォッャュョ]/,
|
smallHiragana: /[ぁぃぅぇぉっゃゅょァィゥェォッャュョ]/,
|
||||||
@ -70,6 +72,14 @@
|
|||||||
uppercaseDigit: /[A-ZA-Z0-90-9]/
|
uppercaseDigit: /[A-ZA-Z0-90-9]/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var numbersFull = "0123456789"
|
||||||
|
var numbersHalf = "0123456789"
|
||||||
|
this.numbersFullToHalf = {}
|
||||||
|
for(var i = 0; i < 10; i++){
|
||||||
|
this.numbersFullToHalf[numbersFull[i]] = numbersHalf[i]
|
||||||
|
this.numbersFullToHalf[numbersHalf[i]] = numbersHalf[i]
|
||||||
|
}
|
||||||
|
|
||||||
this.songFrameCache = new CanvasCache()
|
this.songFrameCache = new CanvasCache()
|
||||||
this.diffStarCache = new CanvasCache()
|
this.diffStarCache = new CanvasCache()
|
||||||
this.crownCache = new CanvasCache()
|
this.crownCache = new CanvasCache()
|
||||||
@ -283,7 +293,9 @@
|
|||||||
// Long-vowel mark
|
// Long-vowel mark
|
||||||
drawn.push({realText: symbol, svg: this.longVowelMark, x: -4, y: 5, h: 33, scale: [mul, mul]})
|
drawn.push({realText: symbol, svg: this.longVowelMark, x: -4, y: 5, h: 33, scale: [mul, mul]})
|
||||||
}else if(symbol === "∀"){
|
}else if(symbol === "∀"){
|
||||||
drawn.push({text: symbol, x: 0, y: 3, h: 39, rotate: true})
|
drawn.push({text: symbol, x: 0, y: 0, h: 39, rotate: true})
|
||||||
|
}else if(symbol === "↓"){
|
||||||
|
drawn.push({text: symbol, x: 0, y: 12, h: 45})
|
||||||
}else if(r.comma.test(symbol)){
|
}else if(r.comma.test(symbol)){
|
||||||
// Comma, full stop
|
// Comma, full stop
|
||||||
drawn.push({text: symbol, x: 13, y: -9, h: 13, scale: [1.2, 0.7]})
|
drawn.push({text: symbol, x: 13, y: -9, h: 13, scale: [1.2, 0.7]})
|
||||||
@ -303,14 +315,21 @@
|
|||||||
// Rotated hyphen, tilde
|
// Rotated hyphen, tilde
|
||||||
drawn.push({realText: symbol, text: symbol === "~" ? "~" : symbol, x: 0, y: 2, h: 35, rotate: true})
|
drawn.push({realText: symbol, text: symbol === "~" ? "~" : symbol, x: 0, y: 2, h: 35, rotate: true})
|
||||||
}else if(r.tall.test(symbol)){
|
}else if(r.tall.test(symbol)){
|
||||||
// Tall latin script lowercase, numbers
|
// Tall latin script lowercase
|
||||||
drawn.push({text: symbol, x: 0, y: 4, h: 34, scale: [1.05, 0.9]})
|
drawn.push({text: symbol, x: 0, y: 4, h: 34})
|
||||||
|
}else if(r.i.test(symbol)){
|
||||||
|
// Lowercase i
|
||||||
|
drawn.push({text: symbol, x: 0, y: 7, h: 34})
|
||||||
}else if(r.uppercase.test(symbol)){
|
}else if(r.uppercase.test(symbol)){
|
||||||
// Latin script upper case
|
// Latin script upper case
|
||||||
drawn.push({text: symbol, x: 0, y: 8, h: 37})
|
drawn.push({text: symbol, x: 0, y: 8, h: 37})
|
||||||
}else if(r.lowercase.test(symbol)){
|
}else if(r.lowercase.test(symbol)){
|
||||||
// Latin script lower case
|
// Latin script lower case
|
||||||
drawn.push({text: symbol, x: 0, y: -1, h: 28, scale: [1.05, 0.9]})
|
drawn.push({text: symbol, x: 0, y: -1, h: 28})
|
||||||
|
}else if(r.numbers.test(symbol)){
|
||||||
|
// Numbers
|
||||||
|
var number = this.numbersFullToHalf[symbol]
|
||||||
|
drawn.push({realText: symbol, text: number, x: 0, y: 4, h: 34})
|
||||||
}else if(r.exclamation.test(symbol)){
|
}else if(r.exclamation.test(symbol)){
|
||||||
// Exclamation mark
|
// Exclamation mark
|
||||||
var toDraw = [symbol]
|
var toDraw = [symbol]
|
||||||
@ -342,14 +361,11 @@
|
|||||||
text: text,
|
text: text,
|
||||||
x: ((j - 1) - (repeat - 1) / 2) * 15,
|
x: ((j - 1) - (repeat - 1) / 2) * 15,
|
||||||
y: y - (j === 1 ? 0 : h),
|
y: y - (j === 1 ? 0 : h),
|
||||||
h: j === 1 ? h : 0,
|
h: j === 1 ? h : 0
|
||||||
scale: r.question.test(text) ? [0.6, 0.95] : false
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
drawn.push({text: symbol, x: 0, y: 8, h: 37,
|
drawn.push({text: symbol, x: 0, y: 8, h: 37})
|
||||||
scale: r.question.test(symbol) ? [0.7, 0.95] : false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}else if(r.smallHiragana.test(symbol)){
|
}else if(r.smallHiragana.test(symbol)){
|
||||||
// Small hiragana, small katakana
|
// Small hiragana, small katakana
|
||||||
@ -359,7 +375,7 @@
|
|||||||
drawn.push({text: symbol, x: 0, y: 5, h: 38, right: r.todo.test(symbol)})
|
drawn.push({text: symbol, x: 0, y: 5, h: 38, right: r.todo.test(symbol)})
|
||||||
}else{
|
}else{
|
||||||
// Kanji, other
|
// Kanji, other
|
||||||
drawn.push({text: symbol, x: 0, y: 3, h: 39, right: true})
|
drawn.push({text: symbol, x: 0, y: 3, h: 39})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -523,33 +539,36 @@
|
|||||||
let symbol = string[i]
|
let symbol = string[i]
|
||||||
|
|
||||||
if(symbol === "-"){
|
if(symbol === "-"){
|
||||||
drawn.push({text: symbol, x: -4, y: 0, w: 28, scale: [0.8, 1]})
|
drawn.push({text: symbol, x: -2, y: 0, w: 28, scale: [0.8, 1]})
|
||||||
}else if(symbol === "™"){
|
}else if(symbol === "™"){
|
||||||
drawn.push({text: symbol, x: -2, y: 0, w: 20, scale: [0.6, 0.5]})
|
drawn.push({text: symbol, x: -2, y: 0, w: 20, scale: [0.6, 0.5]})
|
||||||
}else if(symbol === " "){
|
}else if(symbol === " "){
|
||||||
drawn.push({text: symbol, x: 0, y: 0, w: 10})
|
drawn.push({text: symbol, x: 0, y: 0, w: 10})
|
||||||
}else if(symbol === "'"){
|
}else if(symbol === "'"){
|
||||||
drawn.push({text: ",", x: 0, y: -15, w: 7, scale: [1, 0.7]})
|
drawn.push({text: ",", x: 0, y: -15, w: 7, scale: [1, 0.7]})
|
||||||
}else if(symbol === "?"){
|
}else if(symbol === "∀"){
|
||||||
drawn.push({text: symbol, x: 0, y: -1, w: 12, scale: [0.7, 0.95]})
|
drawn.push({text: symbol, x: -3, y: 0, w: 55})
|
||||||
}else if(r.en.test(symbol)){
|
}else if(r.en.test(symbol)){
|
||||||
// n-width
|
// n-width
|
||||||
drawn.push({text: symbol, x: 0, y: 0, w: 28, scale: [1, 0.95]})
|
drawn.push({text: symbol, x: 0, y: 0, w: 28})
|
||||||
}else if(r.em.test(symbol)){
|
}else if(r.em.test(symbol)){
|
||||||
// m-width
|
// m-width
|
||||||
drawn.push({text: symbol, x: 0, y: 0, w: 38, scale: [1, 0.95]})
|
drawn.push({text: symbol, x: 0, y: 0, w: 38})
|
||||||
}else if(r.rWidth.test(symbol)){
|
}else if(r.rWidth.test(symbol)){
|
||||||
// r-width
|
// r-width
|
||||||
drawn.push({text: symbol, x: 0, y: 0, w: 24, scale: [1, 0.95]})
|
drawn.push({text: symbol, x: 0, y: 0, w: 24})
|
||||||
}else if(r.lWidth.test(symbol)){
|
}else if(r.lWidth.test(symbol)){
|
||||||
// l-width
|
// l-width
|
||||||
drawn.push({text: symbol, x: 0, y: -1, w: 12, scale: [1, 0.95]})
|
drawn.push({text: symbol, x: 0, y: 0, w: 12})
|
||||||
}else if(r.emCap.test(symbol)){
|
}else if(r.emCap.test(symbol)){
|
||||||
// m-width uppercase
|
// m-width uppercase
|
||||||
drawn.push({text: symbol, x: 0, y: -2, w: 38})
|
drawn.push({text: symbol, x: 0, y: 0, w: 38})
|
||||||
|
}else if(r.degree.test(symbol)){
|
||||||
|
// Degree
|
||||||
|
drawn.push({text: symbol, x: 5, y: 0, w: 0})
|
||||||
}else if(r.uppercaseDigit.test(symbol)){
|
}else if(r.uppercaseDigit.test(symbol)){
|
||||||
// Latin script uppercase, digits
|
// Latin script uppercase, digits
|
||||||
drawn.push({text: symbol, x: 0, y: -2, w: 32})
|
drawn.push({text: symbol, x: 0, y: 0, w: 32})
|
||||||
}else if(r.exclamation.test(symbol)){
|
}else if(r.exclamation.test(symbol)){
|
||||||
// Exclamation mark
|
// Exclamation mark
|
||||||
var nextExclamation = string[i + 1] ? r.exclamation.test(string[i + 1]) : false
|
var nextExclamation = string[i + 1] ? r.exclamation.test(string[i + 1]) : false
|
||||||
@ -557,8 +576,7 @@
|
|||||||
text: symbol,
|
text: symbol,
|
||||||
x: nextExclamation ? 4 : -1,
|
x: nextExclamation ? 4 : -1,
|
||||||
y: 0,
|
y: 0,
|
||||||
w: nextExclamation ? 16 : 28,
|
w: nextExclamation ? 16 : 28
|
||||||
scale: symbol === "?" ? [0.7, 0.95] : false
|
|
||||||
})
|
})
|
||||||
}else if(r.smallHiragana.test(symbol)){
|
}else if(r.smallHiragana.test(symbol)){
|
||||||
// Small hiragana, small katakana
|
// Small hiragana, small katakana
|
||||||
@ -713,7 +731,7 @@
|
|||||||
var drawLine = y => {
|
var drawLine = y => {
|
||||||
ctx.beginPath()
|
ctx.beginPath()
|
||||||
ctx.moveTo(12, y)
|
ctx.moveTo(12, y)
|
||||||
ctx.arc(20.5, 25, 8.5, Math.PI, Math.PI * 2, true)
|
ctx.arc(20.5, 24, 8.5, Math.PI, Math.PI * 2, true)
|
||||||
ctx.lineTo(29, 18)
|
ctx.lineTo(29, 18)
|
||||||
ctx.stroke()
|
ctx.stroke()
|
||||||
}
|
}
|
||||||
@ -728,9 +746,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.strokeStyle = "#000"
|
ctx.strokeStyle = "#000"
|
||||||
ctx.lineWidth = 12
|
ctx.lineWidth = 13
|
||||||
drawLine(9)
|
drawLine(8)
|
||||||
ctx.lineWidth = 5
|
ctx.lineWidth = 6
|
||||||
drawTriangle(true)
|
drawTriangle(true)
|
||||||
ctx.stroke()
|
ctx.stroke()
|
||||||
ctx.lineWidth = 7
|
ctx.lineWidth = 7
|
||||||
|
Loading…
Reference in New Issue
Block a user