A simple typewriter-effect image generator. Named after Mingkuai Chinese Typewriter.
- Python 3.?
- PIL
genFont.py
: reads a specified font and stores images of characters inassets\pic\
render.py inputTextName outputImageName
: renders an image, storing intooutputImageName.png
- despites the random effects cast on the glyphs, same characters are rendered the same
- alter the variables (e.g.
dim
,ful
,defaultRandSeed
) to get different results
Code | Result |
---|---|
dim=0.01 ful=0.99 |
|
dim=0.01 ful=0.99 sqrt |
|
dim=0.50 ful=0.90 sqrt |
- here
sqrt
stands fornewPixel=tuple(int(i*math.sqrt(coeffW*coeffH)) for i in imagePixel)
; you'll have to read line31
-50
ofrender.py
to understand its meaning
- Font used for demonstration purposes: belluzj/fantasque-sans
- Text used for demonstration purposes: Typewriter from Wikipedia, (revision 1190208273)