ขออนุญาตถามผู้รู้ครับ
ผม export ฟ้อนต์ด้วยโปรแกรม Glyphs แล้วมีอาการ Error (ตามภาพ)
(http://img3.f0nt.com/04/312b32c144a4f6375f5bd23efe0231ce.png)
จากนั้นพยายามทำตามคำแนะนำ ใน script ของ generateFont.command
..................
makeotfGlyphs [ERROR] <BSRUBANSOMDEJ-Regular> Bad string [features.fea 37]
makeotfGlyphs [ERROR] <BSRUBANSOMDEJ-Regular> Bad string [features.fea 38]
makeotfGlyphs [FATAL] <BSRUBANSOMDEJ-Regular> invalid token (text was "?") [features.fea 43]
logout
[Process completed]
..................
ผมสงสัยว่า [features.fea 37, 38,43] หมายถึงส่วนไหนของ file ครับ แล้วจะแก้อย่างไร
ขอบคุณมากครับ
เดาฮะ
สคริปที่บรรทัดที่ 37 / 38 / 43 รึเปล่าฮะ ?
เดาจาก line: 37 น่าจะเหมือนกัน fontlab
อ้างคำพูดจาก: dhammadha เมื่อ 05 พ.ค. 2015, 10:17 น.
เดาฮะ
สคริปที่บรรทัดที่ 37 / 38 / 43 รึเปล่าฮะ ?
เดาจาก line: 37 น่าจะเหมือนกัน fontlab
ขอบคุณมากครับคุณ dhammadha คลำไปมาแก้ปัญหา 37 / 38 ได้ครับ แต่ 43 แก้ไม่ตก เข้าใจว่าผมน่าจะวางอะไรบางอย่างผิด (แต่ไม่รู้ว่าคืออะไร) ครับ
OpenType feature syntax มันรองรับแค่ตัวอักษร ASCII ครับ makeotfGlyphs เลย gen ไม่ได้ ลองเปิดไฟล์ features.fea ใน text editor ดู แล้วเช็คบรรทัดที่มันแจ้ง Error (ถ้าผมจำไม่ผิด Glyphs app เก็บฟีเจอร์ในโฟลเดอร์ *.ufo)
ขอบคุณมากครับคุณ Sungsit
ผมเพิ่งลองใช้ App นี้ ยังต้องเรียนรู้อีกเยอะเลยครับ
ไฟล์ที่มีสคริปผมเห็นใน features.fea ครับ แต่บรรทัดที่เป็นปัญหาหาไม่เจอครับ
เดี๋ยวจะลองดูครับ
ลองโพสต์โค้ดเต็มๆ ได้ไหมครับ? ใน FontForge ผมเคยเจอกรณี syntax error ที่บรรทัดอื่น แล้วมันเป็นปัญหาพ่วงต่อมาถึงบรรทัดที่มันแจ้ง บางทีมันผิดแค่ไม่ได้ใส่ semicolon ท้ายบรรทัด (;) ผมหาทั้งคืนกว่าจะเจอว่ามันผิดบรรทัดไหน :)
ผมอาจจะตอบช้าไปหน่อยนะครับ ^^
สคริปส์ที่มีปัญหาตามด้านล่างนี้ครับ
ขอบคุณคุณ Sungsit มากครับผม
............
languagesystem DFLT dflt;
languagesystem latn dflt;
languagesystem grek dflt;
table OS/2 {
TypoAscender 850;
TypoDescender -460;
TypoLineGap 60;
winAscent 850;
winDescent 460;
WeightClass 400;
WidthClass 5;
WidthClass 5;
FSType 8;
XHeight 339;
CapHeight 473;
Vendor "BSRU";
} OS/2;
table hhea {
CaretOffset 0;
Ascender 850;
Descender -460;
LineGap 0;
} hhea;
table name {
nameid 0 1 "Copyright (c) 2015 by Wisit Potiwat";
nameid 0 3 1 1033 "Copyright (c) 2015 by Wisit Potiwat";
nameid 1 1 "BSRU BANSOMDEJ";
nameid 1 3 1 1033 "BSRU BANSOMDEJ";
nameid 2 1 "Regular";
nameid 2 3 1 1033 "Regular";
nameid 8 1 "Wisit Potiwat";
nameid 8 3 1 1033 "Wisit Potiwat";
nameid 9 1 "Wisit Potiwat";
nameid 9 3 1 1033 "Wisit Potiwat";
nameid 10 1 "Copyright (c) 2015 by Wisit Potiwat. All rights reserved.";
nameid 10 3 1 1033 "Copyright (c) 2015 by Wisit Potiwat. All rights reserved.";
nameid 11 1 "https://www.behance.net/wpotiwat818e";
nameid 11 3 1 1033 "https://www.behance.net/wpotiwat818e";
nameid 12 1 "https://www.behance.net/wpotiwat818e";
nameid 12 3 1 1033 "https://www.behance.net/wpotiwat818e";
nameid 13 1 "This Font Program is for free both for personal and commercial use, under a Creative Commons. Copyright (c) 2015 by Wisit Potiwat. All rights reserved.";
nameid 13 3 1 1033 "This Font Program is for free both for personal and commercial use, under a Creative Commons. Copyright (c) 2015 by Wisit Potiwat. All rights reserved.";
nameid 14 1 "–";
nameid 14 3 1 1033 "–";
} name;
feature frac {
sub one slash two by onehalf;
sub one slash three by onethird;
sub one slash four by onequarter;
sub one slash five by onefifth;
sub one slash six by onesixth;
sub one slash eight by oneeighth;
sub one fraction two by onehalf;
sub one fraction three by onethird;
sub one fraction four by onequarter;
sub one fraction five by onefifth;
sub one fraction six by onesixth;
sub one fraction eight by oneeighth;
sub two slash three by twothirds;
sub two slash five by twofifths;
sub two fraction three by twothirds;
sub two fraction five by twofifths;
sub three slash four by threequarters;
sub three slash five by threefifths;
sub three slash eight by threeeighths;
sub three fraction four by threequarters;
sub three fraction five by threefifths;
sub three fraction eight by threeeighths;
sub four slash five by fourfifths;
sub four fraction five by fourfifths;
sub five slash six by fivesixths;
sub five slash eight by fiveeighths;
sub five fraction six by fivesixths;
sub five fraction eight by fiveeighths;
sub seven slash eight by seveneighths;
sub seven fraction eight by seveneighths;
} frac ;
feature numr {
sub zero by uni0E50;
sub one by uni0E51;
sub two by uni0E52;
sub three by uni0E53;
sub four by uni0E54;
sub five by uni0E55;
sub six by uni0E56;
sub seven by uni0E57;
sub eight by uni0E58;
sub nine by uni0E59;
} numr ;
feature liga {
sub uni0E4F quotedbl by uni0E4F.liga;
sub uni0E24 uni0E32' by uni0E45 ;
sub uni0E26 uni0E32' by uni0E45 ;
sub [uni0E0D uni0E10 ]' [uni0E38 uni0E39 uni0E3A ] by [uni0E0D.alt1 uni0E10.alt1 ];
sub [uni0E48 uni0E49 uni0E4A uni0E4B uni0E4C ]' by [uni0E48.alt2 uni0E49.alt2 uni0E4A.alt2 uni0E4B.alt2 uni0E4C.alt2 ];
sub [uni0E1B uni0E1D uni0E1F ] [uni0E48.alt2 uni0E49.alt2 uni0E4A.alt2 uni0E4B.alt2 uni0E4C.alt2 ]' by [uni0E48.alt1 uni0E49.alt1 uni0E4A.alt1 uni0E4B.alt1 uni0E4C.alt1 ];
sub [uni0E1B uni0E1D uni0E1F ] [uni0E31 uni0E34 uni0E35 uni0E36 uni0E37 uni0E47 uni0E4D uni0E4E ]' by [uni0E31.alt1 uni0E34.alt1 uni0E35.alt1 uni0E36.alt1 uni0E37.alt1 uni0E47.alt1 uni0E4D.alt1 uni0E4E.alt1 ];
sub [uni0E1B uni0E1D uni0E1F ] [uni0E38 uni0E39 uni0E3A ] [uni0E48.alt2 uni0E49.alt2 uni0E4A.alt2 uni0E4B.alt2 uni0E4C.alt2 ]' by [uni0E48.alt1 uni0E49.alt1 uni0E4A.alt1 uni0E4B.alt1 uni0E4C.alt1 ];
sub [uni0E4E.alt1 uni0E34.alt1 uni0E35.alt1 uni0E36.alt1 uni0E37.alt1 uni0E31.alt1 uni0E4D.alt1 uni0E47.alt1 ] [uni0E48.alt2 uni0E49.alt2 uni0E4A.alt2 uni0E4B.alt2 uni0E4C.alt2 ]' by [uni0E48.alt3 uni0E49.alt3 uni0E4A.alt3 uni0E4B.alt3 uni0E4C.alt3 ];
sub [uni0E31 uni0E34 uni0E35 uni0E36 uni0E37 uni0E47 uni0E4D uni0E4E ] [uni0E48.alt2 uni0E49.alt2 uni0E4A.alt2 uni0E4B.alt2 uni0E4C.alt2 ]' by [uni0E48 uni0E49 uni0E4A uni0E4B uni0E4C ];
sub [uni0E48.alt2 uni0E49.alt2 uni0E4A.alt2 uni0E4B.alt2 uni0E4C.alt2 ]' [uni0E31 uni0E34 uni0E35 uni0E36 uni0E37 uni0E47 uni0E4D uni0E4E ] by [uni0E48 uni0E49 uni0E4A uni0E4B uni0E4C ];
sub [uni0E0E uni0E0F uni0E24 uni0E26 ] [uni0E38 uni0E39 uni0E3A ]' by [uni0E38.alt1 uni0E39.alt1 uni0E3A.alt1 ];
sub [uni0E1B uni0E1D uni0E1F ] uni0E33' by uni0E33.alt1 ;
sub [uni0E1B uni0E1D uni0E1F ] [uni0E48.alt1 uni0E49.alt1 uni0E4A.alt1 uni0E4B.alt1 uni0E4C.alt1 ]' uni0E33 by [uni0E48.alt3 uni0E49.alt3 uni0E4A.alt3 uni0E4B.alt3 uni0E4C.alt3 ];
sub [uni0E1B uni0E1D uni0E1F ] [uni0E48.alt1 uni0E49.alt1 uni0E4A.alt1 uni0E4B.alt1 uni0E4C.alt1 ]' uni0E4D by [uni0E48.alt3 uni0E49.alt3 uni0E4A.alt3 uni0E4B.alt3 uni0E4C.alt3 ];
sub [uni0E1B uni0E1D uni0E1F ] [uni0E48.alt3 uni0E49.alt3 uni0E4A.alt3 uni0E4B.alt3 uni0E4C.alt3 ] uni0E33' by uni0E33.alt1 ;
sub [uni0E1B uni0E1D uni0E1F ] [uni0E48.alt3 uni0E49.alt3 uni0E4A.alt3 uni0E4B.alt3 uni0E4C.alt3 ] uni0E4D' by uni0E4D.alt1 ;
sub [uni0E0E uni0E0F ]' [uni0E38.alt1 uni0E39.alt1 uni0E3A.alt1 ] by [uni0E0E.alt1 uni0E0F.alt1 ];
sub uni0E2C' [uni0E31 uni0E34 uni0E35 uni0E36 uni0E37 uni0E47 uni0E4D uni0E4E ] by uni0E2C.alt1 ;
sub [uni0E48.alt2 uni0E49.alt2 uni0E4A.alt2 uni0E4B.alt2 uni0E4C.alt2 ]' uni0E33 by [uni0E48 uni0E49 uni0E4A uni0E4B uni0E4C ];
sub [uni0E48.alt2 uni0E49.alt2 uni0E4A.alt2 uni0E4B.alt2 uni0E4C.alt2 ]' uni0E4D by [uni0E48 uni0E49 uni0E4A uni0E4B uni0E4C ];
sub L O G O period k a r u d a by karuda;
} liga ;
อันนี้คือ Glyphs.app แปลงให้จากฟอนต์เทมเพลตใช่ไหมครับ? ผมสงสัยว่ามันจะผิดตรง table name คุณเซฟเป็น *.ufo ใช่ไหม? ปกติพวก table "OS/2", "hhea", "name" มันจะเก็บในไฟล์ XML ที่ fontinfo.plist เพราะเวลาเอามาปนกับฟีเจอร์เราจะงง แต่ก็ไม่ถือว่าผิดนะฮะ Adobe บอกว่าทำได้ (https://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#9.e)
ลองแบ็คอัพแล้วลบ 2 บรรทัดนี้ออกดูนะครับ (ตรงท้าย table name) ผมคิดว่ามันไม่จำเป็นและ syntax อาจจะผิด เพราะถึงไม่ใส่ไว้ OS มันก็มีค่า default ให้อยู่แล้ว (nameid 14 1 สำหรับ Mac, nameid 14 3 สำหรับ Windows)
nameid 14 1 "–";
nameid 14 3 1 1033 "–";
ผมคิดว่ามันแปลกๆ ตรง "–" ปกติเขาจะใส่ string ที่เป็นการแปลงรหัสของ OS กับ Unicode เช่น 0×0409, \005C หรือตัวเลขกับตัวอักษรเดี่ยวๆ ไม่ต้องมี " " ครอบ
อีกอย่างฟอนต์มีตัวอักษรไทยก็ควรใส่ languagesystem thai dflt; เพิ่มต่อจากภาษาอื่นที่ด้านบนด้วยนะครับ (บางโปรแกรมมันไม่ฉลาดพอที่จะรู้ว่าตัวอักษรไทยต้องใช้กับภาษาอะไรบ้าง! :)
ผมทำตัวนี้จาก TFace-Template ครับ
เดี๋ยวผมจะลองแก้ตามคำแนะนำนะครับ ขอบคุณมากเลยครับสำหรับการเรียนรู้ :46: และความพยายามช่วยแก้ปัญหาครับผม