Skip to content

Commit

Permalink
feat: add ×,÷,$,|,\,/
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 8, 2024
1 parent c1863ca commit e0d0d5f
Show file tree
Hide file tree
Showing 16 changed files with 109 additions and 86 deletions.
11 changes: 7 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.0') format('truetype');
src: url('./pinyin-step.ttf?v=1.9.1') format('truetype');
}
@font-face {
font-family: 'pinyin';
src: url('./pinyin-regular.ttf?v=1.9.0') format('truetype');
src: url('./pinyin-regular.ttf?v=1.9.1') format('truetype');
}
@font-face {
font-family: 'pinyin-wenkai-light';
src: url('./pinyin-wenkai-light.ttf?v=1.9.0') format('truetype');
src: url('./pinyin-wenkai-light.ttf?v=1.9.1') 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.0</sup></h1>
<h1>宝宝字帖<ruby>拼音字体<rt>Pinyin Font</rt></ruby><sup>v1.9.1</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 Expand Up @@ -147,6 +147,9 @@ <h2><ruby>拼<rt>Pīn</rt>音<rt>yīn</rt>文<rt>wén</rt>楷<rt>kǎi</rt>细<rt
<p class="wenkai-light">
01234 56789
</p>
<p class="wenkai-light">
×÷-+/|\!@#<br/>$%^&*()_+{}[]:";'<>?,.
</p>
</main>
<footer class="footer">
Made by<a href="https://jaywcjlove.github.io/#/sponsor" target="_blank"> 小弟调调™ </a>with<span class="heart"></span></span>
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.
64 changes: 38 additions & 26 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.
14 changes: 9 additions & 5 deletions scripts/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,14 @@ const symbol = {
rightParenthesis: ")", // 右小括号
leftBracket: "[", // 左中括号
rightBracket: "]", // 右中括号
hyphen: "-", // 连字符
hyphen: "-", // 连字符 - 减号
underscore: "_", // 下划线
plus: "+", // 加号
multiply: "\u00D7", // 乘号 ×
divide: "\u00F7", // 除号 ÷
ampersand: "&", // 与
atSign: "@", // @
dollarSign: "$", // 美元符号

numberSign: "#", // 井号
percentSign: "%",
Expand All @@ -68,22 +71,23 @@ const symbol = {
tilde: "~",
lessThanSign: "<",
greaterThanSign: ">",
verticalBarOrPipe: "|",
backslash: "\\",
verticalBarOrPipe: "|", // 竖线
backslash: "\\", // 反斜杠
slash: "/", // 斜杠
};

function writeFontStream(svgPath, fontStream) {
const fileNmae = path.basename(svgPath, ".svg");
let unicodeName = fileNmae;
if (unicodeName.endsWith('_')) {
unicodeName = unicodeName.replace(/_$/g, '');
unicodeName = unicodeName.replace(/_$/g, '').normalize('NFC');
}
if (symbol[unicodeName]) {
unicodeName = symbol[unicodeName];
}
const glyph = fs.createReadStream(svgPath);
//console.log(`\n ┌┈▶ ${fileNmae} ${unicode}`);
glyph.metadata = { unicode: [unicodeName.normalize('NFC')] , name: fileNmae.replace(/_$/g, '') };
glyph.metadata = { unicode: [unicodeName] , name: fileNmae.replace(/_$/g, '') };
fontStream.write(glyph);
}

Expand Down
1 change: 1 addition & 0 deletions svg/wenkai-light/divide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions svg/wenkai-light/dollarSign.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions svg/wenkai-light/multiply.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions svg/wenkai-light/slash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion svg/wenkai-light/verticalBarOrPipe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e0d0d5f

Please sign in to comment.