

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Google &#8211; Max的每一天</title>
	<atom:link href="https://max-everyday.com/tag/google/feed/" rel="self" type="application/rss+xml" />
	<link>https://max-everyday.com</link>
	<description>認真過每一天、快樂過每一天</description>
	<lastBuildDate>Mon, 29 Dec 2025 01:24:11 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://max-everyday.com/wp-content/uploads/2020/02/ic_launcher_round_2020-003.png</url>
	<title>Google &#8211; Max的每一天</title>
	<link>https://max-everyday.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>用 AI  幫苦累蛙圓體補缺字「搐」</title>
		<link>https://max-everyday.com/2025/12/antigravity-kurewa-tutorial/</link>
					<comments>https://max-everyday.com/2025/12/antigravity-kurewa-tutorial/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Sun, 28 Dec 2025 04:27:33 +0000</pubDate>
				<category><![CDATA[電腦相關應用]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[Google]]></category>
		<guid isPermaLink="false">https://max-everyday.com/?p=22646</guid>

					<description><![CDATA[示範用 antigravity, 修改github 上的專案, 幫苦累蛙圓體補缺字「搐」, 網友的許願網址:https://github.com/max32002/kur [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="559" src="https://max-everyday.com/wp-content/uploads/2025/12/zi2zi-kurewa-cover-1920-1024x559.jpg?v=1766895988" alt="" class="wp-image-22650" srcset="https://max-everyday.com/wp-content/uploads/2025/12/zi2zi-kurewa-cover-1920-1024x559.jpg?v=1766895988 1024w, https://max-everyday.com/wp-content/uploads/2025/12/zi2zi-kurewa-cover-1920-500x273.jpg?v=1766895988 500w, https://max-everyday.com/wp-content/uploads/2025/12/zi2zi-kurewa-cover-1920-615x335.jpg?v=1766895988 615w, https://max-everyday.com/wp-content/uploads/2025/12/zi2zi-kurewa-cover-1920.jpg?v=1766895988 1408w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>示範用 antigravity, 修改github 上的專案,  幫苦累蛙圓體補缺字「搐」, 網友的許願網址:<br><a href="https://github.com/max32002/kurewa-gothic/issues/4">https://github.com/max32002/kurewa-gothic/issues/4</a></p>



<p>修改前的程式碼:<br><a href="https://github.com/EuphoriaYan/zi2zi-pytorch">https://github.com/EuphoriaYan/zi2zi-pytorch</a></p>



<p>antigravity 提示詞:</p>



<pre class="wp-block-code"><code>採樣改用 PixelShuffle
增加 Self-Attention
調整程式輸入 384x384 的圖片也可以正常運作</code></pre>



<p>修改後的程式碼:<br><a href="https://github.com/max32002/zi2zi-pytorch">https://github.com/max32002/zi2zi-pytorch</a></p>



<h2 class="wp-block-heading">補字製作步驟</h2>



<p>從 AI 訓練到字型文件生成的 14 個步驟回饋循環</p>



<p><strong>Phase A: AI 訓練與生成</strong></p>



<ul class="wp-block-list">
<li>Step 1：數據預處理<br>程式碼: font2img.py</li>



<li>Step 2：數據打包 (Pickle)<br>程式碼: package.py</li>



<li>Step 3：模型訓練 (cGAN) 接收優化後的數據進行微調<br>程式碼: train.py</li>



<li>Step 4：推論轉換<br>程式碼: infer.py</li>



<li>Step 5：檢視訓練成果<br>初步觀察推論結果品質: 差強人意(maybe), 極優(good)</li>
</ul>



<p><strong>Phase B: 圖像與向量處理</strong></p>



<ul class="wp-block-list">
<li>Step 6：合併推論與手動修圖<br>程式碼: generate_glyphs.py,<a href="https://dictionary.max-everyday.com/" target="_blank" rel="noreferrer noopener">&nbsp;中文部件查詢</a></li>



<li>Step 7：剪裁右側對照圖, 完成圖像清理後回灌優質數據進行訓練優化<br>程式碼: crop_images.py</li>



<li>Step 8：轉為 SVG 格式<br>程式碼: bmp_to_svg.py</li>



<li>Step 9：SVG 內容簡化<br>程式碼: svg_simplify.py</li>
</ul>



<p><strong>Phase C: 字型工程與生成</strong></p>



<ul class="wp-block-list">
<li>Step 10：字型匯入 SVG<br>程式碼: import_svg.py</li>



<li>Step 11：處理衝突的字元<br>程式碼: font_delete_font.py, </li>



<li>Step 12：縮放筆畫 (多種字重) , Regular ➔ ExtraLight, Light, SemiBold, Bold<br>程式碼: expand_stroke.py</li>



<li>Step 13：修改字重/版號資訊, 腳本化處理，避免 GUI 操作<br>程式碼: replace_string.py </li>



<li>Step 14：生成字型與 Webfont<br>程式碼: generate.py</li>
</ul>



<p>極醜的完成品下載: <br><a href="https://github.com/max32002/kurewa-gothic">https://github.com/max32002/kurewa-gothic</a></p>



<p>線上效果預覽: 苦累蛙圓體 Kurewa Gothic<br><a href="https://max-everyday.com/2021/06/kurewa-gothic/">https://max-everyday.com/2021/06/kurewa-gothic/</a></p>



<p>訓練用的 batch size 建議值:<br><a href="https://stackoverflow.max-everyday.com/2025/12/zi2zi-decrease-batch-size/">https://stackoverflow.max-everyday.com/2025/12/zi2zi-decrease-batch-size/</a><br>（AI 的答案有可能是錯誤的？參數數值別全信！處處存疑、反覆求證是王道。）</p>



<p>YouTube: <a href="https://youtu.be/RcigPCJZQEY">https://youtu.be/RcigPCJZQEY</a></p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<div class="gutenbee-responsive-embed"><iframe title="用 AI  幫苦累蛙圓體補缺字" width="885" height="664" src="https://www.youtube.com/embed/RcigPCJZQEY?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
</div></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>在 Windows 平台, 所有使用到的指令:</p>



<pre class="wp-block-code"><code>@...................................................
@ 用人工去比對 paired image, 
@...................................................
@ 為什麼會有 paired_images_debug,
@ 因為需要先配對一次, 用人工去比對 paired image, 
@ 移除不適合訓練的字, 例如: symbols &amp; 筆劃不同.

cd C:\Max\Documents\zi2zi-pytorch\
rd /q/s C:\Max\Documents\zi2zi-pytorch\source\paired_images-kurewa-debug
python font2img.py --src_font=source/font/SweiGothicCJKtc-DemiLight.ttf ^
    --dst_font=source/font/ZenKurenaido-Regular.ttf ^
    --charset=charset/charset_test.txt ^
    --sample_dir=source/paired_images-kurewa-debug ^
    --label=0 ^
    --canvas_size=384 ^
    --char_size=384 ^
    --dst_y_offset=-111 ^
    --disable_auto_fit ^
    --mode=font2font

@...................................................
@ 產生訓練清單
@...................................................
@ 調整訓練的字的清單, 很有可能會動態調整內容, 所以要用自動化的腳本來維護與管理控制。

cd C:\Max\Documents\kurewa-gothic\orig
copy /y charset_kurenaido.txt charset_kurenaido_train.txt
python \max\sh\remove_selected_char.py --input charset_kurenaido_train.txt --remove charset_kurenaido_alpha.txt --output charset_kurenaido_train.txt
python \max\sh\remove_selected_char.py --input charset_kurenaido_train.txt --remove charset_kurenaido_train_removed.txt --output charset_kurenaido_train.txt
copy /y charset_kurenaido_train.txt C:\Max\Documents\zi2zi-pytorch\charset

@ 確定好內容, 產生 paired_images

cd C:\Max\Documents\zi2zi-pytorch\
rd /q/s C:\Max\Documents\zi2zi-pytorch\source\paired_images-kurewa
python font2img.py --src_font=source/font/SweiGothicCJKjp-Light.ttf ^
    --dst_font=source/font/ZenKurenaido-Regular.ttf ^
    --charset=charset/charset_kurenaido_train_match_noto_light.txt ^
    --sample_dir=source/paired_images-kurewa ^
    --shuffle ^
    --canvas_size=384 ^
    --char_size=384 ^
    --dst_y_offset=-111 ^
    --disable_auto_fit ^
    --mode=font2font

@...................................................
@ package 
@...................................................

rd /q/s C:\Max\Documents\zi2zi-pytorch\experiments\data-kurewa-regular-384-jp
mkdir C:\Max\Documents\zi2zi-pytorch\experiments\data-kurewa-regular-384-jp
cd C:\Max\Documents\zi2zi-pytorch\
python package.py --dir=source/paired_images-kurewa ^
    --save_dir=experiments/data-kurewa-regular-384-jp ^
    --no_label ^
    --split_ratio=0

@...................................................
@ train
@...................................................
@ local

cd C:\Max\Documents\zi2zi-pytorch\
python train.py --experiment_dir=experiments ^
    --data_dir=experiments/data-kurewa-regular-384-jp ^
    --gpu_ids=cuda:0 ^
    --batch_size=16 ^
    --epoch=1 ^
    --lr=0.00105 ^
    --self_attention ^
    --checkpoint_steps=20 ^
    --ngf=64 ^
    --accum_steps=8 ^
    --image_size=384 ^
    --d_spectral_norm ^
    --checkpoint_only_last

@ colab
@ --resume=48019 \
@ batch_size, https://stackoverflow.max-everyday.com/2025/12/zi2zi-decrease-batch-size/

%cd '/gdrive/My Drive/Colab Notebooks/zi2zi-pytorch'
!python train.py --experiment_dir=experiments \
    --data_dir=experiments/data-kurewa-regular-384-jp \
    --gpu_ids=cuda:0 \
    --batch_size=64 \
    --image_size=384 \
    --ngf=64 \
    --ndf=64 \
    --epoch=100 \
    --lr=0.000999 \
    --self_attention \
    --checkpoint_steps=100 \
    --checkpoint_steps_after=300 \
    --d_spectral_norm \
    --checkpoint_only_last

@ get char list.
fontforge \max\sh\get_ttf_chars.py kurewa-max-new-chi-only.ttf


python \max\sh\remove_selected_char.py --input charset_kurewa-max-new-chi-only.txt --remove charset_SweiGothicCJKjp-Light.txt --mode=int --output charset_kurewa-max-new-chi-match-noto-light.txt
length of input file: 1113
length of remove file: 44170
excepted length of formated file: 1010
final length of target file: 1010

python \max\sh\remove_selected_char.py --input charset_kurenaido_train.txt --remove charset_SweiGothicCJKjp-Light.txt --mode=int --output charset_kurenaido_train_match_noto_light.txt
length of input file: 6645
length of remove file: 44170
excepted length of formated file: 6419
final length of target file: 6419

python \max\sh\remove_selected_char.py --input charset_kurenaido_train_match_noto_light.txt --remove charset_SweiGothicCJKjp-Light-more-9.txt --mode=int --output charset_kurenaido_train_match_noto_light-more-9.txt
length of input file: 6419
length of remove file: 26282
excepted length of formated file: 5287
final length of target file: 5287

cd C:\Max\Documents\zi2zi-pytorch\
rd /q/s C:\Max\Documents\zi2zi-pytorch\source\paired_images-kurewa-debug
python font2img.py --src_font=source/font/SweiGothicCJKtc-Light.ttf ^
    --dst_font=source/font/kurewa-max-new-chi-only.ttf ^
    --charset=charset/charset_kurewa-max-new-chi-match-noto-light.txt ^
    --sample_dir=source/paired_images-kurewa-debug ^
    --label=1 ^
    --shuffle ^
    --canvas_size=384 ^
    --char_size=384 ^
    --dst_y_offset=-111 ^
    --disable_auto_fit ^
    --mode=font2font

cd C:\Max\Documents\zi2zi-pytorch\
del C:\Max\Documents\zi2zi-pytorch\source\paired_images-kurewa\1_*
move C:\Max\Documents\zi2zi-pytorch\source\paired_images-kurewa-debug\*.png C:\Max\Documents\zi2zi-pytorch\source\paired_images-kurewa
rmdir  C:\Max\Documents\zi2zi-pytorch\source\paired_images-kurewa-debug

@...................................................
@ infer
@...................................................
rd /q/s experiments\infer\0
cd C:\Max\Documents\zi2zi-pytorch
set checkpoint=48019
set image_size=384
set ngf=48
set ndf=48
python infer.py --experiment_dir=experiments ^
    --checkpoint_dir=experiments/checkpoint-kurewa-regular-384-jp ^
    --gpu_ids=cuda:0 ^
    --resume=%checkpoint% ^
    --ngf=%ngf% ^
    --ndf=%ndf% ^
    --batch_size=40 ^
    --from_txt ^
    --filename_rule=unicode_int ^
    --src_font=source/font/SweiGothicCJKtc-Light.ttf ^
    --src_font_y_offset=0 ^
    --src_txt_file=charset/charset_kurewa_infer_list_without_max_new.txt ^
    --self_attention ^
    --image_size=%image_size% ^
    --canvas_size=%image_size% ^
    --char_size=%image_size% ^
    --d_spectral_norm ^
    --label=0
rd /q/s experiments\infer\0_%checkpoint%_tc
ren experiments\infer\0 0_%checkpoint%_tc


@...................................................
@ mix maybe and good png.
@...................................................

xcopy /y C:\Max\Documents\kurewa-gothic\orig\png-maybe\*.png C:\Max\Documents\zi2zi-pytorch\source\paired_images-kurewa
xcopy /y C:\Max\Documents\kurewa-gothic\orig\png-good\*.png C:\Max\Documents\zi2zi-pytorch\source\paired_images-kurewa

@...................................................
@ package 
@...................................................

rd /q/s C:\Max\Documents\zi2zi-pytorch\experiments\data-kurewa-regular-384-jp
mkdir C:\Max\Documents\zi2zi-pytorch\experiments\data-kurewa-regular-384-jp
cd C:\Max\Documents\zi2zi-pytorch\
python package.py --dir=source/paired_images-kurewa ^
    --save_dir=experiments/data-kurewa-regular-384-jp ^
    --no_label ^
    --split_ratio=0

@...................................................
@ generate_glyphs 
@...................................................

    --keyword "白申車甲旦音里由早者曲果昜卑曷旲莫是單亘昔重昚軍昆尞电章龺亶百旬皇曾󰕊更會奄童易旨覃專敫香卓東斬皆農宣昷单󰒄旱昌畢 昏倝春原曹󰓛連意皀昗复 妟豊冥泉習朁間巢猒帛匽惠厭樂󰒒星戠景竟查寅󰓅明暴耆魯佰 旣  昬甹㬎厘皋鲁葛宿晃晉曳湯便㝵時沓普晶󰒏󰑁替復黾署昝動諸旧朝皐圼著漸昇幹廛󰓲陳间幕単时奢皕审綿寮屠庫旻晏杲竜猪豬皃耤乾亀亯诸賜兜皂的昱嘗野歆團曇董崑庳恒草贛戟晋軒軗輦昭显暑楽神筍軎泊澧皛谒貍貌謁"
    --keyword "佹危卼垝姽尯峗峞恑桅洈硊祪脆臲蛫觤詭诡跪陒頠鮠"
    --keyword "侒咹垵姲安峖按晏暥案桉氨洝胺荌銨铵鞌鞍頞騴鮟鴳鷃鼹"
    --keyword "倦儯券劵勌勝勬卷啳圈圏埢堘塍奍婘媵巻帣幐弮惓慻拳捲搼桊棬椦榺橳淃滕漛潫牶犈畻眷睠箞籐籘絭綣縢绻腃腾膡菤蔨蕂藤虅蜷螣裷觠誊謄豢賸踡錈锩闂韏飬餋駦騰驣鬈鮝鰧鲞黱齤龹"
    --keyword "俔儬儭哯嚫囕垷娊嫢宽寛寬寴岘峴悓挸揽搅摫撹攪攬斍晛枧梘椝榄槻槼櫬欖欟涀漞瀙灚灠爦现現睍瞡砚硯窥窺竀笕筧粯絸纜缆臗舰苋莧萈藽蚬蜆襯見覌覍覎規覐覑覒覓覔覕視覗覘覙覚覛覜覝覞覟覠覡覢覣覤覥覦覧覨覩親覫覬覭覮覯覰覱覲観覴覵覶覷覸覹覺覻覼覽"
    --keyword "俞偷偸兪匬喩喻堬婾媮崳嵛愈愉揄楡榆歈毹毺渝瀭牏瑜瘉癒睮窬緰羭腧萮蕍蝓褕覦觎諭谕貐踰輸输逾鄃鍮隃騟"
    --keyword "兄冋加卟占古句另叧叨叩叫召叭叮台叱右叴叵叶号叹叺叻叼叽叾叿吀吁吂吃各吅吆吇合吉吊吋同名后吐吒吓吔吕吖吗𫝘吘吙吚君吜吝吞吟吠吡吢吣吤吥否吧吨吩吪含听吭吮启吰吱吲吴吵吶吷吸吹吺吻吼吽吾吿呀呁呃呅呆呇呈告呋呌呍呎呏呐呒呓呔呕呖呗员呙呚呛呜𠯗㕸呝呞呟呠呡呢呣呤呥呦呧呩呪呫呬呭呮呯呰呱呲味呴呵呶呷呸呹呺呻呼呾呿咀咁咂咃咄咅咆咇咈咉咊咋和咍咎咏咐咑咓咔咕咖咗咘咙咚咛咜咝㖅咞咟咠咡咣咤咥咦咧咨咩咪咬咭咮咯咰咱咲咳咴咵咶咷咸咹咺咻咼咽咾咿哀品哂哃哄哅哆哇哈哉哊哋哌响哎哏哐哑哒哓哔哕哖哗哘哙哚哜哝哞哟哠員哢哣哤哦哧哨哩哪哫哬哮哯哰哱哲哳哴哵哷哸哹哺哻哼哽哾唀唁唂唃唄唅唆唇唈唉唊唋唌唍唏唑唒唓唔唕唖唗唙唚唛唝唞唠唡唢唣唤唥唦唧𠲿㖭唨唩唪唫唬唭售唯唰唱唲唳唴唵唶唷唸唹唺唻唼唽唾唿啀啁啂啃啄啅啈啉啊啋啌啍問啐啑啒啓啕啖啗啘啛啜啝啞啠啡啢啣啤啥啦啧啨啩啪啭啮啯啰啱啲啳啴啵啶啷啸啹㖸㗎啫啺啻啼啽啾啿喀喁喂喃喅喇喈喉喊喋喎喏喐喑喒喓喔喕喖喗喘喙喚喛喜喝喞喟喠喡喢喤喥喧喨喩喫喭喯喰喱喲喳喴喵喷喹喺喻喼喽噅㗘喍嗀嗁嗂嗃嗄嗅嗆嗈嗉嗊嗋嗌嗍嗎嗏嗐嗑嗒嗓嗔嗕嗖嗗嗘嗙嗚嗛嗜嗝嗞嗟嗡嗢嗤嗥嗦嗨嗪嗫嗬嗮嗯嗰嗱嗲嗳嗴嗵嗶嗷嗸嗹嗺嗻嗼"
    --keyword "値值嗭埴徝悳惪植殖淔犆禃稙置"
    --keyword "傎厧嗔填嫃寘嵮慎搷槙滇瑱瘨瞋磌禛稹窴縝缜蒖衠謓貭蹎鎮镇闐阗顛颠鬒鷏黰齻"
    --keyword "儐嬪擯檳殯濱獱璸矉礗穦繽臏薲蠙鑌顮馪驞髕鬢𩼧"
    --keyword "凥卢孱尻尼𡰪𡰯尾尿屁层屃屄居屆屇屈屉届屋屌屍屎屏𡱒屑屒屓屖屙屚屛屝属屟屠屡屢屣層履𡳞屩屪屭户戸杘羼迉鳲鸤"
    --keyword "字宁宂它宄宅宆宇守安宊宋完宍宎宏宑宒宓宔宕宖宗官宙宛宜宝实実宠审客宣室宥宦宨宩宪宫㝗宧宬宭宮宯宰宱宲宴宵家宷宸容宺宽宾宿寀寁寂寃寄寈寉寊富寏寑寓寔寪寖寘寙寚寛㝩寞察寠寥實審寫寬寭寮寯寰寲寴寵寷惌梥灾牢賔"
    --keyword "傅博㗘圑愽搏榑溥煿牔猼磗禣糐縛缚䍸膊蒪賻赙鎛镈餺馎髆"
    --keyword "傛塎嫆嵱彮愹搈榕溶熔瑢穃蓉褣鎔镕鰫"
    --keyword "塞寋寨弿搴褰謇賽赛蹇騫骞鶱"
    --keyword "䟓趴趵趶趷䟘趺趻趽趾跀跁跂跃跄𧿬䟩跅跆跇跈跊跋跌跍跎跏跐跑跒跓跔跕跖跗跘跙跚跛跜距跞践𧿳趼跟跠跡跢跣跤跥跦跧跨跩跪跬跭跮路跰跱跲跳跴跶跷跸跹跺跻𬦰跼跽跿踀踁踂踃踄踆踇踈踉踊踋踌踍踎踏踐踑踒踓踔踕踖踗踘踙踚踛踜踝踞踟踠踡踢踣踤踥踦踧踩踪踬踭踮踯踺踫踰踱踳踴踵踶踷踸踹踻踼踽踾踿蹀蹁蹂蹃蹄蹅𨂾𨂿蹆蹈蹉蹊蹋蹌蹍蹎蹏蹐蹑蹒蹓𨃰䠡蹕蹖蹗蹘蹚蹛蹜蹝蹞蹟蹠蹡蹢蹣蹤蹥蹦蹧蹮躀蹨蹪蹫蹬蹭蹯蹰蹱蹲蹳蹴蹶蹸蹹蹺蹻蹼蹽蹾蹿𨅔躁躂躃躅躆躈躊躋躌躍躎躏躐躑躒躓躔躕躖躘躙躚躜躝躞躟躢躣躤躥躦躧躩躪躨"
    --keyword "氻氾氿汀汁汃汄汅汇汈汉汊汋汌汍汎汏汐汑汒汓汔汕汗汘汙汚汛汜汝江池污汢汣汤汥汦汧汨汩汪汫汭汮汯汰汱汲汳汴汵汶汷汸汹決汻汼汽汾汿沁沂沃沄沅沆沇沈沉沋沌沍沎沏沐沑沔沕沖沘沙沚沛沜沞沟沠没沢沣沤沥沦沧沨沩沪𣲩沫沬沭沮沱沲河沴沵沶沷沸油沺治沼沽沾泀況泂泃泄泅泆泇泈泊泋泌泍泎泏泐泑泒泓泔法泖泗泘泙泛泜泝泞泟泠泡波泣泤泥泦泧注泩泪泫泬泭泮泯泱泲泳泷泸泹泺泻泼泽泾泚泿洀洁洂洃洄洅洆洇洈洉洊洋洌洎洏洐洑洒洓洔洕洗洘洙洚洛洝洞洟洠洡洢洣洤津洦洧洨洩洪洫洬洭洮洰洱洲洳洴洵洶洷洸洹洺活洼洽派洿浀流浂浃浄浅浇浈浉浊测浌浍济浏浐浑浒浓浔浕洍洖浖浗浘浙浚浛浜浝浞浟浠浡浢浣浤浥浦浧浨浩浪浫浬浭浮浯浰浱浲浳浴浵浶海浹浺浻浼浽浾浿涀涁涂涃涄涅涆涇消涉涊涋涌涍涎涏涐涑涒涓涔涕涖涗涘涚涛涜涝涞涟涠涡涢涣涤涥润涧涨涙涪涫涬涭涮涯涰涱液涳涴涵涶涷涸涹涺涻涼涽涾涿淀淁淂淃淄淅淆淇淈淉淊淋淌淍淎淏淐淑淒淓淔淕淖淗淘淙淚淛淜淝淞淟淠淡淢淣淤淥淦淧淨淩淪淫淬淭淮淯淰深淲淳淴淵淶混淸淹淺添淽淿渀渁渂渄清渆済渉渊渌渍渎渏渐渑渒渔渖渗渚湴㴘㴙渃渘渙減渜渝渞渟渡渢渣渤渥渦渧渨温渪渫測渭渮港渰渱渲渳渴渵渶渷游渹渺渻渼渽渾渿湀湁湂湃湄湅湆湇湈湉湊湋"
    --keyword "佞囡奴奵奶奷奸她奺奻奼好奾奿妀妁如妃妄妅妆妇妈妉妊妋妌妎妏妐妑妒妓妔妕妖妗妘妙妚妜妝妞妟妠妡妢妣妤妥妦妧妨妩妪妫㚷妬妭妮妯妰妱妲妳妴妵妶妷妸妹妺妼妽妾妿姀姁姂姃姄姅姆姇姈姉姊始姌姍姎姏姐姑姒姓委姕姖姗妍姘姙姚姛姜姝姞姟姠姡姢姣姤姥姦姨姩姪姫姭姮姯姰姱姲姳姴姶姷姸姹姺姻姼姽姾姿娀威娂娃娅娆娇娈姬娉娊娋娌娍娎娏娐娑娒娓娔娕娖娗娘娙娚娛娜娝娞娟娠娡娢娣娤娥娦娧娨娩娪娫娭娮娯娰娱娲娴娽娬娵娶娷娸娹娺娻娼娾娿婀婂婃婄婅婆婇婈婉婊婋婌婍婎婏婐婑婒婓婔婕婖婗婘婙婚婛婜婝婞婟婠婡婢婣婤婥婦婧婨婩婪婫婬婭婮婯婰婱婲婳婵婶婷婸婹婺婻婼婽婾婿媀媁媂媃媄媅媆媇媈媉媊媋媌媍媎媏媑媒媓媔媕媖媗媘媙媚媛媜媝媞媟媡媢媣媤媥媦媧媨媩媪媬媭媮媯嫏媐媰媱媲媳媴媶媷媸媹媻媼媽媾媿嫀嫁嫂嫃嫄嫅嫆嫇嫉嫊嫋嫌嫍嫎嫒嫔嫕嫖嫗嫘嫙嫚嫛嫜嫝嫞嫟嫠嫡嫢嫣嫤嫥嫦嫧嫩嫪嫫嫬嫭嫮嫯嫰嫱嫲嫳嫴嫵嫶嫷嫸嫹嫺嫻嫼嫽嫾嫿嬀嬂嬃嬄嬅嬆嬇嬈嬉嬋嬌嬍嬏𡢃嬐嬑嬒嬓嬕嬖嬗嬘嬙嬚嬛嬜嬝嬞嬟嬠嬡嬢嬴㜮嬣嬤嬥嬦嬧嬨嬩嬪嬫嬬嬭嬮嬯嬰嬱嬳嬵嬶嬷嬸嬺嬻嬼嬹嬾嬿㜷孀孁孂孃孄孅孆孇孈孉孊孋孌孍孎孏安汝娄籹耍肗要邚釹钕"
    --keyword "㑁咄屈㤕拙昢朏柮欪泏炪础祟窋笜粜絀绌聉胐茁袦詘诎貀趉鈯韷飿饳黜"
    --keyword "伢冴厊呀岈庌㤉㧎枒𤘅牚犽玡疨砑穿笌芽蚜衺訝讶谺迓邪釾閕雅颬鴉鸦齖"
    --keyword "坹屄岤帘㧒柼泬狖穵究穷穸穹空穻穼穽穾穿窀突窂窃窄窅窆窇窈窉窊窋窌窍窎窏窐窑窒窔窕窖窗窘窙窚窜窝窞窟窠窡窢窣窤窥窦窧窨窩窪窫窬窭窮窯窰窱窲窳窴窵窶窷窸窹窺窻窼窽窾窿竁竂竄竅竆竇竉茓袕貁鴥鴪"
    --keyword "唿惚㧾淴鍃锪"
    --keyword "妉帎忱抌枕沈沊瓭㽎眈紞耽衴訦躭邥酖鈂馾髧魫鴆鸩黆黕"
    --keyword "偡勘卙啿堪夦媅尠嵁愖戡揕斟椹歁湛煁㽎瘎碪糂葚諶谌踸鍖黮"
    --keyword "冒泪狊盯䀐盰盱盲盳盵盶盷相盹盺盻盼盽盿眀省眂眃眄眅眆眇眈眉眊看眍眎眏眐眑眒眓眕眖眗眘眙眚眛眜眝眠眡眢眣眤眥眦眧眨眩眪眫眬眿眭眮眯眰眱眲眳眴眵眶眸眹眺眻眼眽睁䀯䀴着睃睄睅睆睇睈睉睊睋睌睍睎睏睐睑睒睓睔睕睖睗睙睚睛睜睝睞睟睠睢督睤睥睦睧睨睩睫睬睭睡睮睯睰睱睲睳睴睵睶睷睸睹睺睻睼睽瞀瞁瞃瞄瞅瞆瞇瞈瞉瞊瞋瞌瞍瞎瞐瞑瞒瞓𥉌瞔瞕瞖瞗瞘瞙瞚瞛瞜瞝瞞瞟瞠瞡瞣䁯瞤瞥瞦瞧瞨瞩瞪瞫瞬瞭瞯瞰瞱瞲瞳瞴瞵瞶瞷瞸瞹瞺瞻瞼瞽矀矁矂矃矄矅矆矇矉矊矋矌矎矏𥌚矐矑矒矓矔𥍉矕矘矙矖矚窅苜見貝鉬钼"
    --keyword "浊烛独痋茧萤虬虭虮虯虰虲虳虴虵虶虷虸虹虺虻虼虽虾虿蚀蚁蚂蚃蚄蚅蚆蚇蚉蚊蚋蚌蚍蚎蚏蚐蚑蚒蚓蚔蚕蚖蚗蚘蚙蚚蚛蚜蚝蚞蚟蚠蚡蚢蚣蚤蚥蚦蚧蚨蚩蚪蚬蚫蚭蚮蚯蚰蚱蚲蚳蚴蚵蚶蚷蚸蚹蚺蚻蚼蚽蚾蚿蛀蛁蛂蛃蛄蛅蛆蛇蛈蛉蛊蛋蛌蛎蛏﨡𧉟𧊅䖳蚈蛐蛑蛒蛓蛔蛕蛗蛘蛙蛚蛛蛜蛝蛞蛟蛠蛡蛢蛣蛤蛥蛦蛧蛨蛩蛪蛫蛬蛭蛮蛯蛰蛱蛲蛳蛴蛖蛵蛶蛷蛸蛹蛺蛻蛼蛽蛾蛿蜂蜃蜄蜅蜆蜇蜈蜉蜊蜋蜌蜍蜎蜏蜐蜑蜒蜓蜔蜕蜖蜗蜫蝆䗁䗆蜘蜙蜚蜛蜜蜝蜞蜟蜠蜡蜢蜣蜤蜥蜦蜧蜨蜩蜪蜬蜭蜮蜯蜰蜱蜲蜳蜴蜵蜶蜷蜸蜹蜺蜻蜼蜽蜾蜿蝀蝁蝂蝃蝄蝅蝇蝈蝉蝊蝋𧌄𬠖䗐蝌蝍蝎蝏蝐蝑蝒蝓蝔蝕蝖蝗蝘蝙蝚蝛蝜蝝蝞蝟蝠蝡蝢蝣蝤蝥蝦蝧蝩蝪蝫蝬蝭蝮蝯蝰蝲蝳蝴蝵蝶蝷蝸蝺蝻蝼蝽蝾螀蟡蝹螁螂螃螄螅螆螇螈螉螊螋螌融螎螏螐螑螓螔螕螖螗螘螚螛螜螝螞螟螠螢螥螦螧螨螩螪螫螬螭螮螯螰螱螲螳螴螵螷螸螹螺螻螼螾螿蟀蟂蟃蟄蟅蟆蟇蟈蟉蟋蟌蟍蟎蟏蟐蟑蟒蠁蟓蟔蟕蟖蟘蟙蟚蟛蟜蟝蟞蟟蟠蟢蟣蟤蟥蟦蟧蟨蟩蟪蟫蟬蟭蟮蟯蟰蟱蟲蟳蟴蟵蠎蟶蟷蟹蟺蟻蟼蟽蟾蠀蠂蠃蠄蠅蠆蠇蠈蠉蠊蠋蠌蠍蠏蠐蠑蠒蠓蠔蠕蠖蠗蠘蠙蠛蠜蠝蠞蠟蠣蠴䘆蠥蠦蠨蠩蠪蠬蠮蠰蠳蠵蠷蠸蠻蠼蠾触赨鉵閩闽"
    --keyword "塟蒸爇萬繤艺艻艼艽艾艿芀芁芃芄芅芆芇芉芊芋芌芍芎芏芐芑芒芓芕芖芗芘芙芚芛芜芝芞芟芠芡芢芣芤芥芦芧芨芩芪芫芬芭芮芯芰花芲芳芴芵芶芷芸芹芺芼芽芾苀苁苂苃苄苅苆苇苈苉苊苋苌苍苎苏茾芿苐苑苒苓苔苕苖苗苘苙苚苛苜苝苞苟苠苡苢苣苤若苦苧苨苩苪苫苬苭苮苯苰英苲苳苴苵苶苷苸苹苺苻苼苽苾苿茀茁茂范茄茅茆茇茈茉茊茋茌茍茎茏茐茑茓茒茖茗茘茙茚茛茜茞茟茠茡茢茤茥茦茧茨茩茪茫茬茭茮茯茱茲茳茴茵茷茸茹茺茼茽茿荀荁荂荃荄荅荇荈草荊荋荌荍荎荏荐荑荒荔荕荖荗荘荙荚荛荜荝荞荟荠荡荢荣荤荥荨荩荪荫荬荭荮药茝茣荰荱荲荳荴荵荶荷荸荹荺荻荼荽荾荿莀莁莂莃莄莅莆莇莈莉莊莋莌莍莎莏莐莑莒莓莔莕莖莗莘莙莚莛莜莝莞莟莠莡莢莣莤莥莦莧莨莩莪莫莬莮莯莰莱莲莳莴莵莶获莸莼荓莾莿菀菁菂菃菄菅菆菇菈菉菊菋菌菍菎菏菑菒菓菔菕菖菗菘菙菚菛菜菝菞菟菠菡菢菣菤菥菦菧菨菩菪菬菭菮菰菱菲菳菴菵菶菷菸菹菺菻菼菽菾菿萀萁萂萃萄萅萆萇萉萊萋萌萍萎萏萐萑萒萓萔萕萖萗萘萙萚萜萝萟萠萡萢萣萧著莭萩萪萫萭萮萯萰萱萲萳萴萵萶萷萸萹萺萻萼落萾萿葀葁葂葃葄葅葆葇葈葉葊葋葌葍葎葏葐葑葒葓葔葕葖葘葙葚葛葜葝葞葟葠葡葢董葤葥葦葧葨葩葪葫葭葮葯葰葱葲葳葴葵葶葷葸葹葺葻葼葽葾葿蒀蒁蒂蒃蒄"
    --keyword "字宁宂它宄宅宆宇守安宊宋完宍宎宏宑宒宓宔宕宖宗官宙宛宜宝实実宠审客宣室宥宦宨宩宪宫㝗宧宬宭宮宯宰宱宲宴宵家宷宸容宺宽宾宿寀寁寂寃寄寈寉寊富寏寑寓寔寪寖寘寙寚寛㝩寞察寠寥實審寫寬寭寮寯寰寲寴寵寷惌梥灾牢賔"
    --keyword "亗仙仚冚喦圸奾密乢屲屳屴屵屶屷屸屹屺屻屼屽屾屿岁岂岃岄岅岆岇岈岉岊岋岌岎岏岐岑岒岓岔岕岖岗岘岙岚岜岝岞岟岠岢岣岤岥岦岧岨岩岪岫岬岭岮岯岰岱岲岳岴岵岶岷岸岹岺岻岼岽岾岿峀峁峂峄峅岍峆峇峈峉峊峋峌峍峎峏峐峑峒峓峔峕峖峗峘峙峚峛峜峝峞峟峠峡峢峣峤峥峦峧峨峩峪峫峬峭峮峯峰峲峳峴峵峷峸峹峺峻峼峽峾峿崀崁崂崃崄崅崆崇崈崉崊崌崍崎崏崐崑崒崓崔崕崖崗崘崙崚崛崜崝崞崟崠崡崢崣崤崥崦崧崨崩崪崫崬崭崮崯崰崱崲崳崴崵崶崷崸崹崺崻崼崽崾崿嵀嵁嵂嵃嵄嵅嵆嵈嵉嵋嵌嵍嵎嵏嵐嵑嵒嵓嵔嵕嵖嵘嵙嵚嵛嵜嵝﨑㟴嵊嵟嵠嵡嵢嵣嵥嵦嵧嵨嵩嵪嵫嵬嵭嵮嵯嵰嵱嵲嵳嵴嵵嵶嵷嵸嵹嵺嵻嵼嵽嵾嵿嶀嶁嶂嶃嶄嶅嶆嶇嶈嶉嶊嶋嶌嶍嶎嶐嶑嶒嶓嶔嶕嶖嶗嶘嶙嶚嶛嶜嶝嶞嶟嶠嶡嶢嶣嶤嶥嶦嶧嶩嶪嶫嶬嶮嶯嶰嶱嶲嶴嶵嶶嶷嶸嶹嶺嶼嶽嶾嶿巁嶻巃巄巅巆巇巈巉巊巋巌巍巏巐巎巑巒巓巔巗巖巘巙巚幽旵杣氙汕汖灿炭疝秈籼耑舢訔訕讪豈赸軕辿邖閊"
    --keyword "倥啌埪崆悾控曌椌涳焢瞾硿箜羫聜腔谾躻鞚鵼"
    --keyword "扎扐扑扒打扔払扖扏扗托扙扚扛扜扝扞扠扡扢扣扤扦执扨扩扪扫扬㧌㧎扟扭扮扯扰扱扲扳扴扵扶扷批扺扻扼扽找技抁抂抃抄抅抆抇抈抉把抋抌抍抎抏抐抑抒抓抔投抖抗折抙抚抛抜抝択抟抠抡抢抣护报𢪱㧒扸抦抧抨抩抪披抬抭抮抯抰抱抲抳抴抵抶抷抸抹抺抻押抽抾抿拀拁拂拃拄担拆拇拈拉拊拌拍拎拐拑拒拓拔拕拖拗拘拙拚招拞拟拠拡拢拣拤拥拦拧拨择𫝺㧡㧣拪拫括拭拮拯拰拱拴拵拶拷拸拹拺拻拼拽拾挀持挂挃挄挅挆指按挊挋挌挍挎挏挑挒挓挔挕挖挗挘挜挝挞挟挠挡挢挣挤挥挦挧𢫦𫝻挨挩挪挫挬挭挮振挰挱挳挴挵挶挷挸挹挺挻挼挽挾挿捀捁捂捃捄捅捆捇捈捉捊捋捌捍捎捏捐捒捓捔捕捖捗捘捙捚捛捝捞损捠捡换捣捤㧻㧾㨂捥捦捧捨捩捪捫捬捭据捰捱捲捳捴捵捶捷捸捹捺捻捼捽捾捿掀掁掂掃掄掅掆掇授掉掊掋掍掎掏掐掑排掓掕掖掗掘掙掚掛掜掝掞掟掠採探掤接掦控推掩措掫掬掭掮掯掳掴掵掶掷掸掹掺掻掼掽㨑掲掾掿揀揁揂揃揄揆揇揈揉揊揋揌揍揎描提揑插揓揔揕揖揗揘揙揚換揜揝揞揟揠揢揣揤揥揨揩揪揬揭揮揯揰揲揳援揵揶揷揸揹揻揼揽揾揿搀搁搂搃搄搅摒𢯭𢯾㨨㨪搆搇搈搉搊搋搌損搎搏搐搑搒搓搔搕搗搘搙搚搛搜搝搞搟搠搡搢搣搤搥搦搧搨搩搪搬搭搮搯搰搲搳搵搶搷搸搹携搼搽搾摀摁摃摄摅摆摇摈摉摊𢱤摋摌摍摎摏摐摑摓摔"
    --keyword "丗丯乫伽冄农刄办匁包另叻咖哿嗧嘉坐夹妿幽弐戋拁架枷毠泇珈甴电畞痂笳耞茄袈譱賀贺跏迦鉫隺駕驾鴐龙"
    --keyword "喀愘愙揢楁碦額额髂"
    --keyword "佫咯嗠垎客峈峉𢓜恪挌敋𢼛格洛洜烙狢珞略畧硌笿絡络胳臵茖蛒衉袼觡詻貉賂赂路輅辂酪鉻铬閣阁雒頟餎饹駱骆骼鮥鴼鵅"
    --keyword "呚坆孜收攷改攺攻攼攽放政敀敂敃敄故敇效敉敋敌啟敎敏敐救敒敓敔敕敗敘教敚敛敜敝敞敟敦敨敩敪敭敬数敳敵敶敷數敾敿斁斂贁斆枚炇牧玫畋致變败赦駇"
    --keyword "攵敁𢼌敆敊𢼛敍㪐㪗敠敡敤敥敧敮敯敱敲敺敼敽斀斅軙鈙鼔"
    --keyword "仿坊妨彷房放斺於施旀旈旉旑旔旘旙昉昘枋汸牥瓬眆祊紡纺肪舫芳蚄訪访趽䢍邡鈁钫閍防雱髣魴鲂鴋"
    --keyword "偉喡圍媁幃徫愇暐椲湋煒瑋禕稦緯葦衛褘諱違郼鍏闈韌韍韎韏韐韑韒韓韔韕韖韗韘韙韚韜韝韞韟韠韡韢韣韤韥颹"
    --keyword "倰凌堎婈崚庱掕棱淩睖碐祾稜綾绫菱裬踜輘錂陵鯪鲮"
    --keyword "嚓擦檫聺鑔镲"
    --keyword "俆凃叙唋峹嵞庩徐悆悇捈敍敘斜梌涂狳畬畭硢稌筡艅荼蜍賖途酴除雓餘馀駼鮽鵌"
    --keyword "倲凍埬娻崠崬㨂棟氭涷腖菄蝀諌錬陳鯟鶇"
    --keyword "剳匒嗒塔搭榙溚瘩𥉌褡鎝鞳"
    --keyword "佋刟劭卲叧叨妱岧岹巶弨怊招昭柖欩沼炤牊玿眧祒笤紹绍苕蛁袑詔诏貂超軺轺迢邵鉊鞀韶駋髫鮉䳂鼦齠龆"
    --keyword "住妵宔往拄柱殶注炷玊疰砫紸罜蛀註跓軴迬鉒飳駐驻麈黈"
    --keyword "偉喡圍媁幃徫愇暐椲湋煒瑋禕稦緯葦衛褘諱違郼鍏闈韌韍韎韏韐韑韒韓韔韕韖韗韘韙韚韜韝韞韟韠韡韢韣韤韥颹"
    --keyword "佻咷垗姚宨庣恌挑晀晁朓桃洮烑狣珧𤶃眺祧窕筄絩罀聎脁覜誂趒跳䠷逃銚铫雿鞉頫餆駣鮡鴵鼗"
    --keyword "祁耶邒邓邔邖邗邘邙邚邛邜邝邞邟邠邡邢邤邥邦邧邨邩邪邬邭邮邯邰邱邲邳邴邵邶邷邸邹邺邻邼邽邾邿郀郁郂郃郄郅郆郇郈郉郊郋郍郏郐郑郓郔郕郖郗郘郙郚郛郜郝郞郟郠郡郢郣郤郥郦郧部郩郪郫郬郭郮郯郱郲郳郴郵郸郹郼都郾郿鄀鄁鄂鄃鄄鄅鄆鄇鄈鄋鄌鄍鄎鄏鄐鄑鄒鄓鄔鄖鄗鄘鄙鄚鄛鄜鄝鄞鄟鄠鄡鄢鄣鄤鄥鄦鄧鄩鄪鄫鄬鄭鄮鄯鄰鄱鄲鄳鄴鄵鄶鄷鄸鄹鄺鄻鄼鄽鄾鄿酀酂酁酃酄酅酆酇酈阞队阠阡阢阣阤阥阦阧阨阩阪阫阬阭阮阯阰阱防阳阴阵阶阷阸阹阺阻阼阽阾阿陀陁陂陃附际陆陇陈陉陊陋陌降陎陏限陑陒陓陔陕陖陗陘陙陛陜陝陞陟陠陡院陣除陦陧陨险陚陪陫陬陭陮陯陰陱陲陳陴陵陶陷陸険陻陼陽陾陿隀隁隃隄隅隇隈隊隌隍階随隐隑隒隓隔隕隖隗隘隙﨩隚際障隝隞隟隠隡隢隣隤隥隦隧隨隩險隫隬隭隮隯隰隱隴隵"
    --keyword "丗丯佮冄农冾刄办匁包匌匼哈坐垥夹姶峆峇帢幽弇弐恰戋拾拿搻敆樖欱洽烚珨甴电畞畣盒硆祫秴答粭給给翕翖耠荅蛤袷詥譱跲郃鉿铪閤隺鞈韐頜颌餄饸鮯鴿鸽龙龕龛"

cd C:\Max\Documents\kurewa-gothic\orig
python \max\sh\generate_glyphs.py --font ZenKurenaido-Regular.ttf ^
    --font_size 384 ^
    --canvas_size 384 ^
    --y_offset=-111 ^
    --disable_auto_fit ^
    --clear ^
    --keyword "丗丯佮冄农冾刄办匁包匌匼哈坐垥夹姶峆峇帢幽弇弐恰戋拾拿搻敆樖欱洽烚珨甴电畞畣盒硆祫秴答粭給给翕翖耠荅蛤袷詥譱跲郃鉿铪閤隺鞈韐頜颌餄饸鮯鴿鸽龙龕龛"


@...................................................
@ mix all
@...................................................

set target=C:\Max\Documents\zi2zi-pytorch\experiments\infer\0_48019_tc
xcopy /y C:\Max\Documents\kurewa-gothic\orig\png-maybe\*.png %target%
xcopy /y C:\Max\Documents\kurewa-gothic\orig\png-good\*.png %target%


@...................................................
@ paired image to croped image
@...................................................
set target=C:\Max\Documents\zi2zi-pytorch\experiments\infer\0_48019_tc
rd /q/s %target%_crop
python \max\sh\crop_images.py --input=%target% --output=%target%_crop

@...................................................
@ smooth, overwrite _crop image.
@...................................................
set target=C:\Max\Documents\zi2zi-pytorch\experiments\infer\0_48019_tc
python \max\sh\smooth_pattern.py --input=%target%_crop --output=%target%_crop

@...................................................
@ pbm to svg, from _crop to _svg
@...................................................
set target=C:\Max\Documents\zi2zi-pytorch\experiments\infer\0_48019_tc
rd /q/s %target%_svg
python \max\sh\bmp_to_svg.py --input %target%_crop --output %target%_svg


@...................................................
@ svg simplify
@...................................................
set target=C:\Max\Documents\zi2zi-pytorch\experiments\infer\0_48019_tc
rd /q/s %target%sp_svg
python c:\max\sh\svg_simplify.py --input %target%_svg --output %target%sp_svg

@...................................................
@ import svg
@...................................................
set target=C:\Max\Documents\zi2zi-pytorch\experiments\infer\0_48019_tc
cd C:\Max\Documents\kurewa-gothic\orig
fontforge c:\max\sh\import_svg.py --input empty_384.ttf --output imported_384_tc.ttf --svg_path %target%sp_svg

@...................................................
@ get not duplicated set.
@...................................................
cd C:\Max\Documents\kurewa-gothic\orig
fontforge \max\sh\font_delete_font.py --input imported_384_tc.ttf --remove KurewaGothicCjkTc-Regular.ttf --output diff_tc.ttf

@ 取得 duplicated
fontforge \max\sh\font_delete_font.py --input imported_384_tc.ttf --remove diff_tc.ttf --output duplicated.ttf

@ 取得 diff char list. 
fontforge \max\sh\get_ttf_chars.py duplicated.ttf

@ 回到 fontforge 開啟 Window - New Metricks Window 進行 duplicated.txt 文字清單比對
@ ...

@...................................................
@ get not duplicated set.
@...................................................
@ open diff_tc.ttf, resize to 1000x1000.


# for Windows, with &#91;Jp]
cd C:\Max\Documents\kurewa-gothic\orig\
fontforge \max\sh\expand_stroke.py --input KurewaGothicCjkJp-Regular.ttf --width 26 --expand_direction light --stroke_cap nib --stroke_join nib --output KurewaGothicCjkJp-ExtraLight.sfdir --fontname "KurewaGothicCjkJp-ExtraLight" --fullname "KurewaGothicCjkJp ExtraLight" --weight "Extra-Light" --macstyle 0 
fontforge \max\sh\expand_stroke.py --input KurewaGothicCjkJp-Regular.ttf --width 14 --expand_direction light --stroke_cap nib --stroke_join nib --output KurewaGothicCjkJp-Light.sfdir --fontname "KurewaGothicCjkJp-Light" --fullname "KurewaGothicCjkJp Light" --weight "Light" --macstyle 0 
fontforge \max\sh\expand_stroke.py --input KurewaGothicCjkJp-Regular.ttf --width 20 --expand_direction bold --stroke_cap nib --stroke_join nib --output KurewaGothicCjkJp-SemiBold.sfdir --fontname "KurewaGothicCjkJp-SemiBold" --fullname "KurewaGothicCjkJp SemiBold" --weight "SemiBold" --macstyle 0 
fontforge \max\sh\expand_stroke.py --input KurewaGothicCjkJp-Regular.ttf --width 30 --expand_direction bold --stroke_cap nib --stroke_join nib --output KurewaGothicCjkJp-Bold.sfdir --fontname "KurewaGothicCjkJp-Bold" --fullname "KurewaGothicCjkJp Bold" --weight "Bold" --macstyle 1

# for Windows, with &#91;Tc]
cd C:\Max\Documents\kurewa-gothic\orig\
fontforge \max\sh\expand_stroke.py --input KurewaGothicCjkJp-Regular.ttf --width 26 --expand_direction light --stroke_cap nib --stroke_join nib --output KurewaGothicCjkJp-ExtraLight.sfdir --fontname "KurewaGothicCjkJp-ExtraLight" --fullname "KurewaGothicCjkJp ExtraLight" --weight "Extra-Light" --macstyle 0 
fontforge \max\sh\expand_stroke.py --input KurewaGothicCjkJp-Regular.ttf --width 14 --expand_direction light --stroke_cap nib --stroke_join nib --output KurewaGothicCjkJp-Light.sfdir --fontname "KurewaGothicCjkJp-Light" --fullname "KurewaGothicCjkJp Light" --weight "Light" --macstyle 0 
fontforge \max\sh\expand_stroke.py --input KurewaGothicCjkJp-Regular.ttf --width 20 --expand_direction bold --stroke_cap nib --stroke_join nib --output KurewaGothicCjkJp-SemiBold.sfdir --fontname "KurewaGothicCjkJp-SemiBold" --fullname "KurewaGothicCjkJp SemiBold" --weight "SemiBold" --macstyle 0 
fontforge \max\sh\expand_stroke.py --input KurewaGothicCjkJp-Regular.ttf --width 30 --expand_direction bold --stroke_cap nib --stroke_join nib --output KurewaGothicCjkJp-Bold.sfdir --fontname "KurewaGothicCjkJp-Bold" --fullname "KurewaGothicCjkJp Bold" --weight "Bold" --macstyle 1


# for Windows, with &#91;Jp]
cd C:\Max\Documents\kurewa-gothic\orig\
python /Max/sh/replace_string.py KurewaGothicCjkJp-ExtraLight.sfdir\font.props "Regular" "ExtraLight"
python /Max/sh/replace_string.py KurewaGothicCjkJp-Light.sfdir\font.props "Regular" "Light"
python /Max/sh/replace_string.py KurewaGothicCjkJp-SemiBold.sfdir\font.props "Regular" "SemiBold"
python /Max/sh/replace_string.py KurewaGothicCjkJp-Bold.sfdir\font.props "Regular" "Bold"

python /Max/sh/replace_string.py KurewaGothicCjkJp-ExtraLight.sfdir\font.props "TTFWeight: 400" "TTFWeight: 300"
python /Max/sh/replace_string.py KurewaGothicCjkJp-Light.sfdir\font.props "TTFWeight: 400" "TTFWeight: 300"
python /Max/sh/replace_string.py KurewaGothicCjkJp-SemiBold.sfdir\font.props "TTFWeight: 400" "TTFWeight: 600"
python /Max/sh/replace_string.py KurewaGothicCjkJp-Bold.sfdir\font.props "TTFWeight: 400" "TTFWeight: 700"

# for Windows, with &#91;Tc]
cd C:\Max\Documents\kurewa-gothic\orig\
python /Max/sh/replace_string.py KurewaGothicCjkTc-ExtraLight.sfdir\font.props "Regular" "ExtraLight"
python /Max/sh/replace_string.py KurewaGothicCjkTc-Light.sfdir\font.props "Regular" "Light"
python /Max/sh/replace_string.py KurewaGothicCjkTc-SemiBold.sfdir\font.props "Regular" "SemiBold"
python /Max/sh/replace_string.py KurewaGothicCjkTc-Bold.sfdir\font.props "Regular" "Bold"

python /Max/sh/replace_string.py KurewaGothicCjkTc-ExtraLight.sfdir\font.props "TTFWeight: 400" "TTFWeight: 300"
python /Max/sh/replace_string.py KurewaGothicCjkTc-Light.sfdir\font.props "TTFWeight: 400" "TTFWeight: 300"
python /Max/sh/replace_string.py KurewaGothicCjkTc-SemiBold.sfdir\font.props "TTFWeight: 400" "TTFWeight: 600"
python /Max/sh/replace_string.py KurewaGothicCjkTc-Bold.sfdir\font.props "TTFWeight: 400" "TTFWeight: 700"

# Build
# for Windows, with &#91;Jp]
cd C:\Max\Documents\kurewa-gothic\orig\
fontforge /Max/sh/generate.py -i KurewaGothicCjkJp-ExtraLight.sfdir
fontforge /Max/sh/generate.py -i KurewaGothicCjkJp-Light.sfdir
fontforge /Max/sh/generate.py -i KurewaGothicCjkJp-SemiBold.sfdir
fontforge /Max/sh/generate.py -i KurewaGothicCjkJp-Bold.sfdir

# for Windows, with &#91;Tc]
cd C:\Max\Documents\kurewa-gothic\orig\
fontforge /Max/sh/generate.py -i KurewaGothicCjkTc-ExtraLight.sfdir
fontforge /Max/sh/generate.py -i KurewaGothicCjkTc-Light.sfdir
fontforge /Max/sh/generate.py -i KurewaGothicCjkTc-SemiBold.sfdir
fontforge /Max/sh/generate.py -i KurewaGothicCjkTc-Bold.sfdir


# Webfont
# for Windows, with &#91;Jp]
cd C:\Max\Documents\kurewa-gothic\orig\
rd /q/s "webfont\CJK JP"
mkdir "webfont\CJK JP"
fontforge \max\sh\generate.py --input KurewaGothicCjkJp-Regular.ttf       --output ".\webfont\CJK JP\KurewaGothicCjkJp-Regular.woff"
fontforge \max\sh\generate.py --input KurewaGothicCjkJp-Regular.ttf       --output ".\webfont\CJK JP\KurewaGothicCjkJp-Regular.woff2"
fontforge \max\sh\generate.py --input KurewaGothicCjkJp-ExtraLight.ttf    --output ".\webfont\CJK JP\KurewaGothicCjkJp-ExtraLight.woff"
fontforge \max\sh\generate.py --input KurewaGothicCjkJp-ExtraLight.ttf    --output ".\webfont\CJK JP\KurewaGothicCjkJp-ExtraLight.woff2"
fontforge \max\sh\generate.py --input KurewaGothicCjkJp-Light.ttf         --output ".\webfont\CJK JP\KurewaGothicCjkJp-Light.woff"
fontforge \max\sh\generate.py --input KurewaGothicCjkJp-Light.ttf         --output ".\webfont\CJK JP\KurewaGothicCjkJp-Light.woff2"
fontforge \max\sh\generate.py --input KurewaGothicCjkJp-SemiBold.ttf      --output ".\webfont\CJK JP\KurewaGothicCjkJp-SemiBold.woff"
fontforge \max\sh\generate.py --input KurewaGothicCjkJp-SemiBold.ttf      --output ".\webfont\CJK JP\KurewaGothicCjkJp-SemiBold.woff2"
fontforge \max\sh\generate.py --input KurewaGothicCjkJp-Bold.ttf          --output ".\webfont\CJK JP\KurewaGothicCjkJp-Bold.woff"
fontforge \max\sh\generate.py --input KurewaGothicCjkJp-Bold.ttf          --output ".\webfont\CJK JP\KurewaGothicCjkJp-Bold.woff2"

# for Windows, with &#91;Tc]
cd C:\Max\Documents\kurewa-gothic\orig\
rd /q/s "webfont\CJK TC"
mkdir "webfont\CJK TC"
fontforge \max\sh\generate.py --input KurewaGothicCjkTc-Regular.ttf       --output ".\webfont\CJK TC\KurewaGothicCjkTc-Regular.woff"
fontforge \max\sh\generate.py --input KurewaGothicCjkTc-Regular.ttf       --output ".\webfont\CJK TC\KurewaGothicCjkTc-Regular.woff2"
fontforge \max\sh\generate.py --input KurewaGothicCjkTc-ExtraLight.ttf    --output ".\webfont\CJK TC\KurewaGothicCjkTc-ExtraLight.woff"
fontforge \max\sh\generate.py --input KurewaGothicCjkTc-ExtraLight.ttf    --output ".\webfont\CJK TC\KurewaGothicCjkTc-ExtraLight.woff2"
fontforge \max\sh\generate.py --input KurewaGothicCjkTc-Light.ttf         --output ".\webfont\CJK TC\KurewaGothicCjkTc-Light.woff"
fontforge \max\sh\generate.py --input KurewaGothicCjkTc-Light.ttf         --output ".\webfont\CJK TC\KurewaGothicCjkTc-Light.woff2"
fontforge \max\sh\generate.py --input KurewaGothicCjkTc-SemiBold.ttf      --output ".\webfont\CJK TC\KurewaGothicCjkTc-SemiBold.woff"
fontforge \max\sh\generate.py --input KurewaGothicCjkTc-SemiBold.ttf      --output ".\webfont\CJK TC\KurewaGothicCjkTc-SemiBold.woff2"
fontforge \max\sh\generate.py --input KurewaGothicCjkTc-Bold.ttf          --output ".\webfont\CJK TC\KurewaGothicCjkTc-Bold.woff"
fontforge \max\sh\generate.py --input KurewaGothicCjkTc-Bold.ttf          --output ".\webfont\CJK TC\KurewaGothicCjkTc-Bold.woff2"

</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://max-everyday.com/2025/12/antigravity-kurewa-tutorial/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>用 antigravity 製作中文部件查詢網頁</title>
		<link>https://max-everyday.com/2025/12/antigravity-dictionary-web/</link>
					<comments>https://max-everyday.com/2025/12/antigravity-dictionary-web/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Thu, 18 Dec 2025 19:16:24 +0000</pubDate>
				<category><![CDATA[生活小事]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[Google]]></category>
		<guid isPermaLink="false">https://max-everyday.com/?p=22575</guid>

					<description><![CDATA[AI 太神奇了, 在開發的過程, 會測試的過程也是全自動的, 驗證的過程也會自動去截圖檢查. 目前版本就可以執行的很順暢, 如果持續與 AI 對話, 應該系統的執行效率可 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="501" src="https://max-everyday.com/wp-content/uploads/2025/12/dictionary-cover-1920-1024x501.jpg?v=1766084447" alt="" class="wp-image-22578" srcset="https://max-everyday.com/wp-content/uploads/2025/12/dictionary-cover-1920-1024x501.jpg?v=1766084447 1024w, https://max-everyday.com/wp-content/uploads/2025/12/dictionary-cover-1920-500x245.jpg?v=1766084447 500w, https://max-everyday.com/wp-content/uploads/2025/12/dictionary-cover-1920-615x301.jpg?v=1766084447 615w, https://max-everyday.com/wp-content/uploads/2025/12/dictionary-cover-1920.jpg?v=1766084447 1472w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>AI 太神奇了, 在開發的過程, 會測試的過程也是全自動的, 驗證的過程也會自動去截圖檢查. </p>



<p>目前版本就可以執行的很順暢, 如果持續與 AI 對話, 應該系統的執行效率可以再大大的改善, 不過可以動動手指就寫出來好專業的網站, 現在的 AI 非常厲害.</p>



<p>新的工具(antigravity) 對程式小白(不懂寫程式的麻瓜) 非常友善.</p>



<p>遇到的問題, 建議先在外部的瀏覽器, 用不會浪費額度的 AI 問, 瀏覽器 AI 沒辦法處理的與程式高度相依性高的問題, 才在 antigravity 的 IDE 裡提問.</p>



<p>antigravity 運算的額度剩下多少與額度重置時間剩下多久, 可以在 extension 的安裝視窗輸入關鍵字 quota, 安裝好 extension 之後, 想檢視運算額度, 啟動方式在 antigravity IDE 的最右下角。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>製作出來的結果: <a href="https://dictionary.max-everyday.com/">https://dictionary.max-everyday.com/</a></p>



<p>在 antigravity 輸入的對話:</p>



<pre class="wp-block-code"><code>生成一個查詢中文字 "部件" 查詢用網站, 使用者輸入部件的關鍵字, 可以查詢放置在 web server 上的 dictionary.json 中的所有符合部件的文字清單顯示在網頁上, 點擊查詢結果的字之後, 可以觀看該字在 dictionary.json 中的完整資訊. 
如何使用該 dictionary.json 可以參考 chinese_dictionary.py 與 find_component.py</code></pre>



<p>YouTube 解說: <a href="https://youtu.be/2H79xUDXaSE">https://youtu.be/2H79xUDXaSE</a></p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<div class="gutenbee-responsive-embed"><iframe loading="lazy" title="用 antigravity 製作中文部件查詢網頁" width="885" height="498" src="https://www.youtube.com/embed/2H79xUDXaSE?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
</div></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>antigravity 的規畫: </p>



<h2 class="wp-block-heading" id="user-content-中文部件查詢網站---完成報告">中文部件查詢網站 &#8211; 完成報告</h2>



<p>成功建立了一個中文部件查詢網站，使用者可以輸入部件關鍵字來搜尋包含該部件的所有漢字，並查看每個漢字的完整資訊。</p>



<h2 class="wp-block-heading" id="user-content-建立的檔案">建立的檔案</h2>



<h3 class="wp-block-heading" id="user-content-網站架構">網站架構</h3>



<pre class="wp-block-code"><code>c:\Max\dictionary\web\
├── index.html      # 主頁面結構
├── styles.css      # 樣式表 (暗色主題)
├── app.js          # 應用程式邏輯
├── server.py       # 本地 HTTP 伺服器
└── Dictionary.json # 字典資料 (自動從上層目錄複製)</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading" id="user-content-功能展示">功能展示</h2>



<h3 class="wp-block-heading" id="user-content-1-首頁介面">1. 首頁介面</h3>



<p>網站採用現代暗色主題設計，包含搜尋框和熱門部件快捷按鈕：</p>



<h3 class="wp-block-heading" id="user-content-2-搜尋結果">2. 搜尋結果</h3>



<p>輸入部件「木」後，搜尋到&nbsp;<strong>966</strong>&nbsp;個包含該部件的漢字：</p>



<h3 class="wp-block-heading" id="user-content-3-漢字詳細資訊">3. 漢字詳細資訊</h3>



<p>點擊任意漢字可查看完整資訊，包括：</p>



<ul class="wp-block-list">
<li>基本資訊（Unicode、部首、筆畫數）</li>



<li>部件組成</li>



<li>普通話發音（拼音 &amp; 注音）</li>



<li>粵語、閩南語、客家話發音</li>



<li>異體字和語義變體</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading" id="user-content-技術特點">技術特點</h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">特性</th><th class="has-text-align-left" data-align="left">說明</th></tr></thead><tbody><tr><td><strong>響應式設計</strong></td><td>支援桌面和行動裝置</td></tr><tr><td><strong>效能優化</strong></td><td>搜尋結果限制顯示 500 個以確保流暢性</td></tr><tr><td><strong>動畫效果</strong></td><td>卡片淡入、懸停效果、彈窗動畫</td></tr><tr><td><strong>字典規模</strong></td><td>支援 81,052 個漢字，其中 19,823 個有部件資料</td></tr></tbody></table></figure>



<h2 class="wp-block-heading" id="user-content-如何使用">如何使用</h2>



<h3 class="wp-block-heading" id="user-content-啟動伺服器">啟動伺服器</h3>



<pre class="wp-block-preformatted">cd c:\Max\dictionary\webpython server.py</pre>



<p>伺服器會自動：</p>



<ol class="wp-block-list">
<li>複製&nbsp;Dictionary.json&nbsp;到&nbsp;<code>web</code>&nbsp;目錄</li>



<li>在&nbsp;<a href="http://localhost:8000/">http://localhost:8000</a>&nbsp;啟動服務</li>



<li>自動開啟瀏覽器</li>
</ol>



<h3 class="wp-block-heading" id="user-content-搜尋操作">搜尋操作</h3>



<ol class="wp-block-list">
<li>在搜尋框輸入部件（如「木」、「水」、「火」）</li>



<li>點擊搜尋按鈕或按 Enter</li>



<li>點擊結果中的任意漢字查看詳情</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading" id="user-content-驗證結果">驗證結果</h2>



<ul class="wp-block-list">
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 網站成功載入 81,052 個漢字的字典資料</li>



<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 搜尋「木」找到 966 個符合的漢字</li>



<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 漢字詳情正確顯示所有欄位</li>



<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> UI 動畫和互動效果正常運作</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>優化執行效率</p>



<p>這個專案有一個約&nbsp;<strong>31.6 MB</strong>&nbsp;的&nbsp;Dictionary.json&nbsp;檔案，目前在&nbsp;app.js&nbsp;的&nbsp;loadDictionary()&nbsp;方法中是一次性完整載入整個 JSON 檔案。這會導致：</p>



<ol class="wp-block-list">
<li><strong>初始載入時間長</strong> &#8211; 整個 31MB 的 JSON 需要完全下載並解析</li>



<li><strong>記憶體佔用高</strong> &#8211; 所有資料都存在記憶體中</li>
</ol>



<p>以下是我建議的優化方案：</p>



<h2 class="wp-block-heading">優化方案</h2>



<h3 class="wp-block-heading">1.&nbsp;<strong>使用 Gzip 壓縮</strong>&nbsp;(最簡單有效)</h3>



<p>讓伺服器啟用 gzip 壓縮，JSON 可以壓縮到原本的 10-20%</p>



<h3 class="wp-block-heading">2.&nbsp;<strong>索引預處理</strong>&nbsp;(需要後端支援)</h3>



<p>將 JSON 拆分成索引檔和資料檔，先載入索引，按需載入資料</p>



<h3 class="wp-block-heading">3.&nbsp;<strong>Web Worker 解析</strong>&nbsp;(前端優化)</h3>



<p>將 JSON 解析移到 Web Worker，避免阻塞主線程</p>



<h3 class="wp-block-heading">4.&nbsp;<strong>建立部件索引</strong>&nbsp;(搜尋優化)</h3>



<p>預先建立部件到漢字的映射，加速搜尋</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>如果只針對前端修改，我可以實作以下優化：</p>



<ol class="wp-block-list">
<li><strong>使用 Web Worker</strong> 解析大型 JSON，避免 UI 凍結</li>



<li><strong>建立部件索引結構</strong>，將 O(n) 搜尋優化為 O(1) 查表</li>



<li><strong>增加載入進度提示</strong>，改善使用者體驗</li>
</ol>



<p>你希望我實作哪些優化？或者你有其他想法？</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>上面的運算都是透過 client side compute, 改成使用 server side comput.</p>



<h1 class="wp-block-heading" id="user-content-json-loading-optimization---server-side-processing">JSON Loading Optimization &#8211; Server-Side Processing</h1>



<p>Move&nbsp;<strong>search</strong>&nbsp;and&nbsp;<strong>decompose</strong>&nbsp;logic to PHP backend. Frontend no longer loads the 31MB dictionary.</p>



<h2 class="wp-block-heading" id="user-content-user-review-required">User Review Required</h2>



<p>IMPORTANT</p>



<p><strong>Architecture Change</strong>: Frontend becomes a thin client. All dictionary operations happen on the server via API calls.</p>



<h2 class="wp-block-heading" id="user-content-proposed-changes">Proposed Changes</h2>



<h3 class="wp-block-heading" id="user-content-backend-php">Backend (PHP)</h3>



<h4 class="wp-block-heading" id="user-content-new-apiphp">[NEW]&nbsp;api.php</h4>



<p><strong>Endpoints:</strong></p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">Action</th><th class="has-text-align-left" data-align="left">Parameters</th><th class="has-text-align-left" data-align="left">Response</th></tr></thead><tbody><tr><td>search</td><td><code>keyword</code></td><td>Matching characters with data</td></tr><tr><td>decompose</td><td><code>text</code></td><td>Decomposed components</td></tr><tr><td><code>detail</code></td><td><code>char</code></td><td>Full character data</td></tr></tbody></table></figure>



<p><strong>Features:</strong></p>



<ul class="wp-block-list">
<li>Load dictionary once per request (PHP opcache can optimize)</li>



<li>Use <code>search_index.json</code> for O(1) search</li>



<li>Gzip output via <code>ob_gzhandler</code></li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading" id="user-content-frontend">Frontend</h3>



<h4 class="wp-block-heading" id="user-content-modify-appjs">[MODIFY]&nbsp;app.js</h4>



<pre class="wp-block-preformatted">- this.dictionary = await response.json();  // Load 31MB- const results = this.searchByComponent(keyword); // Client-side search+ const response = await fetch(`api.php?action=search&amp;keyword=${keyword}`);+ const results = await response.json(); // Server returns results only</pre>



<p><strong>Changes:</strong></p>



<ul class="wp-block-list">
<li>Remove loadDictionary() &#8211; no longer needed</li>



<li>Remove client-side searchByComponent() &#8211; moved to PHP</li>



<li>Remove client-side decomposeInput() logic &#8211; moved to PHP</li>



<li>Add API calls for search, decompose, <code>detail</code></li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading" id="user-content-data-preprocessing">Data Preprocessing</h3>



<h4 class="wp-block-heading" id="user-content-keep-optimize_datapy">[KEEP]&nbsp;optimize_data.py</h4>



<ul class="wp-block-list">
<li>Still generates <code>search_index.json</code> for PHP to use</li>
</ul>



<h2 class="wp-block-heading" id="user-content-verification-plan">Verification Plan</h2>



<ol class="wp-block-list">
<li>Deploy to Apache/Ubuntu</li>



<li>Test API endpoints via browser/curl</li>



<li>Verify search response time &lt; 200ms</li>



<li>Verify gzip <code>Content-Encoding</code> in response headers</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>已完成實作。</p>



<p>系統架構已更改為&nbsp;<strong>Server-Side Rendering (Logic)</strong>&nbsp;模式：</p>



<ol class="wp-block-list">
<li><strong>後端 (</strong><strong>api.php)</strong>:
<ul class="wp-block-list">
<li>負責讀取 Dictionary.json 和 <code>search_index.json</code>。</li>



<li>處理 <code>search</code> (搜尋部件)、decompose (拆解漢字) 和 <code>detail</code> (顯示詳情) 的請求。</li>



<li>支援 Gzip 輸出以節省頻寬。</li>
</ul>
</li>



<li><strong>前端 (</strong><strong>app.js)</strong>:
<ul class="wp-block-list">
<li>不再下載巨大的字典檔。</li>



<li>搜尋與拆解功能改為發送 <code>fetch</code> 請求至 api.php。</li>



<li>大幅提升 index.html 的初始載入速度。</li>
</ul>
</li>



<li><strong>資料預處理</strong>:
<ul class="wp-block-list">
<li>已執行 optimize_data.py 產出 <code>search_index.json</code>，供 PHP 快速查詢使用。</li>
</ul>
</li>
</ol>



<p>請參考&nbsp;DEPLOYMENT.md&nbsp;將檔案部署至您的 Ubuntu Apache 伺服器。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>下一個遇到的問題是 json 檔太大, 又沒效率, </p>



<p>The memory exhaustion error was caused by&nbsp;api.php&nbsp;trying to load the entire 33MB&nbsp;Dictionary.json&nbsp;file into memory.</p>



<p>To resolve this, I have:</p>



<ol class="wp-block-list">
<li><strong>Converted Data to SQLite</strong>: Updated optimize_data.py to generate an SQLite database (dictionary.db) from Dictionary.json. I ran this script, and the database file (approx. 35MB) has been created.</li>



<li><strong>Optimized api.php</strong>: Rewrote the backend script to strictly use the new SQLite database.
<ul class="wp-block-list">
<li>It no longer loads Dictionary.json.</li>



<li>It uses search_index.json (small, ~600KB) for fast searching.</li>



<li>It queries dictionary.db only for the specific characters needed (for search results, details, or decomposition).</li>
</ul>
</li>
</ol>



<p>This approach drastically reduces memory usage, as PHP now only holds the data for the few characters being displayed at any one time, rather than the entire dictionary. The error should be resolved.</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://max-everyday.com/2025/12/antigravity-dictionary-web/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>gemini 回覆的內容, 部份單字會以前後加$ 符號, 這是什麼意思?</title>
		<link>https://max-everyday.com/2025/12/gemini-dollar-sign/</link>
					<comments>https://max-everyday.com/2025/12/gemini-dollar-sign/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Mon, 15 Dec 2025 04:20:40 +0000</pubDate>
				<category><![CDATA[電腦相關應用]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[Google]]></category>
		<guid isPermaLink="false">https://max-everyday.com/?p=22556</guid>

					<description><![CDATA[這是一個格式上的問題。在我內部運作時，金錢符號是用來標示一些特殊的內容，例如數學公式或程式碼裡面的變數等等。它們告訴我，這些夾在符號中間的東西是比較正式或技術性的表達。  [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>這是一個<strong>格式</strong>上的問題。在我內部運作時，金錢符號是用來標示一些特殊的內容，例如<strong>數學公式</strong>或<strong>程式碼</strong>裡面的<strong>變數</strong>等等。它們告訴我，這些夾在符號中間的東西是比較正式或技術性的表達。</p>



<p>理論上，我應該只在處理<strong>複雜的數學</strong>或<strong>專業科學內容</strong>時才會使用這個格式。一般來說，我會盡量在日常的問答中把它們移除或轉換成一般的文字。</p>



<p>如果我在回答您的問題時出現了這個符號，那可能是我<strong>內部處理時的一個小疏忽</strong>。它並不是想表達什麼特別的意思，對您閱讀來說，您可以把它當成是<strong>一個普通的詞彙</strong>來看待就好。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>不喜歡複製文字的時候複製到$, 可以下指令給 gemini, 例如:</p>



<pre class="wp-block-code"><code>請以繁體中文回答，偏好回答精簡。不要使用小標題，只要使用段落標題，避免花俏排版，不使用 emoji。寫作特色為口語，但不要使用語尾詞，語句多以短句為主。不要在回答中使用斜體字。特殊的變數內容前後不要另外加$符號。</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="643" src="https://max-everyday.com/wp-content/uploads/2025/12/2025-12-15_12-17_j3-1024x643.jpg" alt="" class="wp-image-22557" srcset="https://max-everyday.com/wp-content/uploads/2025/12/2025-12-15_12-17_j3-1024x643.jpg?v=1765772374 1024w, https://max-everyday.com/wp-content/uploads/2025/12/2025-12-15_12-17_j3-500x314.jpg?v=1765772374 500w, https://max-everyday.com/wp-content/uploads/2025/12/2025-12-15_12-17_j3-615x386.jpg?v=1765772374 615w, https://max-everyday.com/wp-content/uploads/2025/12/2025-12-15_12-17_j3.jpg?v=1765772374 1099w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://max-everyday.com/2025/12/gemini-dollar-sign/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>問 gemini 3.0 pro 一個複雜的問題, 下次發問要等6小時</title>
		<link>https://max-everyday.com/2025/12/gemini-3-pro-student-2025-12-09/</link>
					<comments>https://max-everyday.com/2025/12/gemini-3-pro-student-2025-12-09/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Fri, 05 Dec 2025 09:32:57 +0000</pubDate>
				<category><![CDATA[生活小事]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[Google]]></category>
		<guid isPermaLink="false">https://max-everyday.com/?p=22423</guid>

					<description><![CDATA[歡迎大家來到「知識有價」的時代，要解決遇到的問題，問AI就對了. 於 2025-12-09 前，家裡有正在讀大專院校的小朋友，或是還可以存取 .edu.tw 的 emai [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>歡迎大家來到「知識有價」的時代，要解決遇到的問題，問AI就對了.</p>



<p>於 2025-12-09 前，家裡有正在讀大專院校的小朋友，或是還可以存取 .edu.tw 的 email 信箱的校友或教職員，建議去領取免費 gemini ai pro 一年的使用資格，相當於每個月免費領 NT$650元。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="953" height="787" src="https://max-everyday.com/wp-content/uploads/2025/12/2025-12-05_17-15_gg.jpg?v=1764926508" alt="" class="wp-image-22424" srcset="https://max-everyday.com/wp-content/uploads/2025/12/2025-12-05_17-15_gg.jpg?v=1764926508 953w, https://max-everyday.com/wp-content/uploads/2025/12/2025-12-05_17-15_gg-500x413.jpg?v=1764926508 500w, https://max-everyday.com/wp-content/uploads/2025/12/2025-12-05_17-15_gg-615x508.jpg?v=1764926508 615w" sizes="auto, (max-width: 953px) 100vw, 953px" /></figure>



<p></p>



<p>成大的同學分享, 取得資格之立刻解綁信用卡, 以避免明年被扣款, 中斷了google one, 訂閱的服務還可以用一年</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="806" height="920" src="https://max-everyday.com/wp-content/uploads/2025/12/18493.jpg?v=1764926852" alt="" class="wp-image-22425" srcset="https://max-everyday.com/wp-content/uploads/2025/12/18493.jpg?v=1764926852 806w, https://max-everyday.com/wp-content/uploads/2025/12/18493-438x500.jpg?v=1764926852 438w, https://max-everyday.com/wp-content/uploads/2025/12/18493-615x702.jpg?v=1764926852 615w" sizes="auto, (max-width: 806px) 100vw, 806px" /></figure>



<p></p>



<h2 class="wp-block-heading">相關討論串</h2>



<p>年 Gemini AI Pro與實測心得<br><a href="https://sccareernotes.com/gemini-student-plan-guide/">https://sccareernotes.com/gemini-student-plan-guide/</a></p>



<p>Gemini pro 學生免費一年（教學<br><a href="https://www.dcard.tw/f/ncku/p/260382629?cid=b87ed2b0-55df-4065-8cac-0730fe65e8b0">https://www.dcard.tw/f/ncku/p/260382629?cid=b87ed2b0-55df-4065-8cac-0730fe65e8b0</a></p>



<p>網路上流傳很多奇怪的解法，google 關鍵字: </p>



<pre class="wp-block-code"><code>零度 telegram ai pro 學生 一年</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://max-everyday.com/2025/12/gemini-3-pro-student-2025-12-09/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
