แม้กระทั่งเป็นแอปพลิเคชันที่รวมตัวชมรูปแบบกราฟิกและตัวแก้ไขง่าย ๆ สำหรับ Python มันมาพร้อมกับห้องสมุดแบนที่ติดตั้งไว้ล่วงหน้าเพื่อใช้ประโยชน์จากทั้งสองอย่างสะดวก
มีการแจกจ่ายภายใต้ใบอนุญาตโอเพ่นซอร์สและมีวัตถุประสงค์เพื่อเรียกใช้ข้ามแพลตฟอร์ม
เวิร์กโฟลว์ค่อนข้างง่าย - เปิดหรือเขียนโปรแกรมซึ่งสามารถสร้างผลลัพธ์ในรูปแบบหนึ่งที่รองรับและแสดงผลลัพธ์
ตำแหน่งเริ่มต้นสำหรับการค้นหาไฟล์โปรแกรมอาจพยายามใช้ (รูปภาพ, แบบอักษร, ... ) คือเดสก์ท็อปหากโปรแกรมยังไม่ได้บันทึกไว้ในดิสก์มิฉะนั้นจะเป็นโฟลเดอร์หลัก
ตัวอย่างเช่นมีการดาวน์โหลดแบบอักษรที่ได้รับการคัดลอกการคัดลอกข้อมูลตัวอย่างต่อไปนี้และเมนูทริกเกอร์ สคริปต์ Run จะแสดงภาพหน้าจอด้านบน:
from flat import font , text , strike , document , view
def layout ( author , title , * paragraphs ):
# Vollkorn by Friedrich Althausen
# http://friedrichalthausen.de/vollkorn/
regular = font . open ( 'Vollkorn-Regular.ttf' )
bold = font . open ( 'Vollkorn-Bold.ttf' )
body = strike ( regular ). size ( 12 , 16 )
headline = strike ( bold ). size ( 12 , 16 )
pieces = [
body . paragraph ( author ),
headline . paragraph ( title ),
body . paragraph ( '' )]
pieces . extend ( body . paragraph ( p ) for p in paragraphs )
doc = document ( 148 , 210 , 'mm' )
page = doc . addpage ()
block = page . place ( text ( pieces ))
while block . frame ( 18 , 21 , 114 , 167 ). overflow ():
page = doc . addpage ()
block = page . chain ( block )
return doc
doc = layout ( 'Vitruvius' , 'Ten Books on Architecture' ,
u'Chapter I u2014 The Education of the Architect' , '' ,
( '1. The architect should be equipped with knowledge of many branches of '
'study and varied kinds of learning, for it is by his judgement that all '
'work done by the other arts is put to test. This knowledge is the child '
'of practice and theory. Practice is the continuous and regular exercise '
'of employment where manual work is done with any necessary material '
'according to the design of a drawing. Theory, on the other hand, is the '
'ability to demonstrate and explain the productions of dexterity on the '
'principles of proportion.' ), '' ,
( '2. It follows, therefore, that architects who have aimed at acquiring '
'manual skill without scholarship have never been able to reach a '
'position of authority to correspond to their pains, while those who '
'relied only upon theories and scholarship were obviously hunting the '
'shadow, not the substance. But those who have a thorough knowledge of '
'both, like men armed at all points, have the sooner attained their '
'object and carried authority with them.' ), '' ,
( '3. In all matters, but particularly in architecture, there are these two '
u'points: u2014 the thing signified, and that which gives it its significance. '
'That which is signified is the subject of which we may be speaking; and '
'that which gives significance is a demonstration on scientific '
'principles. It appears, then, that one who professes himself an '
'architect should be well versed in both directions. He ought, therefore, '
'to be both naturally gifted and amenable to instruction. Neither natural '
'ability without instruction nor instruction without natural ability can '
'make the perfect artist. Let him be educated, skilful with the pencil, '
'instructed in geometry, know much history, have followed the '
'philosophers with attention, understand music, have some knowledge of '
'medicine, know the opinions of the jurists, and be acquainted with '
'astronomy and the theory of the heavens.' ))
view ( doc . pdf ())วัตถุที่มีอยู่ของไลบรารีจะถูก decribed ที่การอ้างอิง API
นอกจากนี้ยังเป็นไปได้ที่จะสร้างเอาต์พุตด้วยไลบรารีอื่นที่ไม่ใช่แฟลตตราบใดที่พวกเขาสามารถส่งออกรูปแบบ PNG, JPEG หรือ PDF
ในการดูผลลัพธ์รวมถึง from flat import view และ view(<data>) เป็นทางเลือกเพื่อหลีกเลี่ยงการแบนอย่างสมบูรณ์เราสามารถเขียนฟังก์ชั่นการนำเสนอที่กำหนดเองได้เช่นกัน สำหรับรายละเอียดอ้างอิงถึงซอร์สโค้ดของ even.py ของแฟลต
ไบนารีของเวอร์ชัน 0.2 สำหรับ MacOS, Ubuntu 16.04
สำหรับ Ubuntu โปรดติดตั้งทั้ง QT และ PYPY: sudo apt-get install qt5-default pypy
github.com/xxyxyz/even
แม้แต่ใช้คอมไพเลอร์ Pypy JIT, QT Framework และ MUPDF Library ขอบคุณ!
เนื้อหาต้นฉบับของ xxyxyz.org สามารถเข้าถึงได้ผ่านเครื่อง Wayback
Juraj Sukop, [email protected]