Skip to content

Commit

Permalink
fix: fix unicode issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 8, 2024
1 parent 877becb commit 1689176
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 81 deletions.
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<style>
@font-face {
font-family: 'pinyinstep';
src: url('./pinyin-step.ttf?v=1.9.1') format('truetype');
src: url('./pinyin-step.ttf?v=1.10.0') format('truetype');
}
@font-face {
font-family: 'pinyin';
src: url('./pinyin-regular.ttf?v=1.9.1') format('truetype');
src: url('./pinyin-regular.ttf?v=1.10.0') format('truetype');
}
@font-face {
font-family: 'pinyin-wenkai-light';
src: url('./pinyin-wenkai-light.ttf?v=1.9.1') format('truetype');
src: url('./pinyin-wenkai-light.ttf?v=1.10.0') format('truetype');
}
body { background-color: #000; color: #fff; }
body, header p { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; }
Expand Down Expand Up @@ -86,7 +86,7 @@
</a>
<main>
<header>
<h1>宝宝字帖<ruby>拼音字体<rt>Pinyin Font</rt></ruby><sup>v1.9.1</sup></h1>
<h1>宝宝字帖<ruby>拼音字体<rt>Pinyin Font</rt></ruby><sup>v1.10.0</sup></h1>
<p>专门为应用《<a href="https://github.com/jaywcjlove/copybook-generator" target="_blank" title="宝宝字帖 for macOS">宝宝字帖</a>》制作的拼音字体</p>
<a class="download" href="https://github.com/jaywcjlove/pinyin-font/releases" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-file-earmark-font-fill" viewBox="0 0 16 16" height="1em" width="1em"><path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0zM9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1zM5.057 6h5.886L11 8h-.5c-.18-1.096-.356-1.192-1.694-1.235l-.298-.01v5.09c0 .47.1.582.903.655v.5H6.59v-.5c.799-.073.898-.184.898-.654V6.755l-.293.01C5.856 6.808 5.68 6.905 5.5 8H5l.057-2z"></path> </svg>
Expand Down
50 changes: 25 additions & 25 deletions docs/pinyin-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/pinyin-regular.ttf
Binary file not shown.
Binary file modified docs/pinyin-regular.woff2
Binary file not shown.
50 changes: 25 additions & 25 deletions docs/pinyin-step.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/pinyin-step.ttf
Binary file not shown.
Binary file modified docs/pinyin-step.woff2
Binary file not shown.
50 changes: 25 additions & 25 deletions docs/pinyin-wenkai-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/pinyin-wenkai-light.ttf
Binary file not shown.
Binary file modified docs/pinyin-wenkai-light.woff2
Binary file not shown.
5 changes: 3 additions & 2 deletions scripts/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ function writeFontStream(svgPath, fontStream) {
let unicodeName = fileNmae;
if (unicodeName.endsWith('_')) {
unicodeName = unicodeName.replace(/_$/g, '').normalize('NFC');
}
if (symbol[unicodeName]) {
} else if (symbol[unicodeName]) {
unicodeName = symbol[unicodeName];
} else {
unicodeName = unicodeName.normalize('NFC');
}
const glyph = fs.createReadStream(svgPath);
//console.log(`\n ┌┈▶ ${fileNmae} ${unicode}`);
Expand Down

0 comments on commit 1689176

Please sign in to comment.