Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have an issue with upcean.fonts #11

Open
WHRM1 opened this issue Apr 13, 2023 · 5 comments
Open

I have an issue with upcean.fonts #11

WHRM1 opened this issue Apr 13, 2023 · 5 comments

Comments

@WHRM1
Copy link

WHRM1 commented Apr 13, 2023

Hello,

I have an issue with upcean.fonts when I try to use validate_create_barcode.

In fact it looks like to don't recognized the fontpathocra in my laptop.
This is my error code :

File "C:\Users\D001919\AppData\Roaming\Python\Python39\site-packages\upcean\encode\barcode.py", line 95, in validate_create_ean13_barcode
   return create_ean13_barcode(upc,outfile,resize,hideinfo,barheight,barwidth,textxy,barcolor,imageoutlib);
 File "C:\Users\D001919\AppData\Roaming\Python\Python39\site-packages\upcean\encode\ean13.py", line 396, in create_ean13_barcode
   drawColorText(upc_img, 10 * int(resize * barwidth[1]), (2 + (2 * (int(resize) - 1))) * barwidth[0], cairo_addon_fix + (barheight[0] + (barheight[0] * (int(resize) - 1)) + pil_addon_fix) + (textxy[0] * int(resize)), upc_matches[0], barcolor[1], "ocrb", imageoutlib);
 File "C:\Users\D001919\AppData\Roaming\Python\Python39\site-packages\upcean\encode\predraw.py", line 122, in drawColorText
   return upcean.encode.prepil.drawColorText( ctx, size, x, y, text, color, ftype );
 File "C:\Users\D001919\AppData\Roaming\Python\Python39\site-packages\upcean\encode\prepil.py", line 58, in drawColorText
   font = ImageFont.truetype(fontpathocrb, size);
 File "C:\Users\D001919\AppData\Roaming\Python\Python39\site-packages\PIL\ImageFont.py", line 996, in truetype
   return freetype(font)
 File "C:\Users\D001919\AppData\Roaming\Python\Python39\site-packages\PIL\ImageFont.py", line 993, in freetype
   return FreeTypeFont(font, size, index, encoding, layout_engine)
 File "C:\Users\D001919\AppData\Roaming\Python\Python39\site-packages\PIL\ImageFont.py", line 248, in __init__
   self.font = core.getfont(
OSError: unknown file format

@KazukiPrzyborowski do you have any idea to fix this problem ? I already install and uninstall the PIL and Pillow packages

@KazukiPrzyborowski
Copy link
Contributor

Looks like the font file got corrupted some how.
I'll try to see if i can fix it.

@WHRM1
Copy link
Author

WHRM1 commented Apr 17, 2023 via email

@KazukiPrzyborowski
Copy link
Contributor

Made some changes that might fix this.
If you can try and tell me if you still get this error.

@WHRM1
Copy link
Author

WHRM1 commented Apr 18, 2023 via email

@KazukiPrzyborowski
Copy link
Contributor

Can you upload the file df_all.xlsx that way I I can test out the code might make it easy to figure out what might be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants