Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我的私人定制字體的腳本及生成的字體文件 #15

Open
creatxrgithub opened this issue Nov 21, 2019 · 16 comments
Open

我的私人定制字體的腳本及生成的字體文件 #15

creatxrgithub opened this issue Nov 21, 2019 · 16 comments

Comments

@creatxrgithub
Copy link

使用腳本需安裝 node.js

fontCustomize.js.zip
I.MingCREATXR.ttf.zip

/**

  • 想要一個縮放 SVG PATH 後仍然可以保持字體綫寬(卽達到 non-scaling-stroke 的效果)的函數。
  • 該函數的輸入卽 SVG PATH 的字串或數組。
  • 曾向 svgpath 的作者提出過請求。不知是不是我沒表達清楚還是什麼。他回復說不在 svgpath 項目的範圍內。
  • 不知可有仁人幫忙?謝謝
    */
@creatxrgithub
Copy link
Author

生成 SVG 文件後,使用 FontForge 生成字體。

@creatxrgithub
Copy link
Author

fontCustomize_writestream.js.zip

我把有大量頻繁寫入的部份改用流寫入,避免文件管理器剛好開在寫入的文件所在的目錄,造成類似死機狀態。

@creatxrgithub
Copy link
Author

mt_images-article_variablefonts_glyphanimation_v2

我找到了一張圖,可以表達我的目的。

@creatxrgithub
Copy link
Author

我希望改變字體綫寬的同時,保持字體的大小。這就能做到,我希望縮放字體,同時保持字體綫寬。

@creatxrgithub
Copy link
Author

creatxrgithub commented Jan 5, 2020

fontCustomize_writestream.js.zip

限制字形總數小於 65535

生成的文件

I.MingCREATXR_611_fontforge.ttf.zip

還是得自行轉換(添加在腳本中)

◯☯⚊⚋⚌⚍⚎⚏☰☱☲☳☴☵☶☷䷀䷁䷂䷃䷄䷅䷆䷇䷈䷉䷊䷋䷌䷍䷎䷏䷐䷑䷒䷓䷔䷕䷖䷗䷘䷙䷚䷛䷜䷝䷞䷟䷠䷡䷢䷣䷤䷥䷦䷧䷨䷩䷪䷫䷬䷭䷮䷯䷰䷱䷲䷳䷴䷵䷶䷷䷸䷹䷺䷻䷼䷽䷾䷿𝌀𝌁𝌂𝌃𝌄𝌅𝌆𝌇𝌈𝌉𝌊𝌋𝌌𝌍𝌎𝌏𝌐𝌑𝌒𝌓𝌔𝌕𝌖𝌗𝌘𝌙𝌚𝌛𝌜𝌝𝌞𝌟𝌠𝌡𝌢𝌣𝌤𝌥𝌦𝌧𝌨𝌩𝌪𝌫𝌬𝌭𝌮𝌯𝌰𝌱𝌲𝌳𝌴𝌵𝌶𝌷𝌸𝌹𝌺𝌻𝌼𝌽𝌾𝌿𝍀𝍁𝍂𝍃𝍄𝍅𝍆𝍇𝍈𝍉𝍊𝍋𝍌𝍍𝍎𝍏𝍐𝍑𝍒𝍓𝍔𝍕𝍖○ㄨ

從生成的文件看,這些符號可能默認不在 I.MingCP 6.11 中 (因爲是添加在末尾,而不是替換)

否則,在卜易書中的六爻就對不齊了

父母巳火⚊  官鬼寅木⚊
兄弟未土⚋  妻財子水⚋
子孫酉金○世 兄弟戌土⚋
兄弟丑土ㄨ  子孫酉金⚊
官鬼卯木⚊  妻財亥水⚊
父母巳火○應 兄弟丑土⚋

@birchmoonlight
Copy link

你应该是想自动生成黑体的骨架,如果我没理解错的话

@creatxrgithub
Copy link
Author

你应该是想自动生成黑体的骨架,如果我没理解错的话

以小篆爲例,我想通過輸入範式,如「<(?水工)」,通過讀取「水」「工」的 outline 畫出「江」字,。但經過縮放後「水」「工」的綫寬就變了,所以希望能有一種方法可以保持綫寬。也許可變字體可以指定綫寬,以後試試。

這個是意圖:https://github.com/creatxrgithub/chinese_construct_expression

@birchmoonlight
Copy link

可以用轮廓生成骨架,有用于通用的图像的,不知有没有人试过用在字体上,你可以试一试,但首先必须拆分字的笔画

@birchmoonlight
Copy link

有了骨架再描边,调整大小时只调整骨架,描边在骨架调整完成后再再次生成

@creatxrgithub
Copy link
Author

沒找到算法

@birchmoonlight
Copy link

https://www.zcool.com.cn/work/ZNjE2NTkzNDg=.html 偏后部分有

@birchmoonlight
Copy link

@creatxrgithub
Copy link
Author

有了骨架再描边,调整大小时只调整骨架,描边在骨架调整完成后再再次生成

忽然想起,早期也曾給文泉驛描過一點漢字骨架,你可以去聯系一下他們有沒有保留。

@birchmoonlight
Copy link

手动描的吗

@creatxrgithub
Copy link
Author

creatxrgithub commented Jan 7, 2023

手动描的吗

是。用鼠標一個個描骨架。他們提供的客戶端,描了骨架直接提交。

@creatxrgithub
Copy link
Author

你倒是提醒了我。不知沒有可能做到象描人像那樣的程度(參照 makehuman)。用骨架隨意生成隸楷宋體。當然,篆體不可能,筆畫骨架不一樣。

就我的需求,有個能在放縮後保持綫寬就能達到目的。可變字體應該就可以了吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants