Skip to content

Commit

Permalink
fix: fix wrong character matching, change cdn
Browse files Browse the repository at this point in the history
  • Loading branch information
Honoka55 committed Feb 27, 2024
1 parent 437b3d8 commit e7d9f7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1>
<input type="range" id="slider" min="0" max="0" step="1" value="0" disabled>
</div>
<div id="canvas-container"></div>
<script src="https://cdn.jsdelivr.net/npm/opentype.js"></script>
<script src="https://opentype.js.org/dist/opentype.min.js"></script>
<script src="script.js"></script>
</body>

Expand Down
2 changes: 1 addition & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ window.onload = () => {
for (let [i, char] of [...text3].entries()) {
if (i == 0) {
let newChar = String.fromCharCode(char.charCodeAt(0) + 0xb000);
if (kanaFont.charToGlyph(newChar).unicode && text2.length < 3) {
if (char.charCodeAt(0) + 0xb000 >= 0xe000 && char.charCodeAt(0) + 0xb000 <= 0xf8ff && kanaFont.charToGlyph(newChar).unicode && text2.length < 3) {
char = newChar;
} else {
textX -= 16;
Expand Down

0 comments on commit e7d9f7f

Please sign in to comment.