From ae1a39718f9037c1359ac54063c743f1cd96662f Mon Sep 17 00:00:00 2001 From: David Chanin Date: Sat, 3 Feb 2018 22:49:18 +0800 Subject: [PATCH] Adding initial files --- .gitmodules | 3 ++ .npmignore | 3 ++ APL/big5/ARPHICPL.TXT | 58 ++++++++++++++++++++++ APL/english/ARPHICPL.TXT | 58 ++++++++++++++++++++++ APL/gb/ARPHICPL.TXT | 58 ++++++++++++++++++++++ APL/zh_CN.UTF-8/ARPHICPL.TXT | 58 ++++++++++++++++++++++ APL/zh_TW.UTF-8/ARPHICPL.TXT | 58 ++++++++++++++++++++++ LICENSE | 58 ++++++++++++++++++++++ index.js | 1 + package.json | 9 ++++ stroke_data_parser.py | 94 ++++++++++++++++++++++++++++++++++++ vendor/makemeahanzi | 1 + 12 files changed, 459 insertions(+) create mode 100644 .gitmodules create mode 100644 .npmignore create mode 100644 APL/big5/ARPHICPL.TXT create mode 100644 APL/english/ARPHICPL.TXT create mode 100644 APL/gb/ARPHICPL.TXT create mode 100644 APL/zh_CN.UTF-8/ARPHICPL.TXT create mode 100644 APL/zh_TW.UTF-8/ARPHICPL.TXT create mode 100644 LICENSE create mode 100644 index.js create mode 100644 package.json create mode 100644 stroke_data_parser.py create mode 160000 vendor/makemeahanzi diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..7755ca2d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/makemeahanzi"] + path = vendor/makemeahanzi + url = https://github.com/chanind/makemeahanzi.git diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..95d4e701 --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +all.json +stroke_data_parser.py +vendor/ diff --git a/APL/big5/ARPHICPL.TXT b/APL/big5/ARPHICPL.TXT new file mode 100644 index 00000000..4aabc9af --- /dev/null +++ b/APL/big5/ARPHICPL.TXT @@ -0,0 +1,58 @@ +文鼎公眾授權書 + +著作權所有(C) 1999 文鼎科技開發股份有限公司 +台灣110台北市永吉路168號11樓 +除非以下規定,保留所有權利。 + +任何人均可重製及散布本授權書原始文件之複本,但禁止修改之。 + +前言 + +  大多數軟體之授權書係用來剝奪您共享和修改軟體之自由。相形之下,如果您將我們所授與您的一切權利授與您的接受者,並且確保他們能得到本軟體之修改物,文鼎公眾授權書特別許可並鼓勵您使用本軟體。 + +法律性條款 + +0. 定義 +  本授權書中,「字型」係指「文鼎PL細上海宋」、「文鼎PL中楷」(BIG-5碼)和「文鼎PL簡報宋」、「文鼎PL簡中楷」(GB碼)等TrueType字型,以及經修改而產生之該等字型的衍生物,包括修改字型樣式、更動編碼順序、轉換格式、變更字型名稱,或者在glyph table中增減一些文字。 + +  「PL」係指「Public License」(公眾授權)。 + +  「著作權人」係指在字型著作權聲明中被稱為著作權者之人。 + +  「您」係指被授權者或重製、再散布、修改字型之人。 + +  「自由使用」係指您在所接受之相同條件下,有重製、修改字型及散布字型複本之自由,而非指價格。如果您願意,可以對此項服務收取費用。 + +1. 重製及散布 +  如果在所有複本維持本授權書檔案(ARPHICPL.TXT)不變,您可以任何媒體無限制重製及散布本字型之複本。 + +2. 修改 +  如果滿足以下條件,您可以任何方式修改本字型之複本,包括修改字型樣式、更動編碼順序、轉換格式、變更字型名稱,或者在glyph table中增減一些文字,並且依據上述第一條之規定重製及散布該修改物。 + + a)您必須在每個修改過的檔案中插入明顯的聲明,表示您如何及何時修改了該檔案。 + + b)您必須允許所有第三人在本授權書條款下,得以「自由使用」該修改物之全部,例如透過指定地點重製路徑的提供,或在通常作為軟體交換的媒體上散布該修改物。 + + c)如果修改過之字型在執行時以交談方式讀取命令,您必須使它在開始進入一般之交談使用方式時列印或顯示聲明,包括適當的著作權聲明、無擔保聲明(或者其他您提供擔保的聲明),以及使用者可以依據這些條件再散布本字型的聲明,並且告知使用者如何看到本授權書之複本。 + +  這些要求適用於整個修改過之著作。如果著作的可辨識部分並非衍生自本字型,且可以合理地認其為獨立而個別之著作,則當您將它當作個別著作散布時,本授權書及其條款將不適用於該部分。因此,僅將非基於本字型之其他著作和本字型一起放入貯存或散布媒體的同一卷上,並不會使該其他著作納入本授權書的適用範圍。 + +3. 解除條件 +  除非依照本授權書之明示規定,否則您不能重製、修改、再授權或散布本字型。任何用其他方式重製、修改、再授權或散布本字型之意圖,將使本授權書所授與您之權利自動溯及地失效。不過從您那依據本授權書取得複本和權利的人,只要他們完全遵行條款,其權利將維持有效。 + +4. 同意 +  因您未簽訂本授權書,所以沒必要遵行之。然而,沒有任何其他文件授與您重製、修改、再授權或散布本字型之權利,如果您不同意本授權書,這些行為是法律所禁止的。因此一旦重製、修改、再授權或散布本字型,就表示您接受本授權書及其一切條款和條件。 + +5. 自動取得授權 +  每當您再散布本字型時,收受者便自動從原始授權者處取得依據這些條款和條件重製、散布或修改本字型之授權。您不可對在此所授與收受者之權利實行強加其他限制,您也沒有使第三人遵行本授權書的義務。 + +6. 抵觸 +  若因法院判決、違反專利宣稱或任何其他原因(不限於專利糾紛)的結果,使強加於您之條件(不論是法院命令、協議或其他)和授權書之條件有所衝突時,也不能讓您違背授權書之條件。如果您不能同時滿足本授權書所定之義務及其他相關義務來散布時,那麼您根本不可散布本字型。例如,如果專利授權不許所有直接或間接從您那裡取得複本者,在免授權費的情況下再散布本字型時,唯一能同時滿足雙方要求的方法是完全避免散布本字型。 + +  如果本條款之任何部分在特定情況下無效或無法實施,條款之其他部分將繼續適用,並作為整體適用於其他情況。 + +7. 無擔保 +  由於本字型係免費授權,在準據法允許之範圍內,本字型將不附帶任何擔保。除非另有書面說明,著作權人或其他提供本字型者「同樣」不提供任何種類之擔保,不論係明示還是暗示,包括但不限於銷售性和適於特定目的之暗示擔保。有關本字型品質和執行之一切危險均由您承擔。如果本字型出現瑕疵,您應承擔一切所需服務、修復和改正的費用。 + +8. 損害賠償請求權之放棄 +  除非準據法規定或以書面同意,在任何情況下,任何著作權人或以上被允許得以重製、修改或再散布本字型者,均不對您因使用或不能使用本字型(包括但不限於替代商品或服務之採購;使用、數據或利益之損失;或者營業妨礙)所引致之任何直接、間接、必然、偶然、特殊或懲罰性損失負責,即使著作權人或其他人已知該損失之可能性時亦不例外。 diff --git a/APL/english/ARPHICPL.TXT b/APL/english/ARPHICPL.TXT new file mode 100644 index 00000000..c1aba41d --- /dev/null +++ b/APL/english/ARPHICPL.TXT @@ -0,0 +1,58 @@ +ARPHIC PUBLIC LICENSE + +Copyright (C) 1999 Arphic Technology Co., Ltd. +11Fl. No.168, Yung Chi Rd., Taipei, 110 Taiwan +All rights reserved except as specified below. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is forbidden. + +Preamble + + The licenses for most software are designed to take away your freedom to share and change it. By contrast, the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this software, provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software. + +Legal Terms + +0. Definitions: + Throughout this License, "Font" means the TrueType fonts "AR PL Mingti2L Big5", "AR PL KaitiM Big5" (BIG-5 character set) and "AR PL SungtiL GB", "AR PL KaitiM GB" (GB character set) which are originally distributed by Arphic, and the derivatives of those fonts created through any modification including modifying glyph, reordering glyph, converting format, changing font name, or adding/deleting some characters in/from glyph table. + + "PL" means "Public License". + + "Copyright Holder" means whoever is named in the copyright or copyrights for the Font. + + "You" means the licensee, or person copying, redistributing or modifying the Font. + + "Freely Available" means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you received, not price. If you wish, you can charge for this service. + +1. Copying & Distribution + You may copy and distribute verbatim copies of this Font in any medium, without restriction, provided that you retain this license file (ARPHICPL.TXT) unaltered in all copies. + +2. Modification + You may otherwise modify your copy of this Font in any way, including modifying glyph, reordering glyph, converting format, changing font name, or adding/deleting some characters in/from glyph table, and copy and distribute such modifications under the terms of Section 1 above, provided that the following conditions are met: + + a) You must insert a prominent notice in each modified file stating how and when you changed that file. + + b) You must make such modifications Freely Available as a whole to all third parties under the terms of this License, such as by offering access to copy the modifications from a designated place, or distributing the modifications on a medium customarily used for software interchange. + + c) If the modified fonts normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the Font under these conditions, and telling the user how to view a copy of this License. + + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Font, and can be reasonably considered independent and separate works in themselves, then this License and its terms, do not apply to those sections when you distribute them as separate works. Therefore, mere aggregation of another work not based on the Font with the Font on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. Condition Subsequent + You may not copy, modify, sublicense, or distribute the Font except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Font will automatically retroactively void your rights under this License. However, parties who have received copies or rights from you under this License will keep their licenses valid so long as such parties remain in full compliance. + +4. Acceptance + You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to copy, modify, sublicense or distribute the Font. These actions are prohibited by law if you do not accept this License. Therefore, by copying, modifying, sublicensing or distributing the Font, you indicate your acceptance of this License and all its terms and conditions. + +5. Automatic Receipt + Each time you redistribute the Font, the recipient automatically receives a license from the original licensor to copy, distribute or modify the Font subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +6. Contradiction + If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Font at all. For example, if a patent license would not permit royalty-free redistribution of the Font by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Font. + + If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +7. NO WARRANTY + BECAUSE THE FONT IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE FONT, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS OR OTHER PARTIES PROVIDE THE FONT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE FONT IS WITH YOU. SHOULD THE FONT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +8. DAMAGES WAIVER + UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, IN NO EVENT WILL ANY COPYRIGHTT HOLDERS, OR OTHER PARTIES WHO MAY COPY, MODIFY OR REDISTRIBUTE THE FONT AS PERMITTED ABOVE, BE LIABLE TO YOU FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, SPECIAL OR EXEMPLARY DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE FONT (INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERRUPTION), EVEN IF SUCH HOLDERS OR OTHER PARTIES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. diff --git a/APL/gb/ARPHICPL.TXT b/APL/gb/ARPHICPL.TXT new file mode 100644 index 00000000..9cc29e42 --- /dev/null +++ b/APL/gb/ARPHICPL.TXT @@ -0,0 +1,58 @@ +恅隋鼠笲忨京 + +唳佯齾(C) 1999 恅隋褪撮羲楷嘖爺衄癹鼠侗 +怢俜110怢控庈蚗憚繚168瘍11瞼 +壺眕狟寞隅俋ㄛ悵隱垀衄阱﹝ + +庥恛侗钂奿堋棉じ健硊2彊硜京橯倚樁躁腔葩掛ㄛ筍輦砦党蜊眳﹝ + +ヶ晟 + +﹛﹛橈湮嗣杅篲腔忨京樨к藝敦嗤蠟僕砅睿党蜊篲腔赻蚕﹝眈毀ㄛ蝜蠟蔚扂蠅垀忨迵蠟腔珨з阱忨迵蠟腔諉忳氪ㄛ甜й楛坻蠅夔腕善掛篲腔党蜊昜ㄛ恅隋鼠笲忨京樻堭蟨篻价Ⅰ釋躟妏蚚掛篲﹝ + +楊薺俶沭遴 + +0.﹛隅砱 +﹛﹛掛忨京橠苺活詰笢矷嘟н腹裕譯同L牉奻漆冼★﹜☆恅隋PL笢翱★ㄗBIG-5鎢ㄘ睿☆恅隋PL潠惆冼★﹜☆恅隋PL潠笢翱★ㄗGB鎢ㄘ脹TrueType趼倰ㄛ眕摯冪党蜊奧莉汜腔蜆脹趼倰腔栲汜昜ㄛ婦嬤党蜊趼倰欴宒﹜載雄晤鎢佼唗﹜蛌遙跡宒﹜曹載趼倰靡備ㄛ麼氪婓glyph table笢崝熬珨虳恅趼﹝ + +﹛﹛☆PL★岆硌☆Public License★ㄗ鼠笲忨見屆 + +﹛﹛☆唳亞芊嘟н詳稊笢肭磃享驨巘訇輒な狐磃佯齾俷萻旅芊 + +﹛﹛☆蠟★岆硌掩忨佰葳繨棉ヾF棨3慼B瑏儷笢芚饑芊 + +﹛﹛☆赻蚕妏蚚★岆硌蠟婓垀諉忳腔眈肮沭璃狟ㄛ衄葩秶﹜党蜊趼倰摯汃票趼倰葩秶こ腔赻蚕ㄛ奧準硌歎跡﹝蝜蠟堋砩ㄛ褫眕勤森砐督昢彶◎晊獺 + +1.﹛葩秶摯煦楷 +﹛﹛蝜婓垀衄葩秶こ峎厥掛忨京橁躁ㄗARPHICPL.TXTㄘ祥曹ㄛ蠟褫眕婓庥恞諒槸瘐皵ご棉じ健硊2擋笢邳捂棉ぢ楚 + +2.﹛党蜊 +﹛﹛蝜雛逋眕狟沭璃ㄛ蠟褫眕蚚庥庢褊請瑏覺擋笢芚譫棉ぢ楠為嬤党蜊趼倰欴宒﹜載遙晤鎢佼唗﹜蛌遙跡宒﹜曹載趼倰靡備ㄛ麼氪婓glyph table笢崝熬珨虳恅趼ㄛ甜й甡擂奻扴菴珨沭腔寞隅葩秶摯煦楷蜆党蜊昜﹝ + +﹛a)蠟斛剕婓藩跺党蜊徹腔恅璃笢脣踼龢埽馨驨驐炳簆奮蝥弮偕恀教瑏鐘佶襞躁﹝ + +﹛b)蠟斛剕埰勍垀衄菴源婓掛忨京樻龑鎯瞿炸證唌詰娸圴墓獺兢譜瑏鰓齔饑垓縛珊褉邦枑鼎硌隅華萸腔葩秶繚噤ㄛ麼婓籵都釬峈篲蝠遙腔羸极奻楷票蜆党蜊昜﹝ + +﹛c)蝜党蜊徹腔趼倰婓硒俴奀眕蝠抶源宒黍 ̄鍔ㄛ蠟斛剕妏坳婓羲宎輛遻趕蒫躅鉻裘墓繩褊褊探藣◆藲埰導驨驐為嬤巠絞腔唳享驨驉卅瑑ㄠ汒隴ㄗ麼氪む坻蠟枑鼎童悵腔汒隴ㄘㄛ眕摯妏蚚氪褫眕甡擂涴虳沭璃婬煦楷掛趼倰腔汒隴ㄛ甜й豢眭妏蚚氪蝥怷斯蔣彊硜京曀譫敢鴃 + +﹛﹛涴虳猁⑴巠蚚衾淕跺党蜊徹腔釬こ﹝蝜釬こ腔褫望妎窒煦甜準栲汜赻掛趼倰ㄛй褫眕磁燴華玅餂甽擱7籪鰡藒儷鷝楠皈繺採蔚坳絞釬跺梗釬こ煦楷奀ㄛ掛忨京曌副颭龑蹐垓銘弝譚皒簷蕙痋秪森ㄛ躺蔚準價衾掛趼倰眳む坻釬こ睿掛趼倰珨れ溫鄵湔麼煦楷羸极腔肮珨橙奻ㄛ甜祥頗妏蜆む坻釬こ馨貑彊硜京曀騫弝繩僇均 + +3.﹛賤壺沭璃 +﹛﹛壺準甡桽掛忨京曀贏瘨見炤鵋艡祥夔葩秶﹜党蜊﹜婬忨酉繴硊2擋笢矷庥扃蟻頖源宒葩秶﹜党蜊﹜婬忨酉繴硊2擋笢芚黨獌慫狠封僚彊硜京橚鱹祳踽腔阱赻雄囮虴﹝祥徹ㄛ植蠟饒甡擂掛忨京橛△繪棉ぢ滓虯阱腔芄盆閡羋蠅俇度鵓倢龑謑甚靿阱蔚峎厥衄虴﹝ + +4.﹛肮砩 +﹛﹛秪蠟帤ワ隆掛忨京憌畋麤埼跼寋臥鵓倓﹝辣齮珍閨倞庥恇頖恅璃忨迵蠟葩秶﹜党蜊﹜婬忨酉繴硊2擋笢邳旅阱ㄛ蝜蠟祥肮砩掛忨京憌盈瑱房倛羌Й阬夼虌砦腔﹝秪森珨筒葩秶﹜党蜊﹜婬忨酉繴硊2擋笢礿狡舠簆奮諉忳掛忨京曌副馜鉸倢龑蹎迒齞﹝ + +5.﹛赻雄△蟾硜 +﹛﹛藩絞蠟婬汃票掛趼倰奀ㄛ彶忳氪晞赻雄植埻宎忨佰葧牟△證擰楙瑱怫龑蹎迒齞葩秶﹜煦楷麼党蜊掛趼倰腔忨芋蠟祥褫勤婓森垀忨迵彶忳氪眳阱妗俴Ч樓む坻癹秶ㄛ蠟珩羶衄妏菴源郩俴掛忨京曀黨槸鞢 + +6.﹛萋揖 +﹛﹛譣繴侃瘍郋騿卅扑棚阱哫備麼庥恇頖埻秪ㄗ祥癹衾蚳瞳壁煌ㄘ腔賦彆ㄛ妏Ч樓衾蠟腔沭璃ㄗ祥蹦岆楊埏韜鍔﹜衪祜麼む坻ㄘ睿忨京曀騷齞衄垀喳芼奀ㄛ珩祥夔藥峊掖忨京曀騷齞﹝蝜蠟祥夔肮奀雛逋掛忨京橚鬤巡黨槸鬄副頖眈壽砱昢懂煦楷奀ㄛ饒欒蠟跦掛祥褫煦楷掛趼倰﹝瞰蝤畏蝜蚳瞳忨迆鉼篰齾倗掃蚖羆雿荋蚅饒爵△繪棉ぢ煬舝皈矞獃硜邢捄饒橦鼘謹棶硊2擋笢虮悵疥例酸嗐畎授逋邧源猁⑴腔源楊岆俇垮傶漞硊2擋笢矷 + +﹛﹛蝜掛沭遴眳庥帣蕙笪确媔些橦鼘蟲痻宏藬瑀京脾岡疫龑豯飄頖窒煦蔚樟哿巠蚚ㄛ甜釬峈淕极巠蚚衾む坻①錶﹝ + +7.﹛拸童悵 +﹛﹛蚕衾掛趼倰岆轎煤忨見皈皕阬尕庈穔譟僇岌琭炳擋笢芺垓遘蓬醽庥庰ㄠㄐㄢ準鍚衄抎醱佽隴ㄛ唳亞侄藫頖枑鼎掛趼倰氪☆肮欴★祥枑鼎庥挋祣鉞警ㄠㄒ炬鄞袼Ы鼳噱嘟ヶ脾麾為嬤筍祥癹衾种忮俶睿巠衾杻隅醴腔腔做尨童悵﹝衄壽掛趼倰こ窐睿硒俴腔珨з峉玸歙蚕蠟創童﹝蝜掛趼倰堤珋閬棺ㄛ蠟茼創童珨з垀剒督昢﹜党葩睿蜊淏腔煤蚚﹝ + +8.﹛囷漲靨野③⑴巡譟齪 +﹛﹛壺準楊薺寞隅麼眕抎醱倛宒肮砩ㄛ婓庥恉橦鼘瞿畏庥帡磃亞侄藟埩炱閩庈穔證堋棉ヾB瑏躉藜棶硊2擋笢邯舝狡馫辣堐秪妏蚚麼祥夔妏蚚掛趼倰ㄗ婦嬤筍祥癹衾杸測妀こ麼督昢腔粒劃˙妏蚚﹜杅擂麼瞳祔眳囷囮˙麼氪茠珛溥鬼ㄘ垀竘祡腔庥挋掃荂Ⅳ雿荂2媩說〣暫說十婽熐繷芛俶囷囮蛹孮ㄛ撈妏唳亞侄藫頖刳晑疙襠蟣孝醴厊嗝埰啟鉦鄙俋﹝ diff --git a/APL/zh_CN.UTF-8/ARPHICPL.TXT b/APL/zh_CN.UTF-8/ARPHICPL.TXT new file mode 100644 index 00000000..7278ff3b --- /dev/null +++ b/APL/zh_CN.UTF-8/ARPHICPL.TXT @@ -0,0 +1,58 @@ +曌砌銋 + +(C) 1999 曌蝘撘∩遢砍 +唳嗾110啣撣瘞詨頝16811璆 +支誑銝閫摰憭嚗靽押 + +隞颱鈭箏臭誑憭嗅祆銋血憪隞嗥憭穿雿蝳甇V耨嫣 + +閮 + +蝏憭批啗蔓隞嗥銋行舐冽亙亙內典曹澈靽格寡蔓隞嗥芰晞詨嚗憒典隞祆銝函銝拇銝函亙嚗撟嗡蝖桐隞隞祈賢唳祈蔓隞嗥靽格寧抬曌砌銋衣孵怨捂臬僎曌望其蝙冽祈蔓隞嗚 + +瘜敺扳⊥狡 + +0.摰銋 +祆銋虫葉嚗摮舀曌PL蝏銝瘚瑕曌PL銝剜扑嚗BIG-5嚗曌PL蝞亙曌PL蝞銝剜扑嚗GB嚗蝑TrueType摮嚗隞亙蝏靽格寡鈭抒霂亦摮銵抬砌耨孵瑕游函憿箏頧祆X澆游蝘堆狂lyph table銝剖銝鈭摮 + +PL舀Public License嚗砌嚗 + +鈭箝舀典憯唳銝剛◤蝘唬蛹銋鈭箝 + +具舀鋡急憭嗚撣靽格孵鈭箝 + +芰曹蝙具舀典冽亙詨∩辣銝嚗憭嗚靽格孵撣摮憭嗅芰梧隞瑟潦憒冽踵嚗臭誑撖寞迨憿寞⊥嗅韐寧具 + +1.憭嗅 +憒冽憭嗅蝏湔祆銋行隞塚ARPHICPL.TXT嚗銝嚗典臭誑其遙雿慦雿嗅嗅砍銋憭嗅 + +2.靽格 +憒皛∟雲隞乩∩辣嚗典臭誑其遙雿孵靽格寞砍憭嗅嚗砌耨孵瑕湔Y憿箏頧祆X澆游蝘堆狂lyph table銝剖銝鈭摮嚗撟嗡靘桐餈啁洵銝∠閫摰憭嗅霂乩耨寧押 + +a)典憿餃冽銝芯耨寡隞嗡葉交曄憯唳嚗銵函內典雿雿嗡耨嫣霂交隞嗚 + +b)典憿餃霈豢蝚砌孵冽祆銋行⊥狡銝嚗敺隞乓芰曹蝙具霂乩耨寧拍券剁靘憒餈靘摰啁寧憭嗉楝敺嚗券撣訾銝箄蔓隞嗡漱Y慦雿銝撣霂乩耨寧押 + +c)憒靽格寡摮冽扯嗡誑鈭方孵霂餃賭誘嚗典憿颱蝙摰典憪餈乩祉鈭方雿輻冽孵嗆唳曄內憯唳嚗祇敶憯唳靽憯唳嚗嗡冽靘靽憯唳嚗嚗隞亙雿輻刻臭誑靘株鈭∩辣砍憯唳嚗撟嗡乩蝙刻憒雿唳祆銋衣憭研 + +餈鈭閬瘙其港葵靽格寡雿憒雿航儘霂典撟園銵芣砍嚗銝臭誑啗恕嗡蛹祉銝芸怎雿嚗敶典摰敶雿銝芸思塚祆銋血嗆⊥狡撠銝其霂仿典甇歹隞撠箔砍銋嗡雿砍銝韏瑟曉亥揹摮慦雿銝瑚嚗撟嗡隡雿輯砲嗡雿蝥喳交祆銋衣刻氬 + +3.閫斗∩辣 +日靘扳祆銋衣閫摰嚗血其賢嗚靽格嫘砍隞颱典嗡孵憭嗚靽格嫘砍橘撠雿踵祆銋行銝函抵芸典仃銝餈嚗隞券靘格祆銋血敺憭嗅拍鈭綽芾隞隞砍券菔⊥狡嚗嗆拙蝏湔 + +4. +冽芰倌霈X祆銋佗隞交瓷敹閬菔摰嗉嚗瘝⊥隞颱嗡隞嗆銝典嗚靽格嫘砍銋抬憒其祆銋佗餈鈭銵銝箸舀敺蝳甇Y甇支血嗚靽格嫘砍嚗撠梯”蝷箸冽亙祆銋血嗡⊥狡∩辣 + +5.芸典敺 +瘥敶典撣砍塚嗅靘輯芸其憪憭敺靘株鈭⊥狡∩辣憭嗚靽格寞砍其臬笆冽迨銝嗅銋拙銵撘箏嗡塚其瘝⊥雿輻洵銝寥菔祆銋衣銋∼ + +6.菔圻 +亙瘜W文喋餈銝拙恐蝘唳隞颱嗡嚗銝鈭銝拍蝥瘀蝏嚗雿踹撩鈭函∩辣嚗銝霈箸舀W賭誘霈格嗡嚗銋衣∩辣脩塚銋銝質悟刻銋衣∩辣憒其賢嗆說頞單祆銋行摰銋∪嗡詨喃⊥亙塚暻賣冽寞砌臬砍靘憒嚗憒銝拇銝霈豢湔交湔乩券敺憭嗅嚗典韐寧萎砍塚臭賢嗆說頞喳寡瘙寞臬券踹砍 + +憒祆⊥狡銋隞颱典函孵萎瘜摰踝⊥狡嗡典撠蝏抒賒剁撟嗡銝箸港其嗡萸 + +7.靽 +曹砍臬韐寞嚗冽敺霈貊游嚗砍撠銝撣虫遙雿靽日行銋阡Z秩嚗鈭箸嗡靘砍瑯銝靘隞颱蝘蝐餌靽嚗銝霈箸舀蝷箄舀蝷綽砌銝鈭格批鈭孵桃蝷箸靽單砍韐典扯銝梢拙望冽踵憒砍箇啁蛛典踵銝∼靽桀寞迤韐寧具 + +8.摰唾輯窈瘙曉 +日瘜敺閫摰隞乩髡W耦撘嚗其遙雿萎嚗隞颱鈭箸隞乩鋡怠霈詨隞亙嗚靽格寞砍嚗銝撖寞典雿輻冽銝賭蝙冽砍嚗砌銝鈭蹂誨∠韐哨雿輻具唳格拍銋憭梧乩憒函嚗撘渡隞颱湔乓湔乓敹嗚嗥嗚寞拍扳憭梯韐嚗喃蝙鈭箸嗡鈭箏歇亥砲憭梁航賣扳嗡漲銝靘憭 diff --git a/APL/zh_TW.UTF-8/ARPHICPL.TXT b/APL/zh_TW.UTF-8/ARPHICPL.TXT new file mode 100644 index 00000000..d580d814 --- /dev/null +++ b/APL/zh_TW.UTF-8/ARPHICPL.TXT @@ -0,0 +1,58 @@ +曌祉暹甈 + +雿甈(C) 1999 曌蝘潸∩遢砍 +啁110啣撣瘞詨頝16811璅 +日隞乩閬摰嚗靽甈押 + +隞颱鈭箏舫鋆賢撣祆甈詨憪隞嗡銴穿雿蝳甇V耨嫣 + +閮 + +憭批貉擃銋甈訾其憟芣典曹澈靽格寡擃銋芰晞詨耦銋銝嚗憒典函銝甈拇函亙嚗銝虫蝣箔隞賢唳祈擃銋靽格寧抬曌祉暹甈貊孵亥迂臭蒂曌菜其蝙冽祈擃 + +瘜敺扳甈 + +0.摰蝢 +祆甈訾葉嚗摮靽曌PL蝝唬瘚瑕曌PL銝剜扑嚗BIG-5蝣潘曌PL蝪∪勗曌PL蝪∩葉璆瑯嚗GB蝣潘蝑TrueType摮嚗隞亙蝬靽格寡Y銋閰脩摮銵抬砌耨孵璅撘游蝺函Ⅳ摨頧澆霈游蝔梧狂lyph table銝剖皜銝鈭摮 + +PL靽Public License嚗祉暹甈嚗 + +雿甈鈭箝靽典雿甈脫銝剛◤蝔梁箄雿甈銋鈭箝 + +具靽鋡急甈鋆賬撣靽格孵銋鈭箝 + +芰曹蝙具靽典冽亙銋詨璇隞嗡嚗鋆賬靽格孵撣摮銴砌芰梧寞潦憒券嚗臭誑撠甇日嗅鞎餌具 + +1.鋆賢撣 +憒冽銴祉雁祆甈豢獢嚗ARPHICPL.TXT嚗銝霈嚗典臭誑隞颱慦擃⊿園鋆賢撣砍銋銴研 + +2.靽格 +憒皛輯雲隞乩璇隞塚典臭誑隞颱孵靽格寞砍銋銴穿砌耨孵璅撘游蝺函Ⅳ摨頧澆霈游蝔梧狂lyph table銝剖皜銝鈭摮嚗銝虫靘銝餈啁洵銝璇銋閬摰鋆賢撣閰脖耨寧押 + +a)典冽靽格寥瑼獢銝剜交憿舐脫嚗銵函內典雿雿靽格嫣閰脫獢 + +b)典閮望蝚砌鈭箏冽祆甈豢甈曆嚗敺隞乓芰曹蝙具閰脖耨寧拐券剁靘憒摰圈鋆質楝敺靘嚗券撣訾箄擃鈭斗慦擃銝撣閰脖耨寧押 + +c)憒靽格寥銋摮典瑁隞乩漱隢孵霈賭誘嚗典雿踹券憪脣乩砌鈭方雿輻冽孵唳憿舐內脫嚗祇拍嗥雿甈脫⊥靽脫嚗嗡冽靘靽脫嚗嚗隞亙雿輻刻臭誑靘鈭璇隞嗅撣砍脫嚗銝虫乩蝙刻憒雿唳祆甈訾銴研 + +鈭閬瘙拍冽潭游靽格寥銋雿憒雿航儘霅典銝阡銵芣砍嚗銝臭誑啗嗥箇函乩雿嚗嗆典摰嗡亥雿撣嚗祆甈詨嗆甈曉銝拍冽潸府典甇歹撠箸潭砍銋嗡雿砍銝韏瑟曉亥盔摮撣慦擃銝瑚嚗銝虫雿輯府嗡雿蝝交祆甈貊拍函 + +3.閫斗隞 +日靘扳祆甈訾蝷箄摰嚗血其賡鋆賬靽格嫘甈撣砍隞颱典嗡孵鋆賬靽格嫘甈撣砍銋嚗撠雿踵祆甈豢其甈抵芸皞臬啣仃銝敺券靘祆甈詨敺銴砍甈拍鈭綽芾隞摰券菔璇甈橘嗆拙蝬剜 + +4. +冽芰偷閮祆甈賂隞交敹閬菔銋嗉嚗瘝隞颱嗡隞嗆券鋆賬靽格嫘甈撣砍銋甈抬憒其祆甈賂鈭銵箸舀敺蝳甇Y甇支阡鋆賬靽格嫘甈撣砍嚗撠梯”蝷箸冽亙祆甈詨嗡璇甈曉璇隞嗚 + +5.芸敺甈 +瘥嗆典撣砍嚗嗅靘輯芸敺憪甈敺靘鈭璇甈曉璇隞園鋆賬撣靽格寞砍銋甈其臬冽迨嗅銋甈拙祕銵撘瑕嗡塚其瘝雿輻洵銝鈭粹菔祆甈貊蝢拙 + +6.菔孛 +亙瘜W斗捱撠拙恐蝔望隞颱嗡嚗銝澆拍鳥蝝嚗蝯嚗雿踹撥潭其璇隞塚銝隢舀W賭誘霅唳嗡嚗甈訾璇隞嗆銵蝒嚗銋銝質券甈訾璇隞嗚憒其賢皛輯雲祆甈豢摰銋蝢拙嗡賊蝢拙靘撣嚗暻潭冽寞砌舀撣砍靘憒嚗憒撠拇甈銝閮望湔交亙券鋆∪敺銴祈嚗典甈鞎餌瘜銝撣砍嚗臭賢皛輯雲寡瘙寞臬券踹撣砍 + +憒祆甈曆隞颱典函孵瘜銝⊥⊥撖行踝璇甈曆嗡典撠蝜潛拍剁銝虫箸湧拍冽澆嗡瘜 + +7.⊥靽 +望潭砍靽鞎餅甈嚗冽瘜閮曹蝭改砍撠銝撣嗡遙雿靽日行賊Z牧嚗雿甈鈭箸嗡靘砍璅銝靘隞颱蝔桅銋靽嚗銝隢靽蝷粹舀蝷綽砌銝潮瑕格批拇潛孵桃銋蝷箸靽砍鞈芸瑁銋銝梢芸望冽踵憒砍箇曄蛛冽踵銝靽桀儔寞迤鞎餌具 + +8.摰唾隢瘙甈銋暹 +日皞瘜閬摰隞交賊W嚗其遙雿瘜銝嚗隞颱雿甈鈭箸隞乩鋡怠閮勗隞仿鋆賬靽格寞撣砍嚗銝撠典雿輻冽銝賭蝙冽砍嚗砌銝潭蹂誨銋∟頃嚗雿輻具豢拍銋憭梧璆剖成蝷嚗撘港隞颱湔乓乓敹嗚嗥嗚寞脩蔑扳憭梯鞎穿喃蝙雿甈鈭箸嗡鈭箏歇亥府憭曹航賣扳鈭虫靘憭 diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..de7491ae --- /dev/null +++ b/LICENSE @@ -0,0 +1,58 @@ +ARPHIC PUBLIC LICENSE + +Copyright (C) 1999 Arphic Technology Co., Ltd. +11Fl. No.168, Yung Chi Rd., Taipei, 110 Taiwan +All rights reserved except as specified below. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is forbidden. + +Preamble + + The licenses for most software are designed to take away your freedom to share and change it. By contrast, the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this software, provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software. + +Legal Terms + +0. Definitions: + Throughout this License, "Font" means the TrueType fonts "AR PL Mingti2L Big5", "AR PL KaitiM Big5" (BIG-5 character set) and "AR PL SungtiL GB", "AR PL KaitiM GB" (GB character set) which are originally distributed by Arphic, and the derivatives of those fonts created through any modification including modifying glyph, reordering glyph, converting format, changing font name, or adding/deleting some characters in/from glyph table. + + "PL" means "Public License". + + "Copyright Holder" means whoever is named in the copyright or copyrights for the Font. + + "You" means the licensee, or person copying, redistributing or modifying the Font. + + "Freely Available" means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you received, not price. If you wish, you can charge for this service. + +1. Copying & Distribution + You may copy and distribute verbatim copies of this Font in any medium, without restriction, provided that you retain this license file (ARPHICPL.TXT) unaltered in all copies. + +2. Modification + You may otherwise modify your copy of this Font in any way, including modifying glyph, reordering glyph, converting format, changing font name, or adding/deleting some characters in/from glyph table, and copy and distribute such modifications under the terms of Section 1 above, provided that the following conditions are met: + + a) You must insert a prominent notice in each modified file stating how and when you changed that file. + + b) You must make such modifications Freely Available as a whole to all third parties under the terms of this License, such as by offering access to copy the modifications from a designated place, or distributing the modifications on a medium customarily used for software interchange. + + c) If the modified fonts normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the Font under these conditions, and telling the user how to view a copy of this License. + + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Font, and can be reasonably considered independent and separate works in themselves, then this License and its terms, do not apply to those sections when you distribute them as separate works. Therefore, mere aggregation of another work not based on the Font with the Font on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. Condition Subsequent + You may not copy, modify, sublicense, or distribute the Font except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Font will automatically retroactively void your rights under this License. However, parties who have received copies or rights from you under this License will keep their licenses valid so long as such parties remain in full compliance. + +4. Acceptance + You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to copy, modify, sublicense or distribute the Font. These actions are prohibited by law if you do not accept this License. Therefore, by copying, modifying, sublicensing or distributing the Font, you indicate your acceptance of this License and all its terms and conditions. + +5. Automatic Receipt + Each time you redistribute the Font, the recipient automatically receives a license from the original licensor to copy, distribute or modify the Font subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +6. Contradiction + If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Font at all. For example, if a patent license would not permit royalty-free redistribution of the Font by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Font. + + If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +7. NO WARRANTY + BECAUSE THE FONT IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE FONT, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS OR OTHER PARTIES PROVIDE THE FONT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE FONT IS WITH YOU. SHOULD THE FONT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +8. DAMAGES WAIVER + UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, IN NO EVENT WILL ANY COPYRIGHTT HOLDERS, OR OTHER PARTIES WHO MAY COPY, MODIFY OR REDISTRIBUTE THE FONT AS PERMITTED ABOVE, BE LIABLE TO YOU FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, SPECIAL OR EXEMPLARY DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE FONT (INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERRUPTION), EVEN IF SUCH HOLDERS OR OTHER PARTIES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 00000000..6e0335b5 --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +throw "Do not require hanzi-writer-data directly. You should instead require each character you want to use, like: var char = require('hanzi-writer-data/')"; \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..5894f87c --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "name": "hanzi-writer-data", + "version": "0.0.1", + "author": "David Chanin (https://chanind.github.io/hanzi-writer)", + "description": "The character data used by Hanzi Writer. This data is derived from the Make Me a Hanzi project.", + "repository": "chanind/hanzi-writer-data", + "main": "index.js", + "license" : "SEE LICENSE IN LICENSE" +} diff --git a/stroke_data_parser.py b/stroke_data_parser.py new file mode 100644 index 00000000..f0ae9f21 --- /dev/null +++ b/stroke_data_parser.py @@ -0,0 +1,94 @@ +import json +import os +from copy import copy + +root = os.path.dirname(__file__) +dictionary_file = os.path.join(root, 'vendor/makemeahanzi/dictionary.txt') +graphics_file = os.path.join(root, 'vendor/makemeahanzi/graphics.txt') +output_dir = os.path.join(root, 'data') + +positioners = { + '熂': 2, + '熂': 2, + '熂': 3, + '熂': 3, + '熂': 2, + '熂': 2, + '熂': 2, + '熂': 2, + '熂': 2, + '熂': 2, + '熂': 2, + '熂': 2, +} +missing_marker = '嚗' + +graphics_data = {} +dict_data = {} + +with open(dictionary_file) as f: + lines = f.readlines() + for line in lines: + decoded_line = json.loads(line) + dict_data[decoded_line['character']] = decoded_line + +with open(graphics_file) as f: + lines = f.readlines() + for line in lines: + decoded_line = json.loads(line) + char = decoded_line.pop('character') + graphics_data[char] = decoded_line + + +def get_decomp_index(char, subchar): + "Parse the decomposition tree to figure out what the index of the subchar is within the char" + stack = [] + for piece in dict_data[char]['decomposition']: + last_node = None + path = [] + if len(stack) > 0: + last_node = stack.pop() + path = copy(last_node['path']) + path.append(last_node['children']) + last_node['children'] += 1 + if last_node['children'] < last_node['size']: + stack.append(last_node) + if piece in positioners: + node = { + 'size': positioners[piece], + 'children': 0, + 'path': path, + } + stack.append(node) + elif piece == subchar: + return path + return None + +def get_radical_strokes(char): + radical = dict_data[char]['radical'] + if char == radical: + return None + decomp_index = get_decomp_index(char, radical) + if not decomp_index: + return None + rad_strokes = [] + for stroke_num, match_index in enumerate(dict_data[char]['matches']): + if match_index == decomp_index: + rad_strokes.append(stroke_num) + return rad_strokes + + +# write out data + +for char in graphics_data: + radical = get_radical_strokes(char) + if radical: + graphics_data[char]['radStrokes'] = radical + +for char, data in graphics_data.items(): + out_file = os.path.join(output_dir, f'{char}.json') + with open(out_file, 'w') as f: + f.write(json.dumps(data, ensure_ascii=False)) + +with open(os.path.join(output_dir, 'all.json'), 'w') as f: + f.write(json.dumps(graphics_data, ensure_ascii=False)) diff --git a/vendor/makemeahanzi b/vendor/makemeahanzi new file mode 160000 index 00000000..f95cd401 --- /dev/null +++ b/vendor/makemeahanzi @@ -0,0 +1 @@ +Subproject commit f95cd401c83da7a7d763aa78ac4e9e430448583d