심지어 그래픽 형식의 시청자와 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 ())라이브러리의 사용 가능한 객체는 API 참조에서 분류됩니다.
PNG, JPEG 또는 PDF 형식을 내보낼 수있는 한 Flat 이외의 라이브러리로 출력을 생성 할 수도 있습니다.
결과를 보려면 from flat import view 및 통화 view(<data>) 에서 포함됩니다. 선택적으로, 평평하게 평평하게 측정하기 위해서는 사용자 정의 제시 기능도 작성할 수 있습니다. 자세한 내용은 even.py 의 소스 코드를 참조하십시오.
MacOS의 경우 0.2 버전의 바이너리, 우분투 16.04.
Ubuntu의 경우 QT와 Pypy를 모두 설치하십시오 : sudo apt-get install qt5-default pypy .
github.com/xxyxyz/even
PYPY JIT 컴파일러, QT 프레임 워크 및 MUPDF 라이브러리도 사용합니다. 감사해요!
xxyxyz.org의 원래 콘텐츠는 Wayback Machine을 통해 액세스 할 수 있습니다.
Juraj Sukop, [email protected]