python-barcode icon indicating copy to clipboard operation
python-barcode copied to clipboard

Many fonts can not be used

Open lidannyapple opened this issue 1 year ago • 0 comments

Many fonts can not be used, even the official font DejaVuSansMono.ttf, change a folder can not be used, only some of the fonts are more generic fonts can be used. The DejaVuSansMono.ttf. font in the following code does not work, this font is confirmed to have been installed in the system fonts folder, in other software such as WORD can be used. I have tried many fonts, some can be used, some can not be used, the barcode can not be made or displayed.

[email protected]

barcode.save(barcode_image_path, options={ 'write_text': True, 'quiet_zone': 0.5, 'text_distance': 3, 'module_height': 5.0, 'module_width': 0.2, 'background': "white", 'foreground': "black", 'font_size': 7, 'dpi': 1200, 'margin_bottom': -1, 'margin_top': 0.5, 'guard_height_factor': 1.1, 'center_text': True, 'text_line_distance': 1, 'human': "",#"Human Readable Text", 'text':"", #"Custom Text", 'font_path': os.path.join("C:\windows", "fonts", "DejaVuSansMono.ttf"), })

lidannyapple avatar Sep 10 '24 05:09 lidannyapple