Add warning about ttf extended ASCII.

pull/16/head
Peter Hinch 2018-03-11 11:01:46 +00:00
rodzic de1e7cc65b
commit f3f75c56ba
2 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -44,6 +44,10 @@ Example usage to produce a file ``myfont.py`` with height of 23 pixels:
Any requirement for arguments -xr will be specified in the device driver Any requirement for arguments -xr will be specified in the device driver
documentation. Bit reversal is required by some display hardware. documentation. Bit reversal is required by some display hardware.
Note that producing extended ASCII characters (ordinal value > 127) from ttf
files seems unreliable. If the expected results are not achieved, use an otf
font. This appears to be a limitation of the `freetype` library.
### Output ### Output
The specified height is a target. The algorithm gets as close to the target The specified height is a target. The algorithm gets as close to the target

Wyświetl plik

@ -517,6 +517,8 @@ if __name__ == "__main__":
if args.largest > 255: if args.largest > 255:
quit('--largest must be < 256') quit('--largest must be < 256')
elif args.largest > 127 and os.path.splitext(args.infile)[1].upper() == '.TTF':
print('WARNING: extended ASCII characters may not be correctly converted. See docs.')
if args.errchar < 0 or args.errchar > 255: if args.errchar < 0 or args.errchar > 255:
quit('--errchar must be between 0 and 255') quit('--errchar must be between 0 and 255')